diff options
Diffstat (limited to 'ishtar_common/models_common.py')
| -rw-r--r-- | ishtar_common/models_common.py | 15 | 
1 files changed, 9 insertions, 6 deletions
| diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index 66025948a..cea327e13 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -2234,19 +2234,22 @@ class GeoVectorData(Imported, OwnPerms):      def source_label(self):          return str(self.source) -    def display_coordinates(self, rounded=5, dim=2, srid=4326, cache=True): +    def display_coordinates(self, rounded=5, dim=2, srid=None, cache=True):          if not srid: -            profile = get_current_profile() -            if profile.display_srs and profile.display_srs.srid: -                srid = profile.display_srs.srid +            if self.spatial_reference_system and self.spatial_reference_system.srid: +                srid = self.spatial_reference_system.srid              else: -                srid = 4326 +                profile = get_current_profile() +                if profile.display_srs and profile.display_srs.srid: +                    srid = profile.display_srs.srid +        if not srid: +            srid = 4326          return self.get_coordinates(rounded=rounded, srid=srid, dim=dim, cache=cache)      def get_coordinates(self, rounded=5, srid: int = None, dim=2, cache=False):          if dim not in (2, 3):              raise ValueError(_("Only 2 or 3 dimensions")) -        if cache: +        if cache and srid == 4326:              coordinates = [self.cached_x, self.cached_y]              if dim == 3:                  coordinates.append(self.cached_z) | 
