mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
geocodejson: admin level output should only print boundaries
This commit is contained in:
committed by
Sarah Hoffmann
parent
1c3ed66ca1
commit
b4e2e7de16
@@ -247,7 +247,8 @@ def format_base_geocodejson(results: Union[napi.ReverseResults, napi.SearchResul
|
|||||||
out.key('admin').start_object()
|
out.key('admin').start_object()
|
||||||
if result.address_rows:
|
if result.address_rows:
|
||||||
for line in result.address_rows:
|
for line in result.address_rows:
|
||||||
if line.isaddress and (line.admin_level or 15) < 15 and line.local_name:
|
if line.isaddress and (line.admin_level or 15) < 15 and line.local_name \
|
||||||
|
and line.category[0] == 'boundary' and line.category[1] == 'administrative':
|
||||||
out.keyval(f"level{line.admin_level}", line.local_name)
|
out.keyval(f"level{line.admin_level}", line.local_name)
|
||||||
out.end_object().next()
|
out.end_object().next()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user