mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-16 21:50:41 +01:00
Geography: Fix crash in nominatim.py when some results are not OSM objects
This commit is contained in:
parent
162e974aba
commit
696d82ccfe
@ -31,8 +31,6 @@
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
import string
|
|
||||||
import datetime
|
|
||||||
import threading
|
import threading
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
@ -77,4 +75,4 @@ def search_osmids(query):
|
|||||||
on the query format"""
|
on the query format"""
|
||||||
data = _query_nominatim("/search", {"format": "json", "q": query})
|
data = _query_nominatim("/search", {"format": "json", "q": query})
|
||||||
|
|
||||||
return [item["osm_id"] for item in data]
|
return [item["osm_id"] for item in data if item.get("osm_id")]
|
||||||
|
@ -114,5 +114,4 @@ class GeographyNominatimTestCase(SupyTestCase):
|
|||||||
self.assertEqual(results[0], 450381, results)
|
self.assertEqual(results[0], 450381, results)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user