Skip to content

Commit

Permalink
fix geometry ref
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Mar 13, 2023
1 parent e9bde69 commit a1ff29d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions python/plugins/MetaSearch/search_backend.py
Expand Up @@ -221,17 +221,18 @@ def records(self):
rec1 = {
'identifier': rec['id'],
'type': rec['properties']['type'],



'bbox': None,
'title': rec['properties']['title'],
'links': rec.get('links', [])
}
try:
bbox2 = rec['properties']['extent']['spatial']['bbox'][0]
if bbox2:
rec1['bbox'] = bbox_list_to_dict(bbox2)
if rec.get('geometry') is not None:
rec1['bbox'] = bbox_list_to_dict([
rec['geometry']['coordinates'][0][0][0],
rec['geometry']['coordinates'][0][0][1],
rec['geometry']['coordinates'][0][2][0],
rec['geometry']['coordinates'][0][2][1]
])
except KeyError:
pass

Expand Down

0 comments on commit a1ff29d

Please sign in to comment.