[OSM-dev] osm2pgsql and only-named multipolygons

Jochen Topf jochen at remote.org
Tue Oct 4 11:30:19 BST 2011

On Tue, Oct 04, 2011 at 11:57:04AM +0200, Frederik Ramm wrote:
> I tend to be against strict rules of any kind but when it comes to
> the question of what exactly a complex relation means I think it
> would be good to have one definition which every tool writer should
> aspire to implement.

Mostly for historical reasons we have in OSM:
* Nodes
* Ways
* Relations

We could have done this differently. Only one kind of object class
called "relation" would be enough:
* Nodes could be written as relation with a lat and lon tag
* Ways could be written as relation with just "node relations" as members

We have other kinds of objects which are modelled as relations but could
have their own object type:
* Areas (multipolygon relations)
* Routes
* Turn restrictions

All of them could have real OSM objects with their own ID space and strict
definitions what goes inside them just like a way has the definition of
having nodes as "members".

I tend to think of a certain type of relations as a "semi-class". Its not
a proper class like "node" and "way", but it is used in a similar way. First
you look at the "type" tag of a relation to get the class, this gives you
a special set of rules or restrictions on how to interpret the relation and
its tags and members. Only then you look at the tags.

So the *structure* (ie which members of what roles are allowed in what order) of
a relation of a certain type should be pretty strict and solid, the *tags* is
where we have the typical OSM flexibility.

Jochen Topf  jochen at remote.org  http://www.remote.org/jochen/  +49-721-388298

More information about the dev mailing list