diff options
author | QuentinAndre <quentin.andre@imt-atlantique.net> | 2021-07-16 10:25:23 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-09-01 12:36:46 +0200 |
commit | c18865b0d1e0103abcd7db77ec99abe39dbdbcd4 (patch) | |
tree | 9b029504bdf0ecf5922c164cea40e5c2c41e92f7 /ishtar_common/models_common.py | |
parent | 57cb006e6fcafc67dd4a8423cb3d273bdd14a18b (diff) | |
download | Ishtar-c18865b0d1e0103abcd7db77ec99abe39dbdbcd4.tar.bz2 Ishtar-c18865b0d1e0103abcd7db77ec99abe39dbdbcd4.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: |