[fix] neighborhood reverse geocoder using the new OSM definitions module which keeps track of whatever the data fetching script defines as being a valid {neighborhood, admin boundary, etc.}
This commit is contained in:
@@ -17,6 +17,7 @@ from geodata.file_utils import ensure_dir, download_file
|
|||||||
from geodata.i18n.unicode_properties import get_chars_by_script
|
from geodata.i18n.unicode_properties import get_chars_by_script
|
||||||
from geodata.i18n.word_breaks import ideographic_scripts
|
from geodata.i18n.word_breaks import ideographic_scripts
|
||||||
from geodata.names.deduping import NameDeduper
|
from geodata.names.deduping import NameDeduper
|
||||||
|
from geodata.osm.definitions import osm_definitions
|
||||||
from geodata.osm.extract import parse_osm, osm_type_and_id, NODE, WAY, RELATION, OSM_NAME_TAGS
|
from geodata.osm.extract import parse_osm, osm_type_and_id, NODE, WAY, RELATION, OSM_NAME_TAGS
|
||||||
from geodata.polygons.index import *
|
from geodata.polygons.index import *
|
||||||
from geodata.polygons.reverse_geocode import QuattroshapesReverseGeocoder
|
from geodata.polygons.reverse_geocode import QuattroshapesReverseGeocoder
|
||||||
@@ -299,7 +300,7 @@ class NeighborhoodReverseGeocoder(RTreePolygonIndex):
|
|||||||
props['type'] = id_type
|
props['type'] = id_type
|
||||||
props['id'] = element_id
|
props['id'] = element_id
|
||||||
|
|
||||||
is_neighborhood = attrs.get('place') == 'neighbourhood'
|
is_neighborhood = osm_definitions.meets_definition(attrs, osm_defintiions.NEIGHBORHOOD)
|
||||||
|
|
||||||
ranks = []
|
ranks = []
|
||||||
osm_names = []
|
osm_names = []
|
||||||
|
|||||||
Reference in New Issue
Block a user