forked from mbasa/pgGeocoder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
createTables.sql
81 lines (73 loc) · 1.31 KB
/
createTables.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
create extension postgis;
--
-- for Geocoding
--
create table address_t (
todofuken varchar(60),
lat float,
lon float,
ttable varchar(40),
code varchar(2),
geog geography('POINT')
);
create table address_s (
todofuken varchar(60),
shikuchoson varchar(60),
lat float,
lon float,
code varchar(5),
geog geography('POINT')
);
create table address_o (
todofuken varchar(60),
shikuchoson varchar(60),
ooaza varchar(60),
tr_ooaza varchar(60),
lat float,
lon float,
code varchar(12),
geog geography('POINT')
);
create table address (
todofuken varchar(60),
shikuchoson varchar(60),
ooaza varchar(60),
chiban varchar(60),
lat float,
lon float,
geog geography('POINT')
);
--
-- for Reverse Geocoding
--
create table boundary_t (
todofuken varchar(60),
code varchar(2),
geom geometry('MULTIPOLYGON', 4326)
);
create table boundary_s (
todofuken varchar(60),
shikuchoson varchar(60),
code varchar(5),
geom geometry('MULTIPOLYGON', 4326)
);
create table boundary_o (
todofuken varchar(60),
shikuchoson varchar(60),
ooaza varchar(60),
code varchar(12),
geom geometry('MULTIPOLYGON', 4326)
);
--
-- for Places
--
create table places (
id serial,
owner varchar,
category varchar,
name varchar,
lat float,
lon float,
details jsonb,
geog geography('POINT')
);