I have a Postgresql database where I want to store nodes that make up ways with highway tags (and nodes with highway tag) - I need the nodes to add elevation to them.
I have an OSM file that I filter over: osmium tags-filter luxembourg-latest.osm.pbf nwr/highway -o highway.osm
Then I tried running: osm2pgsql -d testing -P 5433 --output=flex -S styles/highways.lua highway.osm
where highway.lua is just basic script that is supposed to process all nodes:
local srid = 4326
local tables = {}
-- define table nodes:
tables.nodes = osm2pgsql.define_node_table('nodes', {
-- not_null = true: if invalid node, ignore it
{ column = 'geom', type = 'point', projection=srid, not_null = true },
{ column = 'tags', type = 'jsonb' },
})
function osm2pgsql.process_node(object)
tables.nodes:insert({
geom = object:as_point(),
tags = object.tags,
})
end
But this doesn’t work, it only imports nodes that have highway tag (for Luxembourg it stores 49112 nodes from original 879254 nodes).
Is there something I’m missing in osm2pgsql or it’s just not possible?