From 612367452d17863058ddb99f351ab264ddeef706 Mon Sep 17 00:00:00 2001 From: Carla Date: Mon, 15 Jun 2015 16:10:11 +0200 Subject: [PATCH 1/3] Adds indexes existent in global_cities table --- geocoder/setup/indexes.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/geocoder/setup/indexes.sql b/geocoder/setup/indexes.sql index 9b2bbb0..5ab2755 100644 --- a/geocoder/setup/indexes.sql +++ b/geocoder/setup/indexes.sql @@ -13,3 +13,8 @@ CREATE UNIQUE INDEX idx_ne_admin0_v3_adm0_a3 ON ne_admin0_v3 (adm0_a3); -- create indexes on postal code polygon table CREATE UNIQUE INDEX idx_postal_code_polygons_a3_code ON postal_code_polygons (adm0_a3, postal_code) + +-- create indexes on named places table +CREATE INDEX idx_global_cities_points_limited_a ON global_cities_points_limited (lowername, iso2) +CREATE INDEX idx_global_cities_points_limited_admin1 ON global_cities_points_limited (admin1) +CREATE INDEX idx_global_cities_points_limited_geoname_id ON global_cities_points_limited (geoname_id) From 0626a29285f8a0cfe63bb4198efb55fb1c75eb17 Mon Sep 17 00:00:00 2001 From: Carla Date: Mon, 15 Jun 2015 16:12:18 +0200 Subject: [PATCH 2/3] Adds indexes existent in alternates city names --- geocoder/setup/indexes.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/geocoder/setup/indexes.sql b/geocoder/setup/indexes.sql index 5ab2755..abacd0b 100644 --- a/geocoder/setup/indexes.sql +++ b/geocoder/setup/indexes.sql @@ -18,3 +18,7 @@ CREATE UNIQUE INDEX idx_postal_code_polygons_a3_code ON postal_code_polygons (ad CREATE INDEX idx_global_cities_points_limited_a ON global_cities_points_limited (lowername, iso2) CREATE INDEX idx_global_cities_points_limited_admin1 ON global_cities_points_limited (admin1) CREATE INDEX idx_global_cities_points_limited_geoname_id ON global_cities_points_limited (geoname_id) + +CREATE INDEX idx_global_cities_alternates_limited_admin1 ON global_cities_alternates_limited (admin1) +CREATE INDEX idx_global_cities_alternates_limited_admin1_geonameid ON global_cities_alternates_limited (admin1_geonameid) +CREATE INDEX idx_global_cities_alternates_limited_lowername ON global_cities_alternates_limited (lowername) From a808688edebc9d739840e95418adb793d70f0f80 Mon Sep 17 00:00:00 2001 From: Carla Date: Mon, 15 Jun 2015 18:10:13 +0200 Subject: [PATCH 3/3] Checks typo --- geocoder/namedplace/sql/build_data_table.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geocoder/namedplace/sql/build_data_table.sql b/geocoder/namedplace/sql/build_data_table.sql index 5e27010..6b49740 100644 --- a/geocoder/namedplace/sql/build_data_table.sql +++ b/geocoder/namedplace/sql/build_data_table.sql @@ -17,7 +17,7 @@ DELETE FROM global_cities_points_limited; -- it assumes that the source is called "allcountries" INSERT INTO global_cities_points_limited (the_geom, admin1, admin2, admin3, admin4, altnames, asciiname, cc2, featclass, featcode, geoname_id, gtopo30, iso2, lowername, name, population) SELECT the_geom, admin1, admin2, admin3, admin4, altnames, asciiname, cc2, featclass, featcode, geonameid::int, gtopo30, country, lower(name) as lowername, name, population - FROM points_cities + FROM allcountries WHERE featcode = ''; -- insert data from source table (allcountries) to the table