[josm-dev] 2 more bug fixes in relation handling

Frederik Ramm frederik at remote.org
Sat Jun 28 10:33:51 BST 2008


Hi,

> >> The new behaviour is only valid for *some* kinds of relations. Imagine
> >> for example a turn restriction - here it is absolutely wrong to make
> >> both parts of the split way part of the relation.
> 
> This I don't understand at all. For me the relation concept says xxx is a 
> certain type. Now when I break xxx into two parts, why should that change?

No, relations are not about types, relations describe a relationship
between two objects.

One example is the turn restriction. You have an intersection (Node X) 
where three ways meet (ways A, B, C). Assume it is not allowed to 
turn into C when you are coming from A. The turn restriction relation
would look like this:

tags:
   type=turn_restriction

members:
   way "A" with role="from"
   way "C" with role="to"
   node "X" with role="at"

The turn restriction says that you are not allowed to go "to" "C" when
you come "from" "A". (The exact words used for the roles I'm not 100%
sure but that doesn't matter for this example.)

If you split way A in two, then only ONE part of way A actually touches
node X; the other part is far away from the intersection and has nothing
to do with this turn restriction.

Another example could be a "way uses bridge" relations. Assume you have
an area way "A" that describes the outline of a bridge, and a road way
"B" that leads over the bridge. The relation could look like this:

tags:
   type=bridge

mebmers:
   way "A" with role="bridge"
   way "B" with role="above"

(again, this is not set in stone yet regarding the member roles but the
example should be clear).

Again, if you split way "B", then it is very likely that only one of the
two parts will lead over the bridge, and the other part must not be made
a member of this relation.


For JOSM, in some cases it could probably be determined automatically
what to do (like in the turn restriction or route relation case), while 
in others we'll have to show a popup to the user asking him what he 
wants to do with the relation.


I was hoping to have a type-aware relation editor some time, i.e. not
the crude and primitive one we have now, but something that detects the
type of relation and works accordingly. An editor for a route relation,
for example, would make sure that only ways are added and nothing else,
and would make adding and removing them extra easy, maybe even giving
them a "halo" on the map display. An editor for a turn restriction 
relation would be more like a multi-step "wizard" that asks the user to
identify the various members one after the other... or something like
that.

Bye
Frederik

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





More information about the josm-dev mailing list