mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
use Result class in reverse geocoding
Also simplifies the reverse algorithm slightly by no longer having an additional distance lookup.
This commit is contained in:
@@ -56,14 +56,10 @@ if ($sOsmType && $iOsmId > 0) {
|
||||
$oReverseGeocode = new Nominatim\ReverseGeocode($oDB);
|
||||
$oReverseGeocode->setZoom($iZoom !== false ? $iZoom : 18);
|
||||
|
||||
$aLookup = $oReverseGeocode->lookup($fLat, $fLon);
|
||||
if (CONST_Debug) var_dump($aLookup);
|
||||
$oLookup = $oReverseGeocode->lookup($fLat, $fLon);
|
||||
if (CONST_Debug) var_dump($oLookup);
|
||||
|
||||
$aPlace = $oPlaceLookup->lookup(
|
||||
(int)$aLookup['place_id'],
|
||||
$aLookup['type'],
|
||||
$aLookup['fraction']
|
||||
);
|
||||
$aPlace = $oPlaceLookup->lookup($oLookup);
|
||||
} elseif ($sOutputFormat != 'html') {
|
||||
userError("Need coordinates or OSM object to lookup.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user