]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/api/v1/format_json.py
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / nominatim / api / v1 / format_json.py
index 80560c95278da93f5175dbe5e0ceb232abeb6d51..1c17a032c586c6308023da8927dcbb0c8edef407 100644 (file)
@@ -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()