[gdal-dev] Transform produces different results from 2.2.4 and 3.0.2 or 3.0.3

mike Null gdisk.mike at gmail.com
Wed Jan 29 04:11:10 PST 2020


Even, Carsten, thanks.

Indeed I looked through what Even sent, and it worked. I did very much the
same thing as the C# example you just posted.

However it got me thinking. Will I need to do this in the future? Or are
there plans for coordinate transformation to use the new axis ordering
system?

Anyways, thanks again.

Mike



On Wed, Jan 29, 2020, 00:30 Carsten Lockenk├Âtter <
carsten.lockenkoetter at gon.de> wrote:

> 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
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200129/7ee0dd71/attachment-0001.html>


More information about the gdal-dev mailing list