X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/419f90ed75e91ddb06d4809bc07a580fe08874a3..f9a7f032391965df507318691897ad80eca4f926:/website/reverse.php diff --git a/website/reverse.php b/website/reverse.php index 4cd95016..5eec5c74 100755 --- a/website/reverse.php +++ b/website/reverse.php @@ -1,4 +1,6 @@ getRow($sSQL); - $iPlaceID = $aPlace['place_id']; - $iParentPlaceID = $aPlace['parent_place_id']; - if (PEAR::IsError($iPlaceID)) + if (PEAR::IsError($aPlace)) { failInternalError("Could not determine closest place.", $sSQL, $iPlaceID); } + $iPlaceID = $aPlace['place_id']; + $iParentPlaceID = $aPlace['parent_place_id']; } // The point we found might be too small - use the address to find what it is a child of @@ -134,14 +136,15 @@ $sSQL .= " get_address_by_language(place_id, $sLanguagePrefArraySQL) as langaddress,"; $sSQL .= " get_name_by_language(name, $sLanguagePrefArraySQL) as placename,"; $sSQL .= " get_name_by_language(name, ARRAY['ref']) as ref,"; - $sSQL .= " st_y(st_centroid(geometry)) as lat, st_x(st_centroid(geometry)) as lon"; + $sSQL .= " st_y(centroid) as lat, st_x(centroid) as lon"; $sSQL .= " from placex where place_id = $iPlaceID "; -//var_dump($sSQL); + $aPlace = $oDB->getRow($sSQL); +//var_dump($sSQL, $aPlace); exit; if ($bShowAddressDetails) { - $aAddress = getAddressDetails($oDB, $sLanguagePrefArraySQL, $iPlaceID, $aPlace['country_code']); + $aAddress = getAddressDetails($oDB, $sLanguagePrefArraySQL, $iPlaceID, $aPlace['calculated_country_code']); } $aClassType = getClassTypes(); $sAddressType = '';