Try to use OSM source data for countries and states

This commit is contained in:
lukasmartinelli
2016-10-28 15:05:49 +02:00
parent ab80b2212e
commit dccdbdfbcc
7 changed files with 131 additions and 53 deletions

View File

@@ -1,9 +1,9 @@
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'place_subclass') THEN
CREATE TYPE place_subclass AS ENUM ('city', 'town', 'village', 'hamlet', 'suburb', 'neighbourhood', 'isolated_dwelling');
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'city_class') THEN
CREATE TYPE city_class AS ENUM ('city', 'town', 'village', 'hamlet', 'suburb', 'neighbourhood', 'isolated_dwelling');
END IF;
END
$$;
ALTER TABLE osm_place_point ALTER COLUMN place TYPE place_subclass USING place::place_subclass;
ALTER TABLE osm_city_point ALTER COLUMN place TYPE city_class USING place::city_class;