mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
fix loading of data without wikipedia files
Also removes unused place_boundingbox table.
This commit is contained in:
@@ -160,13 +160,6 @@ class SetupFunctions
|
|||||||
if ($this->bNoPartitions) {
|
if ($this->bNoPartitions) {
|
||||||
$this->pgsqlRunScript('update country_name set partition = 0');
|
$this->pgsqlRunScript('update country_name set partition = 0');
|
||||||
}
|
}
|
||||||
|
|
||||||
// the following will be needed by createFunctions later but
|
|
||||||
// is only defined in the subsequently called createTables
|
|
||||||
// Create dummies here that will be overwritten by the proper
|
|
||||||
// versions in create-tables.
|
|
||||||
$this->pgsqlRunScript('CREATE TABLE IF NOT EXISTS place_boundingbox ()');
|
|
||||||
$this->pgsqlRunScript('CREATE TYPE wikipedia_article_match AS ()', false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function importData($sOSMFile)
|
public function importData($sOSMFile)
|
||||||
@@ -323,11 +316,11 @@ class SetupFunctions
|
|||||||
|
|
||||||
public function importWikipediaArticles()
|
public function importWikipediaArticles()
|
||||||
{
|
{
|
||||||
$this->pgExec('DROP TABLE wikipedia_article');
|
|
||||||
$this->pgExec('DROP TABLE wikipedia_redirect');
|
|
||||||
$sWikiArticlesFile = CONST_Wikipedia_Data_Path.'/wikimedia-importance.sql.gz';
|
$sWikiArticlesFile = CONST_Wikipedia_Data_Path.'/wikimedia-importance.sql.gz';
|
||||||
if (file_exists($sWikiArticlesFile)) {
|
if (file_exists($sWikiArticlesFile)) {
|
||||||
info('Importing wikipedia articles and redirects');
|
info('Importing wikipedia articles and redirects');
|
||||||
|
$this->pgExec('DROP TABLE IF EXISTS wikipedia_article');
|
||||||
|
$this->pgExec('DROP TABLE IF EXISTS wikipedia_redirect');
|
||||||
$this->pgsqlRunScriptFile($sWikiArticlesFile);
|
$this->pgsqlRunScriptFile($sWikiArticlesFile);
|
||||||
} else {
|
} else {
|
||||||
warn('wikipedia importance dump file not found - places will have default importance');
|
warn('wikipedia importance dump file not found - places will have default importance');
|
||||||
@@ -346,8 +339,6 @@ class SetupFunctions
|
|||||||
echo '.';
|
echo '.';
|
||||||
$this->pgExec('TRUNCATE place_addressline');
|
$this->pgExec('TRUNCATE place_addressline');
|
||||||
echo '.';
|
echo '.';
|
||||||
$this->pgExec('TRUNCATE place_boundingbox');
|
|
||||||
echo '.';
|
|
||||||
$this->pgExec('TRUNCATE location_area');
|
$this->pgExec('TRUNCATE location_area');
|
||||||
echo '.';
|
echo '.';
|
||||||
if (!$this->dbReverseOnly()) {
|
if (!$this->dbReverseOnly()) {
|
||||||
|
|||||||
@@ -2622,7 +2622,7 @@ END;
|
|||||||
$$
|
$$
|
||||||
LANGUAGE plpgsql IMMUTABLE;
|
LANGUAGE plpgsql IMMUTABLE;
|
||||||
|
|
||||||
DROP TYPE wikipedia_article_match CASCADE;
|
DROP TYPE IF EXISTS wikipedia_article_match CASCADE;
|
||||||
create type wikipedia_article_match as (
|
create type wikipedia_article_match as (
|
||||||
language TEXT,
|
language TEXT,
|
||||||
title TEXT,
|
title TEXT,
|
||||||
|
|||||||
@@ -268,7 +268,9 @@ CREATE TABLE wikipedia_article (
|
|||||||
lon double precision,
|
lon double precision,
|
||||||
importance double precision,
|
importance double precision,
|
||||||
osm_type character(1),
|
osm_type character(1),
|
||||||
osm_id bigint
|
osm_id bigint,
|
||||||
|
wd_page_title text,
|
||||||
|
instance_of text
|
||||||
);
|
);
|
||||||
ALTER TABLE ONLY wikipedia_article ADD CONSTRAINT wikipedia_article_pkey PRIMARY KEY (language, title);
|
ALTER TABLE ONLY wikipedia_article ADD CONSTRAINT wikipedia_article_pkey PRIMARY KEY (language, title);
|
||||||
CREATE INDEX idx_wikipedia_article_osm_id ON wikipedia_article USING btree (osm_type, osm_id);
|
CREATE INDEX idx_wikipedia_article_osm_id ON wikipedia_article USING btree (osm_type, osm_id);
|
||||||
|
|||||||
Reference in New Issue
Block a user