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

In OSM XML, are the attributes of the elements (node, way, nd) always presented in the same order?

For example is it always the case that the attributes of element node come in this order: id=".." lat=".." lon=".."

asked 04 Feb '13, 19:08

Sadeer's gravatar image

Sadeer
1768914
accept rate: 0%

(just in case you haven't already seen it):

http://wiki.openstreetmap.org/wiki/XML#Assumptions

(04 Feb '13, 19:27) SomeoneElse ♦
1

I saw the assumptions sections but it didn't mention anything on the attributes order of an element.

(04 Feb '13, 19:49) Sadeer

No. The rails port issues the attributes in a specific order but that is an implementation detail and not guaranteed. The /map call, the /node /way /relation calls, and the planet file are all produced by different pieces of software and might differ.

If you're doing some sort of quick hack though, you can assume that the order you get your attributes in today will still be the order you get your attributes in tomorrow. That assumption is probably right 99.9% of the time ;)

permanent link

answered 04 Feb '13, 19:25

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Your answer
toggle preview

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:

×710
×84
×22

question asked: 04 Feb '13, 19:08

question was seen: 3,445 times

last updated: 04 Feb '13, 19:49

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