summaryrefslogtreecommitdiff
path: root/ishtar_common/models_common.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2022-06-15 10:22:01 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-12-12 12:21:01 +0100
commit849162d584d9a430f86be20cb0ce7affc916d0f4 (patch)
tree4a17c15d334249d2ae4f5d53395e608299336d7e /ishtar_common/models_common.py
parentb79a9f027dae73bd394b1618491fd4d5c10e13cd (diff)
downloadIshtar-849162d584d9a430f86be20cb0ce7affc916d0f4.tar.bz2
Ishtar-849162d584d9a430f86be20cb0ce7affc916d0f4.zip
Fix migrations
Diffstat (limited to 'ishtar_common/models_common.py')
-rw-r--r--ishtar_common/models_common.py22
1 files changed, 4 insertions, 18 deletions
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py
index b13517f25..2fb0d40f6 100644
--- a/ishtar_common/models_common.py
+++ b/ishtar_common/models_common.py
@@ -2266,6 +2266,8 @@ class GeoVectorData(Imported, OwnPerms):
args["z"] = self.z
point = Point(**args).transform(srid, clone=True)
coordinates = [point.x, point.y]
+ if srid == 4326:
+ coordinates = list(reversed(coordinates))
if dim == 3:
coordinates.append(point.z)
else:
@@ -3470,25 +3472,9 @@ class GeoItem(GeographicItem):
@property
def display_coordinates(self, rounded=True):
- if not self.point_2d:
+ if not self.main_geodata:
return ""
- profile = get_current_profile()
- if (
- not profile.display_srs
- or not profile.display_srs.srid
- or (
- profile.display_srs == self.spatial_reference_system
- and self.x
- and self.y
- )
- ):
- x, y = self.x, self.y
- else:
- point = self.point_2d.transform(profile.display_srs.srid, clone=True)
- x, y = point.x, point.y
- if rounded:
- return round(x, 5), round(y, 5)
- return x, y
+ return self.main_geodata.display_coordinates(rounded=rounded)
@property
def display_spatial_reference_system(self):