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.
This commit is contained in:
Sarah Hoffmann
2022-04-27 10:58:25 +02:00
parent 8677da2a72
commit 4b84de400b

View 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']);