diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-05-12 17:16:26 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:21:00 +0100 |
commit | 5665c3b2c2f618c44a13fd83418d8b556a7f6440 (patch) | |
tree | 44191d7baccf4fb5610470593349d420b48d2b35 /ishtar_common/models_imports.py | |
parent | 39ef46715a2aa13fa3b82849fc0f0632c136005a (diff) | |
download | Ishtar-5665c3b2c2f618c44a13fd83418d8b556a7f6440.tar.bz2 Ishtar-5665c3b2c2f618c44a13fd83418d8b556a7f6440.zip |
Geodata: import - fix reverse and default data
Diffstat (limited to 'ishtar_common/models_imports.py')
-rw-r--r-- | ishtar_common/models_imports.py | 5 |
1 files changed, 3 insertions, 2 deletions
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 |