Discrepancy in EPSG:3003 Coordinate Conversion Results in MATLAB

12 Ansichten (letzte 30 Tage)
Matteo
Matteo am 27 Jan. 2025
Kommentiert: Matteo am 5 Mai 2025
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!

Antworten (1)

Purvaja
Purvaja am 2 Mai 2025
Bearbeitet: Purvaja am 2 Mai 2025
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 Kommentar
Matteo
Matteo am 5 Mai 2025
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by