treeadvisor/db.sql

28 lines
573 B
SQL

create extension fuzzystrmatch;
CREATE TABLE trees (
id text primary key,
coord point,
score float,
botanic text,
botanic_pfaf text,
german text,
planted date
);
CREATE INDEX trees_coord ON trees USING GIST (coord);
CREATE TABLE areas (
coords polygon,
src text,
attrs jsonb
);
CREATE INDEX areas_coords ON areas USING GIST (coords);
CREATE INDEX areas_box_coords ON areas USING GIST (box(coords));
CREATE TABLE osm_ways (
geo path,
id bigint,
attrs jsonb
);
CREATE INDEX osm_ways_box_coords ON osm_ways USING GIST (box(polygon(pclose(geo))));