diff options
author | QuentinAndre <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 | 92bd9026e0b6397103da83bffe64f3a53ee06742 (patch) | |
tree | 46ef9daf4115431ac8ac1cc33f8524a884d89b00 /ishtar_common/models_common.py | |
parent | 102245e0088963f3f31d41ce086fda0d5d70a05c (diff) | |
download | Ishtar-92bd9026e0b6397103da83bffe64f3a53ee06742.tar.bz2 Ishtar-92bd9026e0b6397103da83bffe64f3a53ee06742.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: |