X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/204fe20b4b660bdf34953b87763f9f7d06525a28..a79ab417823dbb065d94a803633e31db2067cd0b:/lib-php/website/details.php diff --git a/lib-php/website/details.php b/lib-php/website/details.php index bd7df12c..1b02a202 100644 --- a/lib-php/website/details.php +++ b/lib-php/website/details.php @@ -1,4 +1,12 @@ 0) { } if ($sPlaceId === false) { - throw new Exception('No place with that OSM ID found.', 404); + throw new \Exception('No place with that OSM ID found.', 404); } } else { if ($sPlaceId === false) { @@ -95,20 +103,21 @@ $iPlaceID = (int)$sPlaceId; if (CONST_Use_US_Tiger_Data) { $iParentPlaceID = $oDB->getOne('SELECT parent_place_id FROM location_property_tiger WHERE place_id = '.$iPlaceID); - if ($iParentPlaceID) $iPlaceID = $iParentPlaceID; + if ($iParentPlaceID) { + $iPlaceID = $iParentPlaceID; + } } // interpolated house numbers $iParentPlaceID = $oDB->getOne('SELECT parent_place_id FROM location_property_osmline WHERE place_id = '.$iPlaceID); -if ($iParentPlaceID) $iPlaceID = $iParentPlaceID; +if ($iParentPlaceID) { + $iPlaceID = $iParentPlaceID; +} // artificial postcodes $iParentPlaceID = $oDB->getOne('SELECT parent_place_id FROM location_postcode WHERE place_id = '.$iPlaceID); -if ($iParentPlaceID) $iPlaceID = $iParentPlaceID; - -if (CONST_Use_Aux_Location_data) { - $iParentPlaceID = $oDB->getOne('SELECT parent_place_id FROM location_property_aux WHERE place_id = '.$iPlaceID); - if ($iParentPlaceID) $iPlaceID = $iParentPlaceID; +if ($iParentPlaceID) { + $iPlaceID = $iParentPlaceID; } $hLog = logStart($oDB, 'details', $_SERVER['QUERY_STRING'], $aLangPrefOrder); @@ -145,7 +154,7 @@ $sSQL .= " WHERE place_id = $iPlaceID"; $aPointDetails = $oDB->getRow($sSQL, null, 'Could not get details of place object.'); if (!$aPointDetails) { - throw new Exception('No place with that place ID found.', 404); + throw new \Exception('No place with that place ID found.', 404); } $aPointDetails['localname'] = $aPointDetails['localname']?$aPointDetails['localname']:$aPointDetails['housenumber'];