projects
/
nominatim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'upstream/master'
[nominatim.git]
/
lib-php
/
website
/
details.php
diff --git
a/lib-php/website/details.php
b/lib-php/website/details.php
index 91440b542a863c0c294337c174af54c9678bc115..55a088d1994ab8ee9555211c4d9927d78c910d6b 100644
(file)
--- a/
lib-php/website/details.php
+++ b/
lib-php/website/details.php
@@
-53,7
+53,7
@@
if ($sOsmType && $iOsmId > 0) {
// Be nice about our error messages for broken geometry
// Be nice about our error messages for broken geometry
- if (!$sPlaceId) {
+ if (!$sPlaceId
&& $oDB->tableExists('import_polygon_error')
) {
$sSQL = 'SELECT ';
$sSQL .= ' osm_type, ';
$sSQL .= ' osm_id, ';
$sSQL = 'SELECT ';
$sSQL .= ' osm_type, ';
$sSQL .= ' osm_id, ';
@@
-81,10
+81,15
@@
if ($sOsmType && $iOsmId > 0) {
exit;
}
}
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;
$iPlaceID = (int)$sPlaceId;
@@
-101,11
+106,6
@@
if ($iParentPlaceID) $iPlaceID = $iParentPlaceID;
$iParentPlaceID = $oDB->getOne('SELECT parent_place_id FROM location_postcode WHERE place_id = '.$iPlaceID);
if ($iParentPlaceID) $iPlaceID = $iParentPlaceID;
$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
$hLog = logStart($oDB, 'details', $_SERVER['QUERY_STRING'], $aLangPrefOrder);
// Get the details for this point
@@
-140,11
+140,10
@@
$sSQL .= " WHERE place_id = $iPlaceID";
$aPointDetails = $oDB->getRow($sSQL, null, 'Could not get details of place object.');
if (!$aPointDetails) {
$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'];
}
$aPointDetails['localname'] = $aPointDetails['localname']?$aPointDetails['localname']:$aPointDetails['housenumber'];
-$aPointDetails['rank_search_label'] = getSearchRankLabel($aPointDetails['rank_search']); // only used in HTML format
// Get all alternative names (languages, etc)
$sSQL = 'SELECT (each(name)).key,(each(name)).value FROM placex ';
// Get all alternative names (languages, etc)
$sSQL = 'SELECT (each(name)).key,(each(name)).value FROM placex ';