diff options
author | QuentinAndre <quentin.andre@imt-atlantique.net> | 2021-07-16 10:25:23 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-11-16 17:04:41 +0100 |
commit | c217e7b18bc499f336d9679f4821078ee2ff1a61 (patch) | |
tree | 52d4653be660dbaef33e79d8a3e8a2e027b39b5b /ishtar_common/models_common.py | |
parent | dc3d649e092fc232a9db07e5883015868f896140 (diff) | |
download | Ishtar-c217e7b18bc499f336d9679f4821078ee2ff1a61.tar.bz2 Ishtar-c217e7b18bc499f336d9679f4821078ee2ff1a61.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 5fa3598fd..4691de69c 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: |