[gdal-dev] Transform produces different results from 2.2.4 and 3.0.2 or 3.0.3
Carsten Lockenkötter
carsten.lockenkoetter at gon.de
Tue Jan 28 23:30:17 PST 2020
I ran into the same problem a while back.
My solution was to change the AxisMapStrategy to OAMS_TRADITION_GIS_ORDER.
You can read more about this here:
https://gdal.org/tutorials/osr_api_tut.html
My code in C#:
var source = new SpatialReference("");
var destination = new SpatialReference("");
Geometry ogrGeom = null;
CoordinateTransformation transform = null;
//set spatialrefrence for source and destinaton epsg
source.ImportFromEPSG(sourceEPSG);
destination.ImportFromEPSG(destEPSG);
source.SetAxisMappingStrategy(AxisMappingStrategy.OAMS_TRADITIONAL_GIS_ORDER);
destination.SetAxisMappingStrategy(AxisMappingStrategy.OAMS_TRADITIONAL_GIS_ORDER);
//create coordinate transformation with source and destination spatialreference
transform = new CoordinateTransformation(source, destination);
//create a gdal geometry object from Wkt and transform it
ogrGeom = Geometry.CreateFromWkt(geom.Value);
ogrGeom.Transform(transform);
//export transformed geometry
ogrGeom.ExportToWkt(out string outGeom);
-------------------------------------------------------------------------------------------------
-----Ursprüngliche Nachricht-----
Von: gdal-dev <gdal-dev-bounces at lists.osgeo.org> Im Auftrag von Even Rouault
Gesendet: Dienstag, 28. Januar 2020 17:12
An: gdal-dev at lists.osgeo.org
Betreff: Re: [gdal-dev] Transform produces different results from 2.2.4 and 3.0.2 or 3.0.3
> What might I need to do to get it working correctly? I know there was
> a lot of changes with gdalbarn/proj.
Indeed. See
https://lists.osgeo.org/pipermail/gdal-dev/2020-January/051425.html
--
Spatialys - Geospatial professional services http://www.spatialys.com _______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev
More information about the gdal-dev
mailing list