Ogrcoordinatetransformation.transform () gibt falsche Koordinaten anC++

Programme in C++. Entwicklerforum
Anonymous
 Ogrcoordinatetransformation.transform () gibt falsche Koordinaten an

Post by Anonymous »

Ich versuche, einige lokale bis globale (EPSG: 3042 zu EPSG: 4326) in einem ROS2 C ++ -Skript mit GDAL zu tun.

Code: Select all

OGRCoordinateTransformation *Transformation;

OGRSpatialReference poLocal, poGlobal;
poLocal.importFromEPSG(epsg_local);
poGlobal.importFromEPSG(WGS84);
poGlobal.SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER);

OGRCoordinateTransformationOptions options;
options.SetAreaOfInterest(-4.0, 40.0, -2.0, 41.0);

Transformation = OGRCreateCoordinateTransformation(&poLocal, &poGlobal, options);

Transformation->Transform(n, y, x, z);
< /code>
epsg_local
und wgs84 sind Ganzzahlen mit den Werten 3042 bzw. 4326. 40.7796147581481 . 30.955960867356925 3.330599352594454 , was sich ziemlich stark vom erwarteten Ergebnis unterscheidet.OGRCoordinateTransformationOptions.SetAreaOfInterest(-4.0, 40.0, -2.0, 41.0);
< /code>
to make sure it gives me the coordinates over there. However, that doesn't stop it from giving me the wrong ones.
What could be the reason for this behavior?
My version of GDAL is 3.4.1+dfsg-1build4 and PROJ is 8.2.1-1. These were chosen because they were needed for some other libraries.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post