forked from hans/Nominatim
Fix coding style.
This commit is contained in:
@@ -399,7 +399,7 @@
|
|||||||
$sLanguagePrefArraySQL = "ARRAY[".join(',',array_map("getDBQuoted",$this->aLangPrefOrder))."]";
|
$sLanguagePrefArraySQL = "ARRAY[".join(',',array_map("getDBQuoted",$this->aLangPrefOrder))."]";
|
||||||
|
|
||||||
// Get the details for display (is this a redundant extra step?)
|
// Get the details for display (is this a redundant extra step?)
|
||||||
$sPlaceIDs = join(',',array_keys($aPlaceIDs));
|
$sPlaceIDs = join(',', array_keys($aPlaceIDs));
|
||||||
|
|
||||||
$sImportanceSQL = '';
|
$sImportanceSQL = '';
|
||||||
if ($this->sViewboxSmallSQL) $sImportanceSQL .= " case when ST_Contains($this->sViewboxSmallSQL, ST_Collect(centroid)) THEN 1 ELSE 0.75 END * ";
|
if ($this->sViewboxSmallSQL) $sImportanceSQL .= " case when ST_Contains($this->sViewboxSmallSQL, ST_Collect(centroid)) THEN 1 ELSE 0.75 END * ";
|
||||||
@@ -437,9 +437,10 @@
|
|||||||
//Tiger search only if a housenumber was searched and if it was found (i.e. aPlaceIDs[placeID] = housenumber != -1) (realized through a join)
|
//Tiger search only if a housenumber was searched and if it was found (i.e. aPlaceIDs[placeID] = housenumber != -1) (realized through a join)
|
||||||
//only Tiger housenumbers need to be interpolated, because they are saved as lines with start- and endnumber, the common osm housenumbers are usually saved as points
|
//only Tiger housenumbers need to be interpolated, because they are saved as lines with start- and endnumber, the common osm housenumbers are usually saved as points
|
||||||
$sHousenumbers = "";
|
$sHousenumbers = "";
|
||||||
$i=0;
|
$i = 0;
|
||||||
$length=count($aPlaceIDs);
|
$length = count($aPlaceIDs);
|
||||||
foreach($aPlaceIDs as $placeID => $housenumber){
|
foreach($aPlaceIDs as $placeID => $housenumber)
|
||||||
|
{
|
||||||
$i++;
|
$i++;
|
||||||
$sHousenumbers .= "(".$placeID.", ".$housenumber.")";
|
$sHousenumbers .= "(".$placeID.", ".$housenumber.")";
|
||||||
if($i<$length)
|
if($i<$length)
|
||||||
@@ -873,7 +874,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do we have anything that looks like a lat/lon pair?
|
// Do we have anything that looks like a lat/lon pair?
|
||||||
if ( $aLooksLike = looksLikeLatLonPair($sQuery) ){
|
if ( $aLooksLike = looksLikeLatLonPair($sQuery) )
|
||||||
|
{
|
||||||
$this->setNearPoint(array($aLooksLike['lat'], $aLooksLike['lon']));
|
$this->setNearPoint(array($aLooksLike['lat'], $aLooksLike['lon']));
|
||||||
$sQuery = $aLooksLike['query'];
|
$sQuery = $aLooksLike['query'];
|
||||||
}
|
}
|
||||||
@@ -1216,7 +1218,7 @@
|
|||||||
foreach($aSearches as $aSearch)
|
foreach($aSearches as $aSearch)
|
||||||
{
|
{
|
||||||
$iQueryLoop++;
|
$iQueryLoop++;
|
||||||
$searchedHousenumber=-1;
|
$searchedHousenumber = -1;
|
||||||
|
|
||||||
if (CONST_Debug) { echo "<hr><b>Search Loop, group $iGroupLoop, loop $iQueryLoop</b>"; }
|
if (CONST_Debug) { echo "<hr><b>Search Loop, group $iGroupLoop, loop $iQueryLoop</b>"; }
|
||||||
if (CONST_Debug) _debugDumpGroupedSearches(array($iGroupedRank => array($aSearch)), $aValidTokens);
|
if (CONST_Debug) _debugDumpGroupedSearches(array($iGroupedRank => array($aSearch)), $aValidTokens);
|
||||||
@@ -1447,7 +1449,7 @@
|
|||||||
if (!sizeof($aPlaceIDs))
|
if (!sizeof($aPlaceIDs))
|
||||||
{
|
{
|
||||||
//new query for lines, not housenumbers anymore
|
//new query for lines, not housenumbers anymore
|
||||||
if($searchedHousenumber%2==0){
|
if($searchedHousenumber%2 == 0){
|
||||||
//if housenumber is even, look for housenumber in streets with interpolationtype even or all
|
//if housenumber is even, look for housenumber in streets with interpolationtype even or all
|
||||||
$sSQL = "select distinct place_id from location_property_tiger where parent_place_id in (".$sPlaceIDs.") and (interpolationtype='even' or interpolationtype='all') and ".$searchedHousenumber.">=startnumber and ".$searchedHousenumber."<=endnumber";
|
$sSQL = "select distinct place_id from location_property_tiger where parent_place_id in (".$sPlaceIDs.") and (interpolationtype='even' or interpolationtype='all') and ".$searchedHousenumber.">=startnumber and ".$searchedHousenumber."<=endnumber";
|
||||||
}else{
|
}else{
|
||||||
@@ -1470,10 +1472,9 @@
|
|||||||
{
|
{
|
||||||
$aPlaceIDs = $aRoadPlaceIDs;
|
$aPlaceIDs = $aRoadPlaceIDs;
|
||||||
//set to -1, if no housenumbers were found
|
//set to -1, if no housenumbers were found
|
||||||
$searchedHousenumber=-1;
|
$searchedHousenumber = -1;
|
||||||
}else{
|
|
||||||
//housenumber was found, remains saved in searchedHousenumber
|
|
||||||
}
|
}
|
||||||
|
//else: housenumber was found, remains saved in searchedHousenumber
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1624,10 +1625,11 @@
|
|||||||
if (CONST_Debug) var_dump($sSQL);
|
if (CONST_Debug) var_dump($sSQL);
|
||||||
$aFilteredPlaceIDs = $this->oDB->getCol($sSQL);
|
$aFilteredPlaceIDs = $this->oDB->getCol($sSQL);
|
||||||
$tempIDs = array();
|
$tempIDs = array();
|
||||||
foreach($aFilteredPlaceIDs as $placeID){
|
foreach($aFilteredPlaceIDs as $placeID)
|
||||||
$tempIDs[$placeID]= $aResultPlaceIDs[$placeID]; //assign housenumber to placeID
|
{
|
||||||
|
$tempIDs[$placeID] = $aResultPlaceIDs[$placeID]; //assign housenumber to placeID
|
||||||
}
|
}
|
||||||
$aResultPlaceIDs=$tempIDs;
|
$aResultPlaceIDs = $tempIDs;
|
||||||
}
|
}
|
||||||
|
|
||||||
//exit;
|
//exit;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
protected $sType = false;
|
protected $sType = false;
|
||||||
|
|
||||||
protected $fTigerFraction =-1;
|
protected $fTigerFraction = -1;
|
||||||
|
|
||||||
protected $aLangPrefOrder = array();
|
protected $aLangPrefOrder = array();
|
||||||
|
|
||||||
|
|||||||
@@ -805,7 +805,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getAddressDetails(&$oDB, $sLanguagePrefArraySQL, $iPlaceID, $sCountryCode = false, $housenumber =-1, $bRaw = false)
|
function getAddressDetails(&$oDB, $sLanguagePrefArraySQL, $iPlaceID, $sCountryCode = false, $housenumber = -1, $bRaw = false)
|
||||||
{
|
{
|
||||||
$sSQL = "select *,get_name_by_language(name,$sLanguagePrefArraySQL) as localname from get_addressdata($iPlaceID, $housenumber)";
|
$sSQL = "select *,get_name_by_language(name,$sLanguagePrefArraySQL) as localname from get_addressdata($iPlaceID, $housenumber)";
|
||||||
if (!$bRaw) $sSQL .= " WHERE isaddress OR type = 'country_code'";
|
if (!$bRaw) $sSQL .= " WHERE isaddress OR type = 'country_code'";
|
||||||
|
|||||||
@@ -2196,7 +2196,7 @@ BEGIN
|
|||||||
result := '{}';
|
result := '{}';
|
||||||
prevresult := '';
|
prevresult := '';
|
||||||
|
|
||||||
FOR location IN select * from get_addressdata(for_place_id,housenumber) where isaddress order by rank_address desc LOOP
|
FOR location IN select * from get_addressdata(for_place_id, housenumber) where isaddress order by rank_address desc LOOP
|
||||||
currresult := trim(get_name_by_language(location.name, languagepref));
|
currresult := trim(get_name_by_language(location.name, languagepref));
|
||||||
IF currresult != prevresult AND currresult IS NOT NULL AND result[(100 - location.rank_address)] IS NULL THEN
|
IF currresult != prevresult AND currresult IS NOT NULL AND result[(100 - location.rank_address)] IS NULL THEN
|
||||||
result[(100 - location.rank_address)] := trim(get_name_by_language(location.name, languagepref));
|
result[(100 - location.rank_address)] := trim(get_name_by_language(location.name, languagepref));
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ DECLARE
|
|||||||
endnumber INTEGER;
|
endnumber INTEGER;
|
||||||
stepsize INTEGER;
|
stepsize INTEGER;
|
||||||
numberrange INTEGER;
|
numberrange INTEGER;
|
||||||
rangestartnumber INTEGER;
|
|
||||||
place_centroid GEOMETRY;
|
place_centroid GEOMETRY;
|
||||||
out_partition INTEGER;
|
out_partition INTEGER;
|
||||||
out_parent_place_id BIGINT;
|
out_parent_place_id BIGINT;
|
||||||
@@ -28,8 +27,7 @@ BEGIN
|
|||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
numberrange := endnumber - startnumber;
|
numberrange := endnumber - startnumber;
|
||||||
rangestartnumber := startnumber;
|
|
||||||
|
|
||||||
IF (interpolationtype = 'odd' AND startnumber%2 = 0) OR (interpolationtype = 'even' AND startnumber%2 = 1) THEN
|
IF (interpolationtype = 'odd' AND startnumber%2 = 0) OR (interpolationtype = 'even' AND startnumber%2 = 1) THEN
|
||||||
startnumber := startnumber + 1;
|
startnumber := startnumber + 1;
|
||||||
stepsize := 2;
|
stepsize := 2;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
$fLoadAvg = getLoadAverage();
|
$fLoadAvg = getLoadAverage();
|
||||||
if ($fLoadAvg > 3)
|
if ($fLoadAvg > 3)
|
||||||
{
|
{
|
||||||
echo "Page temporarily blocked due to high server load\n";F
|
echo "Page temporarily blocked due to high server load\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user