From: Sarah Hoffmann Date: Wed, 27 Apr 2022 08:58:25 +0000 (+0200) Subject: geocodejson: add osm_key and osm_value fields X-Git-Tag: v4.1.0~50^2~2 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/4b84de400bb69626d15dff9b3dd25ba98b0c8d33 geocodejson: add osm_key and osm_value fields 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. --- diff --git a/lib-php/template/search-geocodejson.php b/lib-php/template/search-geocodejson.php index ffdda6c6..5439e3cf 100644 --- a/lib-php/template/search-geocodejson.php +++ b/lib-php/template/search-geocodejson.php @@ -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']);