From 42f80efcf7d6b5852f4f6d7f8edbda907bdb450b Mon Sep 17 00:00:00 2001 From: Thomas LESNE Date: Mon, 27 Jul 2020 21:21:37 +0200 Subject: [PATCH] Fix coordinate transformation in ogr-decode for GDAL>=3 as advised in GDAL migration guide (fixes #2318) --- src/Prep/OGRDecode/ogr-decode.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Prep/OGRDecode/ogr-decode.cxx b/src/Prep/OGRDecode/ogr-decode.cxx index 14b31ff3..c9cb2eb3 100644 --- a/src/Prep/OGRDecode/ogr-decode.cxx +++ b/src/Prep/OGRDecode/ogr-decode.cxx @@ -432,6 +432,11 @@ void processLayer(OGRLayer* poLayer, tgChopper& results) oTargetSRS.SetWellKnownGeogCS("WGS84"); +#if GDAL_VERSION_MAJOR >= 3 + oSourceSRS->SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); + oTargetSRS.SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); +#endif + auto poCT = OGRCreateCoordinateTransformation(oSourceSRS, &oTargetSRS); /* setup attribute and spatial queries */