diff options
author | QuentinAndre <quentin.andre@imt-atlantique.net> | 2021-07-16 10:25:23 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-10-25 12:06:02 +0200 |
commit | c31d1773e5fe60baf3108aba736cd6538a8e4e73 (patch) | |
tree | 2e8805dc8faed655e4bc0dceec24cfb49599ff26 /ishtar_common/models_common.py | |
parent | b7413fe72698e37d281b3507edcb203191ef8f1e (diff) | |
download | Ishtar-c31d1773e5fe60baf3108aba736cd6538a8e4e73.tar.bz2 Ishtar-c31d1773e5fe60baf3108aba736cd6538a8e4e73.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 fcd252577..5d1cd5d90 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -2848,10 +2848,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: |