Skip to content

Commit 05eb1d5

Browse files
committed
geocodejson: admin level output should only print boundaries
1 parent 78c19bc commit 05eb1d5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nominatim/api/v1/format_json.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ def format_base_geocodejson(results: Union[napi.ReverseResults, napi.SearchResul
247247
out.key('admin').start_object()
248248
if result.address_rows:
249249
for line in result.address_rows:
250-
if line.isaddress and (line.admin_level or 15) < 15 and line.local_name:
250+
if line.isaddress and (line.admin_level or 15) < 15 and line.local_name \
251+
and line.category[0] == 'boundary' and line.category[1] == 'administrative':
251252
out.keyval(f"level{line.admin_level}", line.local_name)
252253
out.end_object().next()
253254

0 commit comments

Comments
 (0)