mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
Tested Version of new Tiger line storage format.
This commit is contained in:
@@ -1611,7 +1611,7 @@
|
|||||||
if (isset($aResultPlaceIDs) && sizeof($aResultPlaceIDs) && ($this->iMinAddressRank != 0 || $this->iMaxAddressRank != 30))
|
if (isset($aResultPlaceIDs) && sizeof($aResultPlaceIDs) && ($this->iMinAddressRank != 0 || $this->iMaxAddressRank != 30))
|
||||||
{
|
{
|
||||||
// Need to verify passes rank limits before dropping out of the loop (yuk!)
|
// Need to verify passes rank limits before dropping out of the loop (yuk!)
|
||||||
// reduces the number of place id, like a filter
|
// reduces the number of place ids, like a filter
|
||||||
$sSQL = "select place_id from placex where place_id in (".join(',',array_keys($aResultPlaceIDs)).") ";
|
$sSQL = "select place_id from placex where place_id in (".join(',',array_keys($aResultPlaceIDs)).") ";
|
||||||
$sSQL .= "and (placex.rank_address between $this->iMinAddressRank and $this->iMaxAddressRank ";
|
$sSQL .= "and (placex.rank_address between $this->iMinAddressRank and $this->iMaxAddressRank ";
|
||||||
if (14 >= $this->iMinAddressRank && 14 <= $this->iMaxAddressRank) $sSQL .= " OR (extratags->'place') = 'city'";
|
if (14 >= $this->iMinAddressRank && 14 <= $this->iMaxAddressRank) $sSQL .= " OR (extratags->'place') = 'city'";
|
||||||
|
|||||||
@@ -780,7 +780,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getAddressDetails(&$oDB, $sLanguagePrefArraySQL, $iPlaceID, $sCountryCode = false, $housenumber, $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'";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
DROP TABLE IF EXISTS location_property_tiger_import;
|
DROP TABLE IF EXISTS location_property_tiger_import;
|
||||||
CREATE TABLE location_property_tiger_import (linegeo GEOMETRY, place_id BIGINT, partition INTEGER, parent_place_id BIGINT, startnumber INTEGER, endnumber INTEGER, interpolationtype TEXT, street TEXT, isin TEXT, postcode TEXT);
|
CREATE TABLE location_property_tiger_import (linegeo GEOMETRY, place_id BIGINT, partition INTEGER, parent_place_id BIGINT, startnumber INTEGER, endnumber INTEGER, interpolationtype TEXT, postcode TEXT);
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION tiger_line_import(linegeo GEOMETRY, in_startnumber INTEGER,
|
CREATE OR REPLACE FUNCTION tiger_line_import(linegeo GEOMETRY, in_startnumber INTEGER,
|
||||||
in_endnumber INTEGER, interpolationtype TEXT,
|
in_endnumber INTEGER, interpolationtype TEXT,
|
||||||
@@ -73,8 +73,8 @@ BEGIN
|
|||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
--insert street(line) into import table
|
--insert street(line) into import table
|
||||||
insert into location_property_tiger_import (linegeo, place_id, partition, parent_place_id, startnumber, endnumber, interpolationtype, street, isin, postcode)
|
insert into location_property_tiger_import (linegeo, place_id, partition, parent_place_id, startnumber, endnumber, interpolationtype, postcode)
|
||||||
values (linegeo, nextval('seq_place'), out_partition, out_parent_place_id, startnumber, endnumber, interpolationtype, in_street, in_isin, in_postcode);
|
values (linegeo, nextval('seq_place'), out_partition, out_parent_place_id, startnumber, endnumber, interpolationtype, in_postcode);
|
||||||
|
|
||||||
RETURN 1;
|
RETURN 1;
|
||||||
END;
|
END;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
$fLoadAvg = getLoadAverage();
|
$fLoadAvg = getLoadAverage();
|
||||||
if ($fLoadAvg > 3)
|
if ($fLoadAvg > 3)
|
||||||
{
|
{
|
||||||
echo "Page temporarily blocked due to high server load\n";
|
echo "Page temporarily blocked due to high server load\n";F
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Address
|
// Address
|
||||||
$aAddressLines = getAddressDetails($oDB, $sLanguagePrefArraySQL, $iPlaceID, $aPointDetails['country_code'], true);
|
$aAddressLines = getAddressDetails($oDB, $sLanguagePrefArraySQL, $iPlaceID, $aPointDetails['country_code'], -1, true);
|
||||||
|
|
||||||
// Linked places
|
// Linked places
|
||||||
$sSQL = "select placex.place_id, osm_type, osm_id, class, type, housenumber, admin_level, rank_address, ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon') as isarea, ST_Distance_Spheroid(geometry, placegeometry, 'SPHEROID[\"WGS 84\",6378137,298.257223563, AUTHORITY[\"EPSG\",\"7030\"]]') as distance, ";
|
$sSQL = "select placex.place_id, osm_type, osm_id, class, type, housenumber, admin_level, rank_address, ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon') as isarea, ST_Distance_Spheroid(geometry, placegeometry, 'SPHEROID[\"WGS 84\",6378137,298.257223563, AUTHORITY[\"EPSG\",\"7030\"]]') as distance, ";
|
||||||
|
|||||||
Reference in New Issue
Block a user