|
| 1 | + |
| 2 | +local points = osm2pgsql.define_node_table('osm2pgsql_test_points', { |
| 3 | + { column = 'tags', type = 'hstore' }, |
| 4 | + { column = 'min_x', type = 'real' }, |
| 5 | + { column = 'min_y', type = 'real' }, |
| 6 | + { column = 'max_x', type = 'real' }, |
| 7 | + { column = 'max_y', type = 'real' }, |
| 8 | + { column = 'geom', type = 'point' }, |
| 9 | +}) |
| 10 | + |
| 11 | +local highways = osm2pgsql.define_way_table('osm2pgsql_test_highways', { |
| 12 | + { column = 'tags', type = 'hstore' }, |
| 13 | + { column = 'min_x', type = 'real' }, |
| 14 | + { column = 'min_y', type = 'real' }, |
| 15 | + { column = 'max_x', type = 'real' }, |
| 16 | + { column = 'max_y', type = 'real' }, |
| 17 | + { column = 'geom', type = 'linestring' }, |
| 18 | +}) |
| 19 | + |
| 20 | +function osm2pgsql.process_node(object) |
| 21 | + local row = { |
| 22 | + tags = object.tags, |
| 23 | + } |
| 24 | + |
| 25 | + row.min_x, row.min_y, row.max_x, row.max_y = object:get_bbox() |
| 26 | + |
| 27 | + points:add_row(row) |
| 28 | +end |
| 29 | + |
| 30 | +function osm2pgsql.process_way(object) |
| 31 | + local row = { |
| 32 | + tags = object.tags, |
| 33 | + geom = { create = 'line' } |
| 34 | + } |
| 35 | + |
| 36 | + row.min_x, row.min_y, row.max_x, row.max_y = object:get_bbox() |
| 37 | + |
| 38 | + highways:add_row(row) |
| 39 | +end |
| 40 | + |
0 commit comments