mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
aux properties, memory leaks, tweaks to search order
This commit is contained in:
@@ -318,7 +318,9 @@ var_dump($sPartitionName);
|
||||
else passthru(CONST_BasePath.'/osmosis-0.38/bin/osmosis --read-replication-interval-init '.CONST_BasePath.'/settings');
|
||||
|
||||
$sDate = $aCMDResult['osmosis-init-date'];
|
||||
$sStateFile = file_get_contents('http://toolserver.org/~mazder/replicate-sequences/?'.$sDate);
|
||||
$sURL = 'http://toolserver.org/~mazder/replicate-sequences/?'.$sDate;
|
||||
echo "Getting state file: $sURL\n";
|
||||
$sStateFile = file_get_contents($sURL);
|
||||
if (!$sStateFile || strlen($sStateFile) > 1000) fail("unable to obtain state file");
|
||||
file_put_contents(CONST_BasePath.'/settings/state.txt', $sStateFile);
|
||||
}
|
||||
@@ -380,22 +382,15 @@ var_dump($sPartitionName);
|
||||
$hProcess = proc_open($sCMD, $aDescriptors, $ahPipes);
|
||||
if (!is_resource($hProcess)) fail('unable to start pgsql');
|
||||
|
||||
echo "write";
|
||||
fwrite($ahPipes[0], $sScript);
|
||||
echo "close";
|
||||
fclose($ahPipes[0]);
|
||||
echo "done";
|
||||
|
||||
// TODO: error checking
|
||||
while(!feof($ahPipes[1]))
|
||||
{
|
||||
echo "read";
|
||||
echo fread($ahPipes[1], 4096);
|
||||
}
|
||||
echo "done";
|
||||
fclose($ahPipes[1]);
|
||||
|
||||
echo "done1";
|
||||
proc_close($hProcess);
|
||||
echo "done2";
|
||||
}
|
||||
|
||||
@@ -83,10 +83,11 @@
|
||||
|
||||
foreach($aPairs as $aPair)
|
||||
{
|
||||
if ($aPair[1] == 'highway') continue;
|
||||
|
||||
echo "create table place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1])." as ";
|
||||
echo "select place_id as place_id,st_centroid(geometry) as centroid from placex where ";
|
||||
echo "class = '".pg_escape_string($aPair[0])."' and type = '".pg_escape_string($aPair[1])."';\n";
|
||||
echo "class = '".pg_escape_string($aPair[0])."' and type = '".pg_escape_string($aPair[1])."' limit 0;\n";
|
||||
|
||||
echo "CREATE INDEX idx_place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1])."_centroid ";
|
||||
echo "ON place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1])." USING GIST (centroid);\n";
|
||||
@@ -94,5 +95,10 @@
|
||||
echo "CREATE INDEX idx_place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1])."_place_id ";
|
||||
echo "ON place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1])." USING btree(place_id);\n";
|
||||
|
||||
echo "truncate place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1]).";\n";
|
||||
echo "insert into place_classtype_".pg_escape_string($aPair[0])."_".pg_escape_string($aPair[1])." ";
|
||||
echo "select place_id as place_id,st_centroid(geometry) as centroid from placex where ";
|
||||
echo "class = '".pg_escape_string($aPair[0])."' and type = '".pg_escape_string($aPair[1])."';\n";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user