diff options
| author | user <user@node5.net> | 2024-05-20 19:51:41 +0200 |
|---|---|---|
| committer | user <user@node5.net> | 2024-05-20 19:51:41 +0200 |
| commit | f0626b175d21230dc68ecd83e2726ec7e7daae5a (patch) | |
| tree | bee47010f3374fd53395f62a9067f4e41762c000 /data_extractor | |
| parent | 4c03c8e4514d40dff2a3736c7f04a89a7e21843a (diff) | |
user input categories, refactor, remove zombie code
Diffstat (limited to 'data_extractor')
| -rw-r--r-- | data_extractor/data_extractor.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/data_extractor/data_extractor.lua b/data_extractor/data_extractor.lua index 4732f3b..5f5cc9e 100644 --- a/data_extractor/data_extractor.lua +++ b/data_extractor/data_extractor.lua @@ -1,5 +1,8 @@ -local shop = osm2pgsql.define_table({ - name = 'shop', +-- Based on: https://osm2pgsql.org/examples/poi-db/ +-- Data: https://download.geofabrik.de/europe/denmark-latest.osm.pbf + +local poi = osm2pgsql.define_table({ + name = 'poi', ids = { type = 'any', type_column = 'osm_type', id_column = 'osm_id' }, columns = { { column = 'name' }, @@ -19,11 +22,14 @@ function process_poi(object, geom) a.class = 'shop' a.subclass = object.tags.shop a.brand = object.tags.brand + elseif object.tags.amenity then + a.class = 'amenity' + a.subclass = object.tags.amenity else return end - shop:insert(a) + poi:insert(a) end function osm2pgsql.process_node(object) |
