NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi, I'm trying to parse PBF country file and I'm having trouble interpreting node ids. They should be 'delta-encoded', but for each DenseNodes group they go from 0 to 8000. Since there are many DenseNodes groups in the file, this results with many duplicate IDs. If I understood the PBF format description correctly, where it says "x_1, x_2, x_3, I encode x_1, x_2-x_1, x_3-x_2, ...", the first node ID should be a 'real' node id, and the subsequent ones should be delta-encoded.

Can someone shed some light on this?


asked 12 Jan '16, 13:52

zepe's gravatar image

accept rate: 0%

edited 25 Mar '16, 11:19

aseerel4c26's gravatar image

aseerel4c26 ♦

First, you should probably not try to re-invent the wheel and use one of the existing libraries to read PBF files. Getting all the corner cases right isn't as easy as it looks. There are libraries for several languages available. (Shameless plug: if you use C++ I can recommend my libosmium.) If you still want to do your own you can still look at those implementations to help find your problem

Second: Your interpretation is right. I guess your code is doing something different than that.

permanent link

answered 12 Jan '16, 14:15

Jochen%20Topf's gravatar image

Jochen Topf
accept rate: 31%

edited 13 Jan '16, 18:55

mmd's gravatar image


Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 12 Jan '16, 13:52

question was seen: 3,283 times

last updated: 25 Mar '16, 11:19

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum