CREATE UNIQUE INDEX poi_lat_lon_idx on poi (lat, lon, cat_id);
CREATE INDEX poi_priority on poi (priority);
-CREATE INDEX node_ll_idx on nodes (lat,lon);
+CREATE INDEX node_lat_idx on nodes (lat);
+CREATE INDEX node_lon_idx on nodes (lon);
-CREATE INDEX name_idx on way_names (name);
+CREATE INDEX way_name_idx on way_names (name);
+CREATE INDEX way_ref_idx on way_ref (ref);
CREATE INDEX way_seg_wsid_idx on way_seg (wsid);
CREATE INDEX way_seg_node_idx on way_seg (node);
);
create table way (
- wid int primary key,
+ wid int primary key,
type int not null,
nodes int not null,
flags int not null,
- len real
+ len real
);
create table way_seg (
wsid int not null,
- num 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
+ num int not null,
+ lat int not null,
+ lon int not null
);
create table way_names (
- wid int not null,
+ wid int not null,
name varchar(256),
isin varchar(256)
);
create table way_ref (
- rid int primary key,
- ref varchar(32),
+ rid int primary key,
+ ref varchar(32),
int_ref varchar(32)
);
);
create table poi (
- poi_id integer PRIMARY KEY,
- lat real not null,
- lon real not null,
+ poi_id integer PRIMARY KEY,
+ lat real not null,
+ lon real not null,
elev real default 0.0,
label text,
desc text,
+ url text,
public integer default 1,
source integer default 0,
cat_id integer,
);
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
+ cat_id integer PRIMARY KEY,
+ pcat_id integer,
+ priority integer not null default 2,
+ label text,
+ desc text,
+ color char(6) not null default '#AAAA40',
+ icon varchar(32),
+ enabled integer not null default 1
);