diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-05-15 19:37:31 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-05-15 19:37:31 +0200 |
commit | fc3d058bafe6fd844bf6cb1d0f874fbac56f9b17 (patch) | |
tree | f6cca459ea5a5577817e410a16965271a0fe8cdb /ishtar_common/models.py | |
parent | cf1b29891bfd9b04db74ce1999530c9326c6cf0e (diff) | |
download | Ishtar-fc3d058bafe6fd844bf6cb1d0f874fbac56f9b17.tar.bz2 Ishtar-fc3d058bafe6fd844bf6cb1d0f874fbac56f9b17.zip |
Geo: fix display of precise polygons
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 4b14d852c..8774ed951 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1742,6 +1742,26 @@ class GeoItem(models.Model): if self.multi_polygon_source == 'P' and self.multi_polygon: return self.multi_polygon, self.multi_polygon_source_item + def most_precise_geo(self): + if self.point_source == 'M': + return 'multi_polygon' + current_source = unicode(self.__class__._meta.verbose_name) + if self.multi_polygon_source_item == current_source \ + and (self.multi_polygon_source == "P" or + self.point_source_item != current_source): + return 'multi_polygon' + if self.point_source_item == current_source\ + and self.point_source == 'P': + return 'point' + if self.multi_polygon_source == 'P': + return 'multi_polygon' + if self.point_source == 'P': + return 'point' + if self.multi_polygon: + return 'multi_polygon' + if self.point_2d: + return 'point' + def geo_point_source(self): if not self.point_source: return "" |