From: Kaj-Michael Lang Date: Mon, 16 Jul 2007 08:53:34 +0000 (+0300) Subject: Update table definitions X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6d9977b9f33a176d5f73af49624897570c2edbb;p=mapper Update table definitions --- diff --git a/docs/osm-tables.sql b/docs/osm-tables.sql index 8aa4d10..8bbe370 100644 --- a/docs/osm-tables.sql +++ b/docs/osm-tables.sql @@ -1,19 +1,28 @@ +create table nodes ( + nid int primary key, + lat int not null, + lon int not null, + l int not null default 0 +); + +create index node_ll_idx on nodes (lat,lon); + create table way ( - wid int not null, + wid int primary key, 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 index way_seg_node_idx on way_seg (node); + create table area ( waid int not null, num int not null, @@ -26,14 +35,14 @@ create table way_type ( type int not null ); -create table names ( - nid int not null, +create table way_names ( + wid int not null, name varchar(256), isin varchar(256) ); -create table ref ( - rid int not null, +create table way_ref ( + rid int primary key, ref varchar(32), int_ref varchar(32) ); @@ -54,4 +63,4 @@ CREATE TABLE poi ( 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); +CREATE INDEX name_idx on way_names (name);