diff options
author | Quentin André <quentin.andre@imt-atlantique.net> | 2021-07-16 10:25:23 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-07-08 09:58:48 +0200 |
commit | 69662fc9a759b8c005a7c4bbfa755945ee3dfda1 (patch) | |
tree | 46ef9daf4115431ac8ac1cc33f8524a884d89b00 /ishtar_common/models_common.py | |
parent | db7c86bda1e153c410faedb1b61b59acb353969d (diff) | |
download | Ishtar-69662fc9a759b8c005a7c4bbfa755945ee3dfda1.tar.bz2 Ishtar-69662fc9a759b8c005a7c4bbfa755945ee3dfda1.zip |
format GeoJSON and getting properly related objects
Diffstat (limited to 'ishtar_common/models_common.py')
-rw-r--r-- | ishtar_common/models_common.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index f99252fd2..cf994c8c0 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -2857,10 +2857,11 @@ class GeoItem(models.Model): return self.multi_polygon, self.multi_polygon_source_item def get_geo_items(self, get_polygons, rounded=True): - dict = { - "type": "Feature", - "geometry": {}, - } + try: + label = self.label + except: + label = self.short_label + dict = {"type": "Feature", "geometry": {}, "properties": {"label": label}} if get_polygons: list_coords = [] if self.multi_polygon: |