[OSM-dev] Order of closed ways?

Frederik Ramm frederik at remote.org
Thu Sep 11 21:39:23 BST 2008


Hi,

> Are these ordered in a certain way? E.g. is a polygon (or closed way to be precise) completely
> being inside another one stored before or after this other polygon in a .osm file? 

Normally, an .osm file has nodes, then ways, then relations, in 
ascending id order. But that's not even guaranteed.

There is certainly no ordering of "outside polygons first" or so.

> Or is there no given order
> at all? I need to know this to find a way to select them. E.g. if the embedded polygon is being 
> drawn first, then clicking it will select the "outer" polygon which has been drawn later and is thus
> "on top".

You will probably need "z-ordering" in your editor. Some objects have 
explicit layer tags specifying their z-order. Polygons with holes have 
relations to link the inner rings to the outer ring. Everything else is 
at the discretion of the renderer.

Bye
Frederik

-- 
Frederik Ramm  ##  eMail frederik at remote.org  ##  N49°00'09" E008°23'33"




More information about the dev mailing list