-
I have tried to simply dump every node into a single table called function osm2pgsql.process_node(object)
nodes:insert({
tags = object.tags,
geom = object:as_point()
})
end It seems that it only inserts a feature if it has at least one tag. I want to get every node with its id, even if it has no tags. Is this possible? I did not see anything about this in the docs. A slightly related question is if I am able to insert the first and last nodes from every linestring, even if they have no tags? It seems that I can get the nodes of a linestring with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You need the -x, --extra-attributes option to also get the non-tagged nodes, ways, and relations. But we aware that there are two orders of magnitude more untagged nodes than tagged nodes, so this will take a while. There is currently no way to access the individual point geometries for way nodes. You'd have to use some trick like importing the linestring and using a trigger in the database to get the points from the linestring. Or, if you have a table with all nodes anyway, get them from there later. Lastly here is a suggestion: Use the middle tables which osm2pgsql will create for you in |
Beta Was this translation helpful? Give feedback.
You need the -x, --extra-attributes option to also get the non-tagged nodes, ways, and relations. But we aware that there are two orders of magnitude more untagged nodes than tagged nodes, so this will take a while.
There is currently no way to access the individual point geometries for way nodes. You'd have to use some trick like importing the linestring and using a trigger in the database to get the points from the linestring. Or, if you have a table with all nodes anyway, get them from there later.
Lastly here is a suggestion: Use the middle tables which osm2pgsql will create for you in
--slim
mode instead of your nodes table. It will not have a geometry column, but lat/lon columns. Bu…