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:
Sarah Hoffmann
2017-10-20 15:41:26 +02:00
parent 42f079c355
commit 1424e8e29b
5 changed files with 131 additions and 127 deletions

View File

@@ -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.");
}