forked from hans/Nominatim
Coding style adaptions and correcting small errors from merge.
This commit is contained in:
@@ -431,11 +431,8 @@
|
|||||||
|
|
||||||
if (30 >= $this->iMinAddressRank && 30 <= $this->iMaxAddressRank)
|
if (30 >= $this->iMinAddressRank && 30 <= $this->iMaxAddressRank)
|
||||||
{
|
{
|
||||||
if (CONST_Use_US_Tiger_Data)
|
//only Tiger housenumbers and interpolation lines need to be interpolated, because they are saved as lines
|
||||||
{
|
// with start- and endnumber, the common osm housenumbers are usually saved as points
|
||||||
//query also location_property_tiger and location_property_aux
|
|
||||||
//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
|
|
||||||
$sHousenumbers = "";
|
$sHousenumbers = "";
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$length = count($aPlaceIDs);
|
$length = count($aPlaceIDs);
|
||||||
@@ -446,7 +443,9 @@
|
|||||||
if($i<$length)
|
if($i<$length)
|
||||||
$sHousenumbers .= ", ";
|
$sHousenumbers .= ", ";
|
||||||
}
|
}
|
||||||
|
if (CONST_Use_US_Tiger_Data)
|
||||||
|
{
|
||||||
|
//Tiger search only if a housenumber was searched and if it was found (i.e. aPlaceIDs[placeID] = housenumber != -1) (realized through a join)
|
||||||
$sSQL .= " union";
|
$sSQL .= " union";
|
||||||
$sSQL .= " select 'T' as osm_type, place_id as osm_id, 'place' as class, 'house' as type, null as admin_level, 30 as rank_search, 30 as rank_address, min(place_id) as place_id, min(parent_place_id) as parent_place_id, 'us' as country_code";
|
$sSQL .= " select 'T' as osm_type, place_id as osm_id, 'place' as class, 'house' as type, null as admin_level, 30 as rank_search, 30 as rank_address, min(place_id) as place_id, min(parent_place_id) as parent_place_id, 'us' as country_code";
|
||||||
$sSQL .= ", get_address_by_language(place_id, housenumber_for_place, $sLanguagePrefArraySQL) as langaddress ";
|
$sSQL .= ", get_address_by_language(place_id, housenumber_for_place, $sLanguagePrefArraySQL) as langaddress ";
|
||||||
@@ -468,6 +467,7 @@
|
|||||||
if (!$this->bDeDupe) $sSQL .= ", place_id ";
|
if (!$this->bDeDupe) $sSQL .= ", place_id ";
|
||||||
}
|
}
|
||||||
// osmline, osm_type is 'I' for Interpolation Line
|
// osmline, osm_type is 'I' for Interpolation Line
|
||||||
|
// interpolation line search only if a housenumber was searched and if it was found (i.e. aPlaceIDs[placeID] = housenumber != -1) (realized through a join)
|
||||||
$sSQL .= " union ";
|
$sSQL .= " union ";
|
||||||
$sSQL .= "select 'I' as osm_type, place_id as osm_id, 'place' as class, 'house' as type, null as admin_level, 30 as rank_search, 30 as rank_address, min(place_id) as place_id, min(parent_place_id) as parent_place_id, calculated_country_code as country_code, ";
|
$sSQL .= "select 'I' as osm_type, place_id as osm_id, 'place' as class, 'house' as type, null as admin_level, 30 as rank_search, 30 as rank_address, min(place_id) as place_id, min(parent_place_id) as parent_place_id, calculated_country_code as country_code, ";
|
||||||
$sSQL .= "get_address_by_language(place_id, housenumber_for_place, $sLanguagePrefArraySQL) as langaddress, ";
|
$sSQL .= "get_address_by_language(place_id, housenumber_for_place, $sLanguagePrefArraySQL) as langaddress, ";
|
||||||
@@ -1330,9 +1330,11 @@
|
|||||||
{
|
{
|
||||||
$sHouseNumberRegex = '\\\\m'.$aSearch['sHouseNumber'].'\\\\M';
|
$sHouseNumberRegex = '\\\\m'.$aSearch['sHouseNumber'].'\\\\M';
|
||||||
$aOrder[] = "";
|
$aOrder[] = "";
|
||||||
$aOrder[0] = "exists(select place_id from placex where parent_place_id = search_name.place_id and transliteration(housenumber) ~* E'".$sHouseNumberRegex."' limit 1) ";
|
$aOrder[0] = " exists(select place_id from placex where parent_place_id = search_name.place_id";
|
||||||
|
$aOrder[0] .= " and transliteration(housenumber) ~* E'".$sHouseNumberRegex."' limit 1) ";
|
||||||
// also housenumbers from interpolation lines table are needed
|
// also housenumbers from interpolation lines table are needed
|
||||||
$aOrder[0] .= " or exists(select place_id from location_property_osmline where parent_place_id = search_name.place_id and ".$aSearch['sHouseNumber'].">=startnumber and ".$aSearch['sHouseNumber']."<=endnumber limit 1)";
|
$aOrder[0] .= " or exists(select place_id from location_property_osmline where parent_place_id = search_name.place_id";
|
||||||
|
$aOrder[0] .= " and ".$aSearch['sHouseNumber'].">=startnumber and ".$aSearch['sHouseNumber']."<=endnumber limit 1)";
|
||||||
$aOrder[0] .= " desc";
|
$aOrder[0] .= " desc";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -396,7 +396,6 @@
|
|||||||
|
|
||||||
echo "Load Data\n";
|
echo "Load Data\n";
|
||||||
$aDBInstances = array();
|
$aDBInstances = array();
|
||||||
|
|
||||||
$aQueriesPlacex = array();
|
$aQueriesPlacex = array();
|
||||||
$aQueriesOsmline = array();
|
$aQueriesOsmline = array();
|
||||||
// the query is divided into parcels, so that the work between the processes, i.e. the DBInstances, will be evenly distributed
|
// the query is divided into parcels, so that the work between the processes, i.e. the DBInstances, will be evenly distributed
|
||||||
|
|||||||
Reference in New Issue
Block a user