20
20
local tables = {}
21
21
22
22
tables .stops = osm2pgsql .define_node_table (' stops' , {
23
- { column = ' tags' , type = ' jsonb' },
23
+ { column = ' tags' , type = ' jsonb' },
24
24
{ column = ' rel_refs' , type = ' text' }, -- for the refs from the relations
25
- { column = ' rel_ids' , sql_type = ' int8[]' }, -- array with integers (for relation IDs)
26
- { column = ' geom' , type = ' point' , not_null = true },
25
+ { column = ' rel_ids' , sql_type = ' int8[]' }, -- array with integers (for relation IDs)
26
+ { column = ' geom' , type = ' point' , not_null = true },
27
27
})
28
28
29
29
tables .lines = osm2pgsql .define_way_table (' lines' , {
30
- { column = ' tags' , type = ' jsonb' },
30
+ { column = ' tags' , type = ' jsonb' },
31
31
{ column = ' rel_refs' , type = ' text' }, -- for the refs from the relations
32
- { column = ' rel_ids' , sql_type = ' int8[]' }, -- array with integers (for relation IDs)
33
- { column = ' geom' , type = ' linestring' , not_null = true },
32
+ { column = ' rel_ids' , sql_type = ' int8[]' }, -- array with integers (for relation IDs)
33
+ { column = ' geom' , type = ' linestring' , not_null = true },
34
34
})
35
35
36
36
-- Tables don't have to have a geometry column
37
37
tables .routes = osm2pgsql .define_relation_table (' routes' , {
38
- { column = ' ref' , type = ' text' },
38
+ { column = ' ref' , type = ' text' },
39
39
{ column = ' type' , type = ' text' },
40
40
{ column = ' from' , type = ' text' },
41
- { column = ' to' , type = ' text' },
41
+ { column = ' to' , type = ' text' },
42
42
{ column = ' tags' , type = ' jsonb' },
43
43
})
44
44
45
45
-- Stop areas contain everything belonging to a specific public transport
46
46
-- stop. We model them here by adding a center point as geometry plus the
47
47
-- radius of a circle that contains everything in that stop.
48
48
tables .stop_areas = osm2pgsql .define_relation_table (' stop_areas' , {
49
- { column = ' tags' , type = ' jsonb' },
49
+ { column = ' tags' , type = ' jsonb' },
50
50
{ column = ' radius' , type = ' real' , not_null = true },
51
- { column = ' geom' , type = ' point' , not_null = true },
51
+ { column = ' geom' , type = ' point' , not_null = true },
52
52
})
53
53
54
54
-- This will be used to store information about relations queryable by member
@@ -61,15 +61,6 @@ tables.stop_areas = osm2pgsql.define_relation_table('stop_areas', {
61
61
local n2r = {}
62
62
local w2r = {}
63
63
64
- local function clean_tags (tags )
65
- tags .odbl = nil
66
- tags .created_by = nil
67
- tags .source = nil
68
- tags [' source:ref' ] = nil
69
-
70
- return next (tags ) == nil
71
- end
72
-
73
64
local function unique_array (array )
74
65
local result = {}
75
66
@@ -128,8 +119,6 @@ function osm2pgsql.process_way(object)
128
119
return
129
120
end
130
121
131
- clean_tags (object .tags )
132
-
133
122
-- Data we will store in the 'lines' table always has the tags from
134
123
-- the way
135
124
local row = {
0 commit comments