exit;
}
}
-}
-
-if ($sPlaceId === false) userError('Please select a place id');
+ if ($sPlaceId === false) {
+ throw new Exception('No place with that OSM ID found.', 404);
+ }
+} else {
+ if ($sPlaceId === false) {
+ userError('Required parameters missing. Need either osmtype/osmid or place_id.');
+ }
+}
$iPlaceID = (int)$sPlaceId;
$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;
-}
-
$hLog = logStart($oDB, 'details', $_SERVER['QUERY_STRING'], $aLangPrefOrder);
// Get the details for this point
$aPointDetails = $oDB->getRow($sSQL, null, 'Could not get details of place object.');
if (!$aPointDetails) {
- userError('Unknown place id.');
+ throw new Exception('No place with that place ID found.', 404);
}
$aPointDetails['localname'] = $aPointDetails['localname']?$aPointDetails['localname']:$aPointDetails['housenumber'];