[gdal-dev] OGR GeoJSON transormation woes

Even Rouault even.rouault at spatialys.com
Thu May 7 03:47:51 PDT 2020


On jeudi 7 mai 2020 03:28:15 CEST jratike80 wrote:
> Hi,
> 
> I fear that such a change in GeoJSON would not really correct anything but
> rather move the confusion into another place.

Yeah, especially since GeoJSON rather claims using OGC:1.3:CRS84 which is long, lat. But for 
interoperability with EPSG, the OGR GeoJSON driver reports EPSG:4326, with 
OAMS_TRADITIONAL_GIS_ORDER, and thus longitude, latitude coordinate order, as it has 
done forever.

When you want to reproject a geometry coming from a OGR driver, you can just use the SRS 
object of the layer or the geometry as the source CRS for the CoordinateTransformation 
object that will have the axis mapping consistent with the order of the geometry 
coordinates. No need to tweek axis mapping for the source.
For the target CRS, it is up to you to decide if you want to be authority compliant or in the 
GIS-friendly camp :-)

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200507/610be8fc/attachment.html>


More information about the gdal-dev mailing list