4

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.

nmtoken
  • 13,355
  • 5
  • 38
  • 87
smellerbee
  • 195
  • 7
  • Possible Terminology Related https://gis.stackexchange.com/questions/99566/what-is-a-pseudonode – Mapperz Apr 13 '18 at 21:27
  • 3
    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 https://github.com/scrosby/OSM-binary/blob/4e32fa236e919be5bb8dbb323437f026f24e5853/src/osmformat.proto has this comment – smellerbee 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 https://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

1 Answers1

5

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

nmtoken
  • 13,355
  • 5
  • 38
  • 87