I can see that DenseNodes are one of the primitive node types (nodes, DenseNodes, ways, relations).

I can understand the rest, but I couldn't figure out what a DenseNode is.

  • Possible Terminology Related gis.stackexchange.com/questions/99566/what-is-a-pseudonode – Mapperz Apr 13 '18 at 21:27
  • 2
    I'm not 100% sure so I won't post an answer, but according to these pages I believe that DenseNodes are just a special type used in the PBF format in order to take less space than regular Nodes. – ArMoraer Apr 14 '18 at 10:45
  • 4
    Where did you read this stuff about nodes, densenodes, ways and relations? Seems incorrect to me. The only primitives in OSM are nodes, ways and relations. "Dense nodes" are an implementation detail used for PBF, they are not part of the OSM data model as such. Some tools like osm2pgsql also use "sparse nodes", which is also an implementation detail to accommodate for different main memory allocation strategies. – mmd Apr 14 '18 at 16:24
  • @mmd I'm going through the code for Open Trip Planner and trying to see if I can implement a functionality to route through scenic routes. One of the library used github.com/scrosby/OSM-binary/blob/… has this comment – Ravi Apr 15 '18 at 11:40
  • 2
    Ok, that library is the original implementation for what is known as .pbf format (protocolbuffer binary format) these days, see wiki.openstreetmap.org/wiki/PBF_Format. More recent libraries like libosmium don't use that implementation anymore for performance reasons and roll their own protozero based parser. – mmd Apr 15 '18 at 12:52

Nodes can be encoded one of two ways, as a Node (defined above) and a special dense format. In the dense format, I store the group 'columnwise', as an array of IDs, array of latitudes, and array of longitudes. Each column is delta-encoded. This reduces header overheads and allows delta-coding to work very effectively.

ref: PBF Format https://wiki.openstreetmap.org/wiki/PBF_Format

  • 5
    In other words, dense nodes are not an OSM data primitive, they're just an efficient way of storing OSM nodes in .pbf format. – Richard Fairhurst Apr 14 '18 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.