Discrepancy in EPSG:3003 Coordinate Conversion Results in MATLAB

조회 수: 5 (최근 30일)
Matteo
Matteo 2025년 1월 27일
댓글: Matteo 2025년 5월 5일
Hi everyone,
I need to convert latitude and longitude coordinates to the EPSG:3003 coordinate system. I have written the following lines of code:
proj3003 = projcrs(3003);
posLLH = [43.7918028 11.2474672 0];
[posEPSG3003(1), posEPSG3003(2)] = projfwd(proj3003, posLLH(1), posLLH(2));
I get the following result:
posEPSG3003 = [1680827.953610798, 4851292.727994160]
However, when I use an online tool like the one at EPSG.io, I get:
posEPSG3003 = [1680850, 4851220]
Can anyone explain the reason for this discrepancy?
Thank you in advance for your help!

답변 (1개)

Purvaja
Purvaja 2025년 5월 2일
편집: Purvaja 2025년 5월 2일
Hi @Matteo,
Referring to your question, I understand that you're observing a discrepancy between the EPSG:3003 coordinate conversion results obtained using MATLAB's “projfwd function and those from an online tool like EPSG.io.
Specifically, your MATLAB code yields:
posEPSG3003 = [1680827.953610798, 4851292.727994160];
whereas EPSG.io provides:
posEPSG3003 = [1680850, 4851220];
This discrepancy arises due to differences in the transformation parameters and methods used by MATLAB and EPSG.io. MATLAB's “projcrs and “projfwd functions rely on the PROJ library, which may use different default transformation paths or parameters compared to those employed by EPSG.io. These differences can lead to variations in the projected coordinates.
This documentation indicates that MATLAB is using PROJ library for conversion:
For more clarifications refer to following documentation links:
  1. projlist : https://www.mathworks.com/help/map/ref/projlist.html
  2. Projcrs : https://www.mathworks.com/help/map/ref/projcrs.html
  3. Projfwd: https://www.mathworks.com/help/map/ref/projcrs.projfwd.html
  4. PROJ: https://proj.org/en/stable/resource_files.html
For version specific MATLAB documentation links type following commands in MATLAB command window:
web(fullfile(docroot, '/map/ref/projlist.html'))
web(fullfile(docroot, '/map/ref/projcrs.html'))
web(fullfile(docroot, '/map/ref/projcrs.projfwd.html'))
Hope this helps you!
  댓글 수: 1
Matteo
Matteo 2025년 5월 5일
thank you for answering.
Going to the PROJ C++ library, I found out that when the "SpatialCriterion" is set to "PARTIAL_INTERSECTION", the solutions provided by PROJ and EPSG.io coincide.
However, I haven't found a way to set it in Matlab.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by