|
5 | 5 |
|
6 | 6 | local math = require('math') |
7 | 7 |
|
8 | | -local _define_table_impl = function (_type, _name, _columns) |
9 | | - return osm2pgsql.define_table{ |
10 | | - name = _name, |
11 | | - ids = { type = _type, id_column = _type .. '_id' }, |
12 | | - columns = _columns, |
13 | | - } |
| 8 | +local _define_table_impl = function(_type, _name, _columns, _options) |
| 9 | + _options = _options or {} |
| 10 | + _options.name = _name |
| 11 | + _options.ids = { type = _type, id_column = _type .. '_id' } |
| 12 | + _options.columns = _columns |
| 13 | + return osm2pgsql.define_table(_options) |
14 | 14 | end |
15 | 15 |
|
16 | | -function osm2pgsql.define_node_table(_name, _columns) |
17 | | - return _define_table_impl('node', _name, _columns) |
| 16 | +function osm2pgsql.define_node_table(_name, _columns, _options) |
| 17 | + return _define_table_impl('node', _name, _columns, _options) |
18 | 18 | end |
19 | 19 |
|
20 | | -function osm2pgsql.define_way_table(_name, _columns) |
21 | | - return _define_table_impl('way', _name, _columns) |
| 20 | +function osm2pgsql.define_way_table(_name, _columns, _options) |
| 21 | + return _define_table_impl('way', _name, _columns, _options) |
22 | 22 | end |
23 | 23 |
|
24 | | -function osm2pgsql.define_relation_table(_name, _columns) |
25 | | - return _define_table_impl('relation', _name, _columns) |
| 24 | +function osm2pgsql.define_relation_table(_name, _columns, _options) |
| 25 | + return _define_table_impl('relation', _name, _columns, _options) |
26 | 26 | end |
27 | 27 |
|
28 | | -function osm2pgsql.define_area_table(_name, _columns) |
29 | | - return _define_table_impl('area', _name, _columns) |
| 28 | +function osm2pgsql.define_area_table(_name, _columns, _options) |
| 29 | + return _define_table_impl('area', _name, _columns, _options) |
30 | 30 | end |
31 | 31 |
|
32 | 32 | function osm2pgsql.mark_way(id) |
|
0 commit comments