[OSM-dev] deleting nodes/ways that are members of relations

Frederik Ramm frederik at remote.org
Mon May 12 09:34:13 BST 2008


Hi,

> To consolidate these a bit, might it make sense to take a 'force
> deletion' parameter in the API which says 'delete this node from any way
> which it is a member of and remove it from any relations which it is a
> member of'?

Firmly against.

We have always tried to keep the API as dumb as possible. Referential 
integrity is something we had to do; but at least with relations, the 
editor MUST know what it is doing, and MUST make an informed choice 
about whether the relation in question can retain its meaning after the 
way is deleted.

For example, if you delete a way from a turn restriction relation, the 
turn restriction is most likely rendered useless and the editor should 
then delete it together with the way.

If, on the other hand, you delete a way from a route relation, then that 
doesn't invalidate the rest of the route.

The API cannot be expected to know these semantics; the editor can. (Our 
editors don't currently but they could, and in the mean time they must 
pass the bucket on to the users.)

Blindly removing parts from a relation without understanding the 
relation is something that no component should ever do; when in doubt, 
ask the human sitting at the machine, and if that human doesn't know 
either then please don't delete it.

The current method - reject deletion if referenced by releation - is the 
only proper way for the API to deal with this, short of building a full 
tag semantics engine into the API.

Bye
Frederik





More information about the dev mailing list