]> git.openstreetmap.org Git - nominatim.git/commitdiff
geocodejson: add osm_key and osm_value fields
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 27 Apr 2022 08:58:25 +0000 (10:58 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 27 Apr 2022 08:58:25 +0000 (10:58 +0200)
Return OSM main tag information in geocodejson. This is not part
of the official spec but can be useful to get more detailed information
of the object type. Brings the Nominatim output closer to what
Photon produces.

lib-php/template/search-geocodejson.php

index ffdda6c6b64a3a68d1841a5b76d29d8929d6df8d..5439e3cfe532e61140a3293701d8a1a5c6517926 100644 (file)
@@ -25,6 +25,8 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) {
         $aPlace['properties']['geocoding']['osm_type'] = $sOSMType;
         $aPlace['properties']['geocoding']['osm_id'] = $aPointDetails['osm_id'];
     }
+    $aPlace['properties']['geocoding']['osm_key'] = $aPointDetails['class'];
+    $aPlace['properties']['geocoding']['osm_value'] = $aPointDetails['type'];
 
     $aPlace['properties']['geocoding']['type'] = addressRankToGeocodeJsonType($aPointDetails['rank_address']);