Discrepancy in EPSG:3003 Coordinate Conversion Results in MATLAB

5 次查看(过去 30 天)
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