From 4b84de400bb69626d15dff9b3dd25ba98b0c8d33 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 27 Apr 2022 10:58:25 +0200 Subject: [PATCH] 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. --- lib-php/template/search-geocodejson.php | 2 ++ 1 file changed, 2 insertions(+) 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']); -- 2.39.5