This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Will way tags always come after way refs?

0

The wiki says nothing about it, as a certainty or uncertainty. Does anybody with field experience know whether way tags will always come after the refs?

asked 16 Jun '15, 20:41

CrazyDave2345's gravatar image

CrazyDave2345
55447
accept rate: 0%


3 Answers:

4

I would suggest not building a parser that depends on a specific order, which shouldn't be an issue in any case. The specifics are likely to be implementation dependent and might and will differ between APIs and the numerous tools that process and provide OSM data.

answered 16 Jun '15, 21:03

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

edited 23 Jun '15, 09:07

2

The osmosis programme has a --sort task that you can use to sort any OSM file into nodes/ways/relations.

answered 23 Jun '15, 08:17

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

0

Depends where you get them from. The files on (say) planet.openstreetmap.org will usually conform to this. However there is no guarantee that this will happen. You might try to use a tool that will produce an XML file in a different manner. So you should be able to handle files with many different orderings.

So to answer your question: No, you cannot rely on that.

answered 17 Jun '15, 08:36

rorym's gravatar image

rorym
5.4k1449100
accept rate: 11%

Source code available on GitHub .