From: Kaj-Michael Lang Date: Wed, 11 Jul 2007 12:11:57 +0000 (+0300) Subject: Add table definition X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9837de195efc7a19253ecf36cf582a11702ca29f;p=mapper Add table definition --- diff --git a/docs/osm-tables.sql b/docs/osm-tables.sql new file mode 100644 index 0000000..8aa4d10 --- /dev/null +++ b/docs/osm-tables.sql @@ -0,0 +1,57 @@ +create table way ( + wid int not null, + type int not null, + nodes int not null, + flags int not null, + len real +); + +create unique index way_widx on way(wid); + +create table way_seg ( + wsid int not null, + num int not null, + node int not null +); + +create table area ( + waid int not null, + num int not null, + lat int not null, + lon int not null +); + +create table way_type ( + wtid int not null, + type int not null +); + +create table names ( + nid int not null, + name varchar(256), + isin varchar(256) +); + +create table ref ( + rid int not null, + ref varchar(32), + int_ref varchar(32) +); + +CREATE TABLE poi ( + poi_id integer PRIMARY KEY, + lat real not null, + lon real not null, + elev real default 0.0, + label text, + desc text, + public integer default 1, + source integer default 0, + cat_id integer, + osm_id integer default 0, + priority int default 2 +); + +CREATE UNIQUE INDEX poi_lat_lon_idx on poi (lat, lon, cat_id); +CREATE INDEX poi_priority on poi (priority); +CREATE INDEX name_idx on names (name);