X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/8c7140d92b7a679ae5ef5bb3655c69bd39b7dfeb..41383c05cd65a36c518f9adce55cfec2a9be00d0:/nominatim/api/v1/format_json.py diff --git a/nominatim/api/v1/format_json.py b/nominatim/api/v1/format_json.py index 80560c95..1c17a032 100644 --- a/nominatim/api/v1/format_json.py +++ b/nominatim/api/v1/format_json.py @@ -247,7 +247,8 @@ def format_base_geocodejson(results: Union[napi.ReverseResults, napi.SearchResul out.key('admin').start_object() if 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.end_object().next()