]> err.no Git - mapper/blobdiff - docs/osm-tables.sql
Document the category table here too.
[mapper] / docs / osm-tables.sql
index 8aa4d101a1da97f1119ae2928448051e16e3f2ed..89eebffa5a1fa8adbfbaf8f250bba8055e61ec10 100644 (file)
@@ -1,13 +1,18 @@
+create table nodes (
+       nid     int primary key,
+       lat     int not null,
+       lon     int not null,
+       l       int not null default 0
+);
+
 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,
@@ -26,19 +31,26 @@ 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)
 );
 
-CREATE TABLE poi (
+create table places (
+       nid     int primary key,
+       type    int not null,
+       name    text,
+       isin    int
+);
+
+create table poi (
        poi_id integer PRIMARY KEY,
        lat     real not null,
        lon     real not null,
@@ -52,6 +64,14 @@ CREATE TABLE poi (
        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);
+create table category (
+       cat_id integer PRIMARY KEY,
+       pcat_id int,
+       priority int,
+       label text,
+       desc text,
+       color char(6),
+       icon varchar(32),
+       enabled integer
+);
+