Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Parsing issue #5
I am trying to figure out how to use the java parser with a .pbf file from geofafrik.de but I am having a problem getting the nodes correctly. I give the BlockInputStream the file and the parser sends back the HeaderBlock to the header method and such but when the parseDense method gets called with the nodes it does not give me the all the nodes correctly.
when I loop through the list of nodes to get the id, latitude and longitude the very first node is correct but after that it starts giving me numbers that make no sense and are not even in the .pbf file as a node. I can confirm that by using osmconvert to convert the .pbf file to a .osm xml file so I can see what is in the file.
to give you an example of what I mean, the first "node" of each iteration will give me something like this
which would be correct
but the next "node" in the list will be this
which is not correct and never appears in the .osm xml that I can look at. The next time the parseDense method gets called the same thing happens where the first "node" will be correct but everyone after that wont be.
also the parseNodes method never gets called for me only the parseDense method.
Is there something I am doing wrong or some extra steps I have to do to get all of the nodes?
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
I see parseNodes() is called few times while parsing. But I don't get any items inside parseNodes() too. So all nodes data I get from parseDense() calls.
As for values you get in parseDense() - these are not exact values but their offsets from the previous values. So parseDense() supposed to be something like this:
So the question is: why do we need parseNodes at all?