-drop table IF EXISTS place_boundingbox CASCADE;
-CREATE TABLE place_boundingbox (
- place_id BIGINT,
- minlat float,
- maxlat float,
- minlon float,
- maxlon float,
- numfeatures integer,
- area float
- );
-CREATE INDEX idx_place_boundingbox_place_id on place_boundingbox USING BTREE (place_id);
-SELECT AddGeometryColumn('place_boundingbox', 'outline', 4326, 'GEOMETRY', 2);
-CREATE INDEX idx_place_boundingbox_outline ON place_boundingbox USING GIST (outline);
-GRANT SELECT on place_boundingbox to "www-data" ;
-GRANT INSERT on place_boundingbox to "www-data" ;
-
-drop table IF EXISTS reverse_cache;
-CREATE TABLE reverse_cache (
- latlonzoomid integer,
- country_code varchar(2),
- place_id BIGINT
- );
-GRANT SELECT on reverse_cache to "www-data" ;
-GRANT INSERT on reverse_cache to "www-data" ;
-CREATE INDEX idx_reverse_cache_latlonzoomid ON reverse_cache USING BTREE (latlonzoomid);
-
-drop table country;
-CREATE TABLE country (
- country_code varchar(2),
- country_name hstore,
- country_default_language_code varchar(2)
- );
-SELECT AddGeometryColumn('country', 'geometry', 4326, 'POLYGON', 2);
-insert into country select iso3166::varchar(2), 'name:en'->cntry_name, null,
- ST_Transform(geometryn(the_geom, generate_series(1, numgeometries(the_geom))), 4326) from worldboundaries;
-CREATE INDEX idx_country_country_code ON country USING BTREE (country_code);
-CREATE INDEX idx_country_geometry ON country USING GIST (geometry);
-
-drop table placex;