-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaddr_schema.sql
67 lines (61 loc) · 1.01 KB
/
addr_schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
CREATE TABLE buildings
(
src_id bigint NOT NULL,
src_type "char" NOT NULL,
centroid geometry(Point),
tags hstore,
CONSTRAINT buildings_pk PRIMARY KEY (src_id , src_type )
)
WITH (
OIDS=FALSE
);
CREATE TABLE polygons
(
src_id bigint NOT NULL,
src_type "char" NOT NULL,
geometry geometry(MultiPolygon),
tags hstore,
CONSTRAINT polygons_pk PRIMARY KEY (src_id , src_type )
)
WITH (
OIDS=FALSE
);
create index poly_geometry on polygons using GIST(geometry);
CREATE TABLE building_addresses
(
src_id bigint,
src_type "char",
addr_scheme text,
housenumber text,
street text,
quarter text,
suburb text,
city text,
street_way bigint,
assctd_strt_rel bigint
)
WITH (
OIDS=FALSE
);
CREATE TABLE obj_names
(
obj_name text,
name_tag text,
tag_lang text,
src_id bigint,
src_type character(1)
)
WITH (
OIDS=FALSE
);
CREATE TABLE lang_codes
(
code character(2)
)
WITH (
OIDS=FALSE
);
CREATE INDEX inx_lang_code
ON lang_codes
USING btree
(code COLLATE pg_catalog."default" );