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

I'm parsing OSM XML data into c#.

I have a weird problem, each node has an id that is a long datatype. When parsing, if the id is 9 or less digits long, it seems to work just fine. However once it reaches 10 digits long, for some reason I start to get negative number from the parsing. Is there a reason for why this might be.

I'm using a library called OSMSharp for parsing. Language is c#.

An example of this: This way has 2 nodes:

way id="313281300" 
nd ref="248877110"
nd ref="3191908562"*

After being parsed, I get this:

way: 313281300

248877110

-1103058734

Could this be a bug from the parsing library, or is it caused by c#?

Thank you in advance

*I made this xml short for ease of read. It's the full xml for the way in the file I'm parsing from

asked 26 Mar '15, 18:17

echoalphapapa's gravatar image

echoalphapapa
417812
accept rate: 0%

edited 26 Mar '15, 18:24


Are you sure you are using the latest version of OSMSharp and long definitions throughout? It looks like it is having problems relayed to http://wiki.openstreetmap.org/wiki/64-bit_Identifiers

permanent link

answered 26 Mar '15, 20:37

EdLoach's gravatar image

EdLoach ♦
19.5k16156280
accept rate: 22%

this might be it actually. The only problem is the newer versions of OSMSharp don't support parsing. I will investigate further. Thanks

(26 Mar '15, 20:52) echoalphapapa

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×84
×25
×19
×6

question asked: 26 Mar '15, 18:17

question was seen: 4,616 times

last updated: 26 Mar '15, 20:52

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