From 59f551ef2058ca50699dd4055892063e44055402 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 12 May 2022 17:16:26 +0200 Subject: Geodata: import - fix reverse and default data --- ishtar_common/models_imports.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ishtar_common/models_imports.py') diff --git a/ishtar_common/models_imports.py b/ishtar_common/models_imports.py index aab404b63..6f6d7109e 100644 --- a/ishtar_common/models_imports.py +++ b/ishtar_common/models_imports.py @@ -1091,7 +1091,6 @@ RE_COORDS = r"(" + RE_NUMBER + r") (" + RE_NUMBER + r")" def _reverse_coordinates(wkt): - # TODO: à effacer return re.sub(RE_COORDS, r"\2 \1", wkt) @@ -1110,7 +1109,9 @@ def convert_geom(feature, srid): if profile.srs and profile.srs.srid: srs = profile.srs.srid if srs != srid: - feature = GEOSGeometry(feature).transform(srs, clone=True).ewkt + # Coordinates are reversed - should be fixed on Django 3.2 + feature = _reverse_coordinates( + GEOSGeometry(feature).transform(srs, clone=True).ewkt) return feature -- cgit v1.2.3