From 02fc172b5c804867c495457fa692151a492beea5 Mon Sep 17 00:00:00 2001 From: Al Date: Tue, 11 Oct 2016 02:11:26 -0400 Subject: [PATCH] [geoplanet] abbreviations for UK and NYC, fixing country codes for IM, GG and JE --- .../geoplanet/cleanup_geoplanet_db.sql | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/scripts/geodata/geoplanet/cleanup_geoplanet_db.sql b/scripts/geodata/geoplanet/cleanup_geoplanet_db.sql index 3c0f8cd7..7ffdec0e 100644 --- a/scripts/geodata/geoplanet/cleanup_geoplanet_db.sql +++ b/scripts/geodata/geoplanet/cleanup_geoplanet_db.sql @@ -28,6 +28,11 @@ ); -- United Kingdom + -- Make UK an abbreviation rather than a variant (as those aren't used) + update aliases set name_type = "A" + where id = 23424975 -- United Kingdom + and name = "UK" and language = "ENG"; + -- City of London update places set place_type = "Town" @@ -56,6 +61,10 @@ place_type = "State" where parent_id = 23424847; + update places + set country_code = "IM" + where id in (select id from admins where country_code = "IM"); + update postal_codes set country_code = "IM" where parent_id in (select id from places where country_code = "IM"); @@ -83,6 +92,10 @@ place_type = "State" where parent_id = 23424827; + update places + set country_code = "GG" + where id in (select id from admins where country_code = "GG"); + update postal_codes set country_code = "GG" where parent_id in (select id from places where country_code = "GG"); @@ -110,6 +123,10 @@ place_type = "State" where parent_id = 23424857; + update places + set country_code = "JE" + where id in (select id from admins where country_code = "JE"); + update postal_codes set country_code = "JE" where parent_id in (select id from places where country_code = "JE"); @@ -286,6 +303,20 @@ set county_id = 0 where state_id = 2347567; + -- Preferred name for New York + update aliases + set name_type = "P" + where id = 2459115 + and name = "New York City" + and language = "ENG"; + + -- Additional abbreviations for NYC + update aliases + set name_type = "A" + where id = 2459115 + and name in ("NY City", "NY Cty", "New York Cty") + and language = "ENG"; + -- Boroughs of NYC -- listed as counties, make them LocalAdmin update places