Skip to content

Instantly share code, notes, and snippets.

@nyurik
Last active May 31, 2016 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nyurik/408805bfb3be1c05b7f9cc6f12d7fc72 to your computer and use it in GitHub Desktop.
Save nyurik/408805bfb3be1c05b7f9cc6f12d7fc72 to your computer and use it in GitHub Desktop.
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
--
-- Name: hstore; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS hstore WITH SCHEMA public;
--
-- Name: EXTENSION hstore; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION hstore IS 'data type for storing sets of (key, value) pairs';
--
-- Name: postgis; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;
--
-- Name: EXTENSION postgis; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION postgis IS 'PostGIS geometry, geography, and raster spatial types and functions';
SET search_path = public, pg_catalog;
--
-- Name: bail_out(text, text, text, text); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION bail_out(msg text, param1 text DEFAULT ''::text, param2 text DEFAULT ''::text, param3 text DEFAULT ''::text) RETURNS text
LANGUAGE plpgsql
AS $$
BEGIN
RAISE '%', format(msg, param1, param2, param3);
END;
$$;
ALTER FUNCTION public.bail_out(msg text, param1 text, param2 text, param3 text) OWNER TO osmimporter;
--
-- Name: clean_int(text); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION clean_int(i text) RETURNS integer
LANGUAGE plpgsql IMMUTABLE
AS $$
begin
return cast(cast(i as float) as integer);
exception
when invalid_text_representation then
return null;
when numeric_value_out_of_range then
return null;
end;
$$;
ALTER FUNCTION public.clean_int(i text) OWNER TO osmimporter;
--
-- Name: clean_numeric(text); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION clean_numeric(i text) RETURNS numeric
LANGUAGE plpgsql IMMUTABLE
AS $$
begin
return cast(cast(i as float) as numeric);
exception
when invalid_text_representation then
return null;
when numeric_value_out_of_range then
return null;
end;
$$;
ALTER FUNCTION public.clean_numeric(i text) OWNER TO osmimporter;
--
-- Name: get_label_name(text); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION get_label_name(name text) RETURNS text
LANGUAGE plpgsql
AS $_$
BEGIN
RETURN regexp_replace(name, '\s*;.*$', '');
END;
$_$;
ALTER FUNCTION public.get_label_name(name text) OWNER TO osmimporter;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: admin; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE admin (
osm_id bigint,
access text,
"addr:housename" text,
"addr:housenumber" text,
"addr:interpolation" text,
admin_level text,
aerialway text,
aeroway text,
amenity text,
area text,
barrier text,
bicycle text,
brand text,
bridge text,
boundary text,
building text,
construction text,
covered text,
culvert text,
cutting text,
denomination text,
disused text,
embankment text,
foot text,
"generator:source" text,
harbour text,
highway text,
historic text,
horse text,
intermittent text,
junction text,
landuse text,
layer text,
leisure text,
lock text,
man_made text,
military text,
motorcar text,
name text,
"natural" text,
office text,
oneway text,
operator text,
place text,
population text,
power text,
power_source text,
public_transport text,
railway text,
ref text,
religion text,
route text,
service text,
shop text,
sport text,
surface text,
toll text,
tourism text,
"tower:type" text,
tracktype text,
tunnel text,
water text,
waterway text,
wetland text,
width text,
wood text,
z_order integer,
way_area real,
tags hstore,
way geometry(LineString,900913) NOT NULL
);
ALTER TABLE admin OWNER TO postgres;
--
-- Name: insert_admin_row(admin, geometry); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION insert_admin_row(therow admin, geom geometry) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
theRow.way := geom;
INSERT INTO admin VALUES(theRow.*);
END
$$;
ALTER FUNCTION public.insert_admin_row(therow admin, geom geometry) OWNER TO osmimporter;
--
-- Name: insert_admin_rows(admin, geometry, boolean); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION insert_admin_rows(therow admin, geom geometry, maritime boolean) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
i int;
BEGIN
theRow.tags := theRow.tags || (CASE WHEN maritime THEN '"maritime" => "1"' ELSE '"maritime" => "0"' END)::hstore;
IF GeometryType(geom) = 'LINESTRING' THEN -- Simple geometry
PERFORM insert_admin_row(theRow, geom);
ELSE
FOR i IN 1..ST_NumGeometries(geom) LOOP -- Composite geometry, insert one row per subgeometry
PERFORM insert_admin_row(theRow, ST_GeometryN(geom, i));
END LOOP;
END IF;
END
$$;
ALTER FUNCTION public.insert_admin_rows(therow admin, geom geometry, maritime boolean) OWNER TO osmimporter;
--
-- Name: labelgrid(geometry, numeric, numeric); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION labelgrid(geometry geometry, grid_width numeric, pixel_width numeric) RETURNS text
LANGUAGE plpgsql IMMUTABLE
AS $$
begin
if pixel_width = 0 then
return 'null';
end if;
return st_astext(st_snaptogrid(
geometry,
grid_width/2*pixel_width, -- x origin
grid_width/2*pixel_width, -- y origin
grid_width*pixel_width, -- x size
grid_width*pixel_width -- y size
));
end;
$$;
ALTER FUNCTION public.labelgrid(geometry geometry, grid_width numeric, pixel_width numeric) OWNER TO osmimporter;
--
-- Name: linelabel(numeric, text, geometry); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION linelabel(zoom numeric, label text, geometry geometry) RETURNS boolean
LANGUAGE plpgsql IMMUTABLE
AS $$
begin
if zoom > 20 or st_length(geometry) = 0 then
-- if length is 0 geom is (probably) a point; keep it
return true;
else
return length(label) BETWEEN 1 AND st_length(geometry)/(2^(20-zoom));
end if;
end;
$$;
ALTER FUNCTION public.linelabel(zoom numeric, label text, geometry geometry) OWNER TO osmimporter;
--
-- Name: merc_buffer(geometry, numeric); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION merc_buffer(geom geometry, distance numeric) RETURNS geometry
LANGUAGE plpgsql IMMUTABLE
AS $$
begin
return st_buffer(
geom,
distance / cos(radians(st_y(st_transform(st_centroid(geom),4326))))
);
end;
$$;
ALTER FUNCTION public.merc_buffer(geom geometry, distance numeric) OWNER TO osmimporter;
--
-- Name: merc_dwithin(geometry, geometry, numeric); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION merc_dwithin(geom1 geometry, geom2 geometry, distance numeric) RETURNS boolean
LANGUAGE plpgsql IMMUTABLE
AS $$
begin
return st_dwithin(
geom1,
geom2,
distance / cos(radians(st_y(st_transform(st_centroid(geom1),4326))))
);
end;
$$;
ALTER FUNCTION public.merc_dwithin(geom1 geometry, geom2 geometry, distance numeric) OWNER TO osmimporter;
--
-- Name: merc_length(geometry); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION merc_length(geom geometry) RETURNS numeric
LANGUAGE plpgsql IMMUTABLE
AS $$
begin
return st_length(geom) * cos(radians(st_y(st_transform(st_centroid(geom),4326))));
end;
$$;
ALTER FUNCTION public.merc_length(geom geometry) OWNER TO osmimporter;
--
-- Name: populate_admin(); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION populate_admin() RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
row admin%rowtype;
way geometry;
water geometry;
result geometry;
len int;
BEGIN
TRUNCATE TABLE admin;
-- Let the datasource to perform precise filtering, but just don't pull all the crap here
FOR row IN SELECT * FROM planet_osm_roads WHERE boundary='administrative' AND admin_level IN ('2', '4') LOOP
way := row.way;
water := water_under(way);
IF water IS NULL THEN
PERFORM insert_admin_rows(row, way, FALSE);
CONTINUE;
END IF;
result := ST_Intersection(way, water);
IF ST_IsEmpty(result) THEN
PERFORM insert_admin_rows(row, way, FALSE);
ELSE
PERFORM insert_admin_rows(row, result, TRUE);
IF NOT ST_Equals(way, result) THEN
result := ST_Difference(way, water);
IF NOT ST_IsEmpty(result) THEN
PERFORM insert_admin_rows(row, result, FALSE);
END IF;
END IF;
END IF;
END LOOP;
END
$$;
ALTER FUNCTION public.populate_admin() OWNER TO osmimporter;
--
-- Name: tile_bbox(integer, integer, integer); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION tile_bbox(z integer, x integer, y integer) RETURNS geometry
LANGUAGE plpgsql IMMUTABLE
AS $$
declare
max numeric := 20037508.34;
res numeric := (max*2)/(2^z);
begin
return st_makeenvelope(
-max + (x * res),
max - (y * res),
-max + (x * res) + res,
max - (y * res) - res,
3857);
end;
$$;
ALTER FUNCTION public.tile_bbox(z integer, x integer, y integer) OWNER TO osmimporter;
--
-- Name: to_int(text); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION to_int(s text) RETURNS integer
LANGUAGE plpgsql
AS $_$
BEGIN
RETURN CASE WHEN s~E'^\\d+$' THEN s::INTEGER ELSE 0 END;
END;
$_$;
ALTER FUNCTION public.to_int(s text) OWNER TO osmimporter;
--
-- Name: topoint(geometry); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION topoint(geom geometry) RETURNS geometry
LANGUAGE plpgsql IMMUTABLE
AS $$
begin
if geometrytype(geom) = 'POINT' then
return geom;
elsif st_isempty(st_makevalid(geom)) then
-- This should not be necessary with Geos >= 3.3.7, but we're getting
-- mystery MultiPoint objects from ST_MakeValid (or somewhere) when
-- empty objects are input.
return NULL;
else
return st_pointonsurface(st_makevalid(geom));
end if;
end;
$$;
ALTER FUNCTION public.topoint(geom geometry) OWNER TO osmimporter;
--
-- Name: water_under(geometry); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION water_under(geom geometry) RETURNS geometry
LANGUAGE plpgsql
AS $$
DECLARE
water geometry[];
BEGIN
SELECT array_agg(way) INTO water FROM water_polygons WHERE way && geom AND way IS NOT NULL AND geom IS NOT NULL;
RETURN ST_Union(water);
END
$$;
ALTER FUNCTION public.water_under(geom geometry) OWNER TO osmimporter;
--
-- Name: z(numeric); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION z(scaledenominator numeric) RETURNS integer
LANGUAGE plpgsql IMMUTABLE
AS $$
begin
-- Don't bother if the scale is larger than ~zoom level 0
if scaledenominator > 600000000 then
return null;
end if;
return round(log(2,559082264.028/scaledenominator));
end;
$$;
ALTER FUNCTION public.z(scaledenominator numeric) OWNER TO osmimporter;
--
-- Name: zres(double precision); Type: FUNCTION; Schema: public; Owner: osmimporter
--
CREATE FUNCTION zres(z double precision) RETURNS double precision
LANGUAGE plpgsql IMMUTABLE
AS $$
begin
return (40075016.6855785/(256*2^z));
end;
$$;
ALTER FUNCTION public.zres(z double precision) OWNER TO osmimporter;
--
-- Name: planet_osm_line; Type: TABLE; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE TABLE planet_osm_line (
osm_id bigint,
access text,
"addr:housename" text,
"addr:housenumber" text,
"addr:interpolation" text,
admin_level text,
aerialway text,
aeroway text,
amenity text,
area text,
barrier text,
bicycle text,
brand text,
bridge text,
boundary text,
building text,
construction text,
covered text,
culvert text,
cutting text,
denomination text,
disused text,
embankment text,
foot text,
"generator:source" text,
harbour text,
highway text,
historic text,
horse text,
intermittent text,
junction text,
landuse text,
layer text,
leisure text,
lock text,
man_made text,
military text,
motorcar text,
name text,
"natural" text,
office text,
oneway text,
operator text,
place text,
population text,
power text,
power_source text,
public_transport text,
railway text,
ref text,
religion text,
route text,
service text,
shop text,
sport text,
surface text,
toll text,
tourism text,
"tower:type" text,
tracktype text,
tunnel text,
water text,
waterway text,
wetland text,
width text,
wood text,
z_order integer,
way_area real,
tags hstore,
way geometry(LineString,900913) NOT NULL
);
ALTER TABLE planet_osm_line OWNER TO osmimporter;
--
-- Name: planet_osm_nodes; Type: TABLE; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE TABLE planet_osm_nodes (
id bigint NOT NULL,
lat integer NOT NULL,
lon integer NOT NULL,
tags text[]
);
ALTER TABLE planet_osm_nodes OWNER TO osmimporter;
--
-- Name: planet_osm_point; Type: TABLE; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE TABLE planet_osm_point (
osm_id bigint,
access text,
"addr:housename" text,
"addr:housenumber" text,
"addr:interpolation" text,
admin_level text,
aerialway text,
aeroway text,
amenity text,
area text,
barrier text,
bicycle text,
brand text,
bridge text,
boundary text,
building text,
capital text,
construction text,
covered text,
culvert text,
cutting text,
denomination text,
disused text,
ele text,
embankment text,
foot text,
"generator:source" text,
harbour text,
highway text,
historic text,
horse text,
intermittent text,
junction text,
landuse text,
layer text,
leisure text,
lock text,
man_made text,
military text,
motorcar text,
name text,
"natural" text,
office text,
oneway text,
operator text,
place text,
poi text,
population text,
power text,
power_source text,
public_transport text,
railway text,
ref text,
religion text,
route text,
service text,
shop text,
sport text,
surface text,
toll text,
tourism text,
"tower:type" text,
tunnel text,
water text,
waterway text,
wetland text,
width text,
wood text,
z_order integer,
tags hstore,
way geometry(Point,900913) NOT NULL
);
ALTER TABLE planet_osm_point OWNER TO osmimporter;
--
-- Name: planet_osm_polygon; Type: TABLE; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE TABLE planet_osm_polygon (
osm_id bigint,
access text,
"addr:housename" text,
"addr:housenumber" text,
"addr:interpolation" text,
admin_level text,
aerialway text,
aeroway text,
amenity text,
area text,
barrier text,
bicycle text,
brand text,
bridge text,
boundary text,
building text,
construction text,
covered text,
culvert text,
cutting text,
denomination text,
disused text,
embankment text,
foot text,
"generator:source" text,
harbour text,
highway text,
historic text,
horse text,
intermittent text,
junction text,
landuse text,
layer text,
leisure text,
lock text,
man_made text,
military text,
motorcar text,
name text,
"natural" text,
office text,
oneway text,
operator text,
place text,
population text,
power text,
power_source text,
public_transport text,
railway text,
ref text,
religion text,
route text,
service text,
shop text,
sport text,
surface text,
toll text,
tourism text,
"tower:type" text,
tracktype text,
tunnel text,
water text,
waterway text,
wetland text,
width text,
wood text,
z_order integer,
way_area real,
tags hstore,
way geometry(Geometry,900913) NOT NULL
);
ALTER TABLE planet_osm_polygon OWNER TO osmimporter;
--
-- Name: planet_osm_rels; Type: TABLE; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE TABLE planet_osm_rels (
id bigint NOT NULL,
way_off smallint,
rel_off smallint,
parts bigint[],
members text[],
tags text[],
pending boolean NOT NULL
);
ALTER TABLE planet_osm_rels OWNER TO osmimporter;
--
-- Name: planet_osm_roads; Type: TABLE; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE TABLE planet_osm_roads (
osm_id bigint,
access text,
"addr:housename" text,
"addr:housenumber" text,
"addr:interpolation" text,
admin_level text,
aerialway text,
aeroway text,
amenity text,
area text,
barrier text,
bicycle text,
brand text,
bridge text,
boundary text,
building text,
construction text,
covered text,
culvert text,
cutting text,
denomination text,
disused text,
embankment text,
foot text,
"generator:source" text,
harbour text,
highway text,
historic text,
horse text,
intermittent text,
junction text,
landuse text,
layer text,
leisure text,
lock text,
man_made text,
military text,
motorcar text,
name text,
"natural" text,
office text,
oneway text,
operator text,
place text,
population text,
power text,
power_source text,
public_transport text,
railway text,
ref text,
religion text,
route text,
service text,
shop text,
sport text,
surface text,
toll text,
tourism text,
"tower:type" text,
tracktype text,
tunnel text,
water text,
waterway text,
wetland text,
width text,
wood text,
z_order integer,
way_area real,
tags hstore,
way geometry(LineString,900913) NOT NULL
);
ALTER TABLE planet_osm_roads OWNER TO osmimporter;
--
-- Name: planet_osm_ways; Type: TABLE; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE TABLE planet_osm_ways (
id bigint NOT NULL,
nodes bigint[] NOT NULL,
tags text[],
pending boolean NOT NULL
);
ALTER TABLE planet_osm_ways OWNER TO osmimporter;
--
-- Name: water_polygons; Type: TABLE; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE TABLE water_polygons (
gid integer NOT NULL,
fid double precision,
way geometry(MultiPolygon,900913)
);
ALTER TABLE water_polygons OWNER TO osmimporter;
--
-- Name: water_polygons_gid_seq; Type: SEQUENCE; Schema: public; Owner: osmimporter
--
CREATE SEQUENCE water_polygons_gid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE water_polygons_gid_seq OWNER TO osmimporter;
--
-- Name: water_polygons_gid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: osmimporter
--
ALTER SEQUENCE water_polygons_gid_seq OWNED BY water_polygons.gid;
--
-- Name: gid; Type: DEFAULT; Schema: public; Owner: osmimporter
--
ALTER TABLE ONLY water_polygons ALTER COLUMN gid SET DEFAULT nextval('water_polygons_gid_seq'::regclass);
--
-- Name: planet_osm_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: osmimporter; Tablespace:
--
ALTER TABLE ONLY planet_osm_nodes
ADD CONSTRAINT planet_osm_nodes_pkey PRIMARY KEY (id);
--
-- Name: planet_osm_rels_pkey; Type: CONSTRAINT; Schema: public; Owner: osmimporter; Tablespace:
--
ALTER TABLE ONLY planet_osm_rels
ADD CONSTRAINT planet_osm_rels_pkey PRIMARY KEY (id);
--
-- Name: planet_osm_ways_pkey; Type: CONSTRAINT; Schema: public; Owner: osmimporter; Tablespace:
--
ALTER TABLE ONLY planet_osm_ways
ADD CONSTRAINT planet_osm_ways_pkey PRIMARY KEY (id);
--
-- Name: water_polygons_pkey; Type: CONSTRAINT; Schema: public; Owner: osmimporter; Tablespace:
--
ALTER TABLE ONLY water_polygons
ADD CONSTRAINT water_polygons_pkey PRIMARY KEY (gid);
--
-- Name: admin_osm_id_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX admin_osm_id_idx ON admin USING btree (osm_id);
--
-- Name: planet_osm_line_index; Type: INDEX; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE INDEX planet_osm_line_index ON planet_osm_line USING gist (way) WITH (fillfactor='100');
--
-- Name: planet_osm_line_pkey; Type: INDEX; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE INDEX planet_osm_line_pkey ON planet_osm_line USING btree (osm_id);
--
-- Name: planet_osm_point_index; Type: INDEX; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE INDEX planet_osm_point_index ON planet_osm_point USING gist (way) WITH (fillfactor='100');
--
-- Name: planet_osm_point_pkey; Type: INDEX; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE INDEX planet_osm_point_pkey ON planet_osm_point USING btree (osm_id);
--
-- Name: planet_osm_polygon_index; Type: INDEX; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE INDEX planet_osm_polygon_index ON planet_osm_polygon USING gist (way) WITH (fillfactor='100');
--
-- Name: planet_osm_polygon_pkey; Type: INDEX; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE INDEX planet_osm_polygon_pkey ON planet_osm_polygon USING btree (osm_id);
--
-- Name: planet_osm_rels_idx; Type: INDEX; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE INDEX planet_osm_rels_idx ON planet_osm_rels USING btree (id) WHERE pending;
--
-- Name: planet_osm_roads_index; Type: INDEX; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE INDEX planet_osm_roads_index ON planet_osm_roads USING gist (way) WITH (fillfactor='100');
--
-- Name: planet_osm_roads_pkey; Type: INDEX; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE INDEX planet_osm_roads_pkey ON planet_osm_roads USING btree (osm_id);
--
-- Name: planet_osm_ways_idx; Type: INDEX; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE INDEX planet_osm_ways_idx ON planet_osm_ways USING btree (id) WHERE pending;
--
-- Name: water_polygons_way_idx; Type: INDEX; Schema: public; Owner: osmimporter; Tablespace:
--
CREATE INDEX water_polygons_way_idx ON water_polygons USING gist (way);
--
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--
REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;
--
-- Name: admin; Type: ACL; Schema: public; Owner: postgres
--
REVOKE ALL ON TABLE admin FROM PUBLIC;
REVOKE ALL ON TABLE admin FROM postgres;
GRANT ALL ON TABLE admin TO postgres;
GRANT SELECT ON TABLE admin TO kartotherian;
GRANT SELECT ON TABLE admin TO tilerator;
GRANT SELECT ON TABLE admin TO tileratorui;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE admin TO osmupdater;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE admin TO osmimporter;
--
-- Name: planet_osm_line; Type: ACL; Schema: public; Owner: osmimporter
--
REVOKE ALL ON TABLE planet_osm_line FROM PUBLIC;
REVOKE ALL ON TABLE planet_osm_line FROM osmimporter;
GRANT ALL ON TABLE planet_osm_line TO osmimporter;
GRANT SELECT ON TABLE planet_osm_line TO kartotherian;
GRANT SELECT ON TABLE planet_osm_line TO tilerator;
GRANT SELECT ON TABLE planet_osm_line TO tileratorui;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE planet_osm_line TO osmupdater;
--
-- Name: planet_osm_nodes; Type: ACL; Schema: public; Owner: osmimporter
--
REVOKE ALL ON TABLE planet_osm_nodes FROM PUBLIC;
REVOKE ALL ON TABLE planet_osm_nodes FROM osmimporter;
GRANT ALL ON TABLE planet_osm_nodes TO osmimporter;
GRANT SELECT ON TABLE planet_osm_nodes TO kartotherian;
GRANT SELECT ON TABLE planet_osm_nodes TO tilerator;
GRANT SELECT ON TABLE planet_osm_nodes TO tileratorui;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE planet_osm_nodes TO osmupdater;
--
-- Name: planet_osm_point; Type: ACL; Schema: public; Owner: osmimporter
--
REVOKE ALL ON TABLE planet_osm_point FROM PUBLIC;
REVOKE ALL ON TABLE planet_osm_point FROM osmimporter;
GRANT ALL ON TABLE planet_osm_point TO osmimporter;
GRANT SELECT ON TABLE planet_osm_point TO kartotherian;
GRANT SELECT ON TABLE planet_osm_point TO tilerator;
GRANT SELECT ON TABLE planet_osm_point TO tileratorui;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE planet_osm_point TO osmupdater;
--
-- Name: planet_osm_polygon; Type: ACL; Schema: public; Owner: osmimporter
--
REVOKE ALL ON TABLE planet_osm_polygon FROM PUBLIC;
REVOKE ALL ON TABLE planet_osm_polygon FROM osmimporter;
GRANT ALL ON TABLE planet_osm_polygon TO osmimporter;
GRANT SELECT ON TABLE planet_osm_polygon TO kartotherian;
GRANT SELECT ON TABLE planet_osm_polygon TO tilerator;
GRANT SELECT ON TABLE planet_osm_polygon TO tileratorui;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE planet_osm_polygon TO osmupdater;
--
-- Name: planet_osm_rels; Type: ACL; Schema: public; Owner: osmimporter
--
REVOKE ALL ON TABLE planet_osm_rels FROM PUBLIC;
REVOKE ALL ON TABLE planet_osm_rels FROM osmimporter;
GRANT ALL ON TABLE planet_osm_rels TO osmimporter;
GRANT SELECT ON TABLE planet_osm_rels TO kartotherian;
GRANT SELECT ON TABLE planet_osm_rels TO tilerator;
GRANT SELECT ON TABLE planet_osm_rels TO tileratorui;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE planet_osm_rels TO osmupdater;
--
-- Name: planet_osm_roads; Type: ACL; Schema: public; Owner: osmimporter
--
REVOKE ALL ON TABLE planet_osm_roads FROM PUBLIC;
REVOKE ALL ON TABLE planet_osm_roads FROM osmimporter;
GRANT ALL ON TABLE planet_osm_roads TO osmimporter;
GRANT SELECT ON TABLE planet_osm_roads TO kartotherian;
GRANT SELECT ON TABLE planet_osm_roads TO tilerator;
GRANT SELECT ON TABLE planet_osm_roads TO tileratorui;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE planet_osm_roads TO osmupdater;
--
-- Name: planet_osm_ways; Type: ACL; Schema: public; Owner: osmimporter
--
REVOKE ALL ON TABLE planet_osm_ways FROM PUBLIC;
REVOKE ALL ON TABLE planet_osm_ways FROM osmimporter;
GRANT ALL ON TABLE planet_osm_ways TO osmimporter;
GRANT SELECT ON TABLE planet_osm_ways TO kartotherian;
GRANT SELECT ON TABLE planet_osm_ways TO tilerator;
GRANT SELECT ON TABLE planet_osm_ways TO tileratorui;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE planet_osm_ways TO osmupdater;
--
-- Name: water_polygons; Type: ACL; Schema: public; Owner: osmimporter
--
REVOKE ALL ON TABLE water_polygons FROM PUBLIC;
REVOKE ALL ON TABLE water_polygons FROM osmimporter;
GRANT ALL ON TABLE water_polygons TO osmimporter;
GRANT SELECT ON TABLE water_polygons TO kartotherian;
GRANT SELECT ON TABLE water_polygons TO tilerator;
GRANT SELECT ON TABLE water_polygons TO tileratorui;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE water_polygons TO osmupdater;
--
-- PostgreSQL database dump complete
--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment