X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/033b9590bdf562a21a45b85e9cfaefee0db754e1..4f75f4cb6e468a8de282a81615e7c720e154c8b4:/lib/Geocode.php diff --git a/lib/Geocode.php b/lib/Geocode.php index aa65cb69..a01abbc5 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -514,7 +514,7 @@ $sSQL .= " order by importance desc"; if (CONST_Debug) { echo "
"; var_dump($sSQL); } - $aSearchResults = chksql($this->oDB->getAll($sSQL); + $aSearchResults = chksql($this->oDB->getAll($sSQL), "Could not get details for place."); return $aSearchResults; @@ -879,7 +879,7 @@ $sViewboxCentreSQL .= ")'::geometry,4326)"; $sSQL = "select st_buffer(".$sViewboxCentreSQL.",".(float)($_GET['routewidth']/69).")"; - $this->sViewboxSmallSQL = chksql($this->oDB->getOne($sSQL); + $this->sViewboxSmallSQL = chksql($this->oDB->getOne($sSQL), "Could not get small viewbox."); $this->sViewboxSmallSQL = "'".$this->sViewboxSmallSQL."'::geometry"; @@ -1307,6 +1307,12 @@ } } } + // If a coordinate is given, the search must either + // be for a name or a special search. Ignore everythin else. + else if ($aSearch['fLon'] && !sizeof($aSearch['aName']) && !sizeof($aSearch['aAddress']) && !$aSearch['sClass']) + { + $aPlaceIDs = array(); + } else { $aPlaceIDs = array(); @@ -1414,9 +1420,8 @@ $sSQL .= " limit ".$this->iLimit; if (CONST_Debug) { var_dump($sSQL); } - $aViewBoxPlaceIDs = chksql($this->oDB->getAll($sSQL)); + $aViewBoxPlaceIDs = chksql($this->oDB->getAll($sSQL), "Could not get places for search terms."); - } //var_dump($aViewBoxPlaceIDs); // Did we have an viewbox matches? $aPlaceIDs = array(); @@ -1638,11 +1643,6 @@ } - if (PEAR::IsError($aPlaceIDs)) - { - failInternalError("Could not get place IDs from tokens." ,$sSQL, $aPlaceIDs); - } - if (CONST_Debug) { echo "
Place IDs: "; var_Dump($aPlaceIDs); } foreach($aPlaceIDs as $iPlaceID)