Код: Выделить всё
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Я проверил эти значения как с помощью epsg.io, так и с помощью gdaltransform -s_srs epsg: 3042 -t_srs epsg: 4326
Однако после запуска выше c++ 30.955960867356925 3.3330599352594454 , которые отличаются от ожидаемого результата.
Как вы можете видеть в коде, я использовал:
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.
Подробнее здесь: https://stackoverflow.com/questions/797 ... oordinates
Мобильная версия