diff options
Diffstat (limited to 'ishtar_common/models_imports.py')
-rw-r--r-- | ishtar_common/models_imports.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/ishtar_common/models_imports.py b/ishtar_common/models_imports.py index 6f6d7109e..1fb5d4fcc 100644 --- a/ishtar_common/models_imports.py +++ b/ishtar_common/models_imports.py @@ -64,6 +64,7 @@ from ishtar_common.utils import ( num2col, max_size_help, import_class, + reverse_coordinates, ) from ishtar_common.data_importer import ( Importer, @@ -1086,14 +1087,6 @@ def delayed_check(import_pk): imp.check_modified() -RE_NUMBER = r"[+-]?\d+(?:\.\d*)?" -RE_COORDS = r"(" + RE_NUMBER + r") (" + RE_NUMBER + r")" - - -def _reverse_coordinates(wkt): - return re.sub(RE_COORDS, r"\2 \1", wkt) - - def convert_geom(feature, srid): geo_type = feature["type"] if geo_type in ("LineString", "Polygon"): @@ -1110,7 +1103,7 @@ def convert_geom(feature, srid): srs = profile.srs.srid if srs != srid: # Coordinates are reversed - should be fixed on Django 3.2 - feature = _reverse_coordinates( + feature = reverse_coordinates( GEOSGeometry(feature).transform(srs, clone=True).ewkt) return feature |