does anybody know if there is a way I can seperate only the crossroad nodes which are included in a .pbf file? Is this clue (if a node is crossroad or not) included in this file's format?
Identify crossroad nodes in openstreetmap data (.pbf)
667 Views Asked by Elizabeth K. At
2
There are 2 best solutions below
0

I'm not aware of a ready-made solution for this task, but it should still be relatively easy to do.
For parsing the .pbf file, I recommend using an existing library like Osmosis or Osmium. That way, you only need to implement the actual semantics of your use case.
The nodes themselves don't have any special attributes that mark them as crossroads. So instead, you will have to look at the ways containing the nodes.
Some considerations when implementing this:
- You need to check the way's tags to find out whether it's a road. The most relevant key for that is highway. The details depend on your specific use case – for example, you need to decide whether footways, forestry tracks, driveways, ... should count.
- What matters is the number of connecting way segments at a node, not the number of ways. For example, a node that is part of two ways may be a crossroads (if at least one of the ways continues beyond that node), or may not (if both ways start/end at that node).
Another option to solve your issue would be to use the new Atlas project.
As part of loading
.osm.pbf
files into in-memory Atlas files, it takes care of doing way sectioning on roads:In the end, each Atlas
Node
which is connected to more than 4Edge
s on a two-way road or 2Edge
s on a one way road would be a candidate if I understand your question correctly.