From f4a53fc076861396c52e971a45ef6aa164584e0a Mon Sep 17 00:00:00 2001 From: ingalls Date: Wed, 9 Feb 2022 15:33:44 -0700 Subject: [PATCH] Custom EPSG should use traditional coordintae order --- openaddr/conform.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openaddr/conform.py b/openaddr/conform.py index 53c88a19..e5db3f3b 100644 --- a/openaddr/conform.py +++ b/openaddr/conform.py @@ -463,6 +463,10 @@ def ogr_source_to_csv(source_config, source_path, dest_path): _L.debug("SRS tag found specifying %s", srs) inSpatialRef = osr.SpatialReference() inSpatialRef.ImportFromEPSG(int(srs[5:])) + + if int(osgeo.__version__[0]) >= 3: + # GDAL 3 changes axis order: https://github.com/OSGeo/gdal/issues/1546 + inSpatialRef.SetAxisMappingStrategy(osgeo.osr.OAMS_TRADITIONAL_GIS_ORDER) else: # OGR is capable of doing more than EPSG, but so far we don't need it. raise Exception("Bad SRS. Can only handle EPSG, the SRS tag is %s", srs)