2 more bug fixes in relation handling

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

2 more bug fixes in relation handling

Dirk Stöcker
Hello,

two more fixes:
701 [PATCH] Bug in relation handling splitting up ways
637 [PATCH] JOSM allows duplicate members in relations

These two are very annoying :-)

Ciao
--
http://www.dstoecker.eu/ (PGP key available)

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: 2 more bug fixes in relation handling

Jo-14
Dirk Stöcker schreef:
> Hello,
>
> two more fixes:
> 701 [PATCH] Bug in relation handling splitting up ways
> 637 [PATCH] JOSM allows duplicate members in relations
>
> These two are very annoying :-)
>  
I second that! 637 made me pull my hair out a few times before I
understood what was going on and why I was getting that 500 error. 701
is annoying if you don't realise that you're breaking other people's work.

Polyglot

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: 2 more bug fixes in relation handling

Frederik Ramm
Hi.

> > two more fixes:
> > 701 [PATCH] Bug in relation handling splitting up ways
> > 637 [PATCH] JOSM allows duplicate members in relations
> >
> > These two are very annoying :-)
 
> I second that! 637 made me pull my hair out a few times before I
> understood what was going on and why I was getting that 500 error. 701
> is annoying if you don't realise that you're breaking other people's work.

I will commit 701 because people are using a lot of route relations
nowadays.

BUT:

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.

What JOSM needs to do is detect the type of relation, look it up in
some kind of list and determine what to do exactly.

Bye
Frederik

--
Frederik Ramm  ##  eMail [hidden email]  ##  N49°00'09" E008°23'33"


_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: 2 more bug fixes in relation handling

Jo-14
Frederik Ramm schreef:

> Hi.
>
>  
>>> two more fixes:
>>> 701 [PATCH] Bug in relation handling splitting up ways
>>> 637 [PATCH] JOSM allows duplicate members in relations
>>>
>>> These two are very annoying :-)
>>>      
>  
>  
>> I second that! 637 made me pull my hair out a few times before I
>> understood what was going on and why I was getting that 500 error. 701
>> is annoying if you don't realise that you're breaking other people's work.
>>    
>
> I will commit 701 because people are using a lot of route relations
> nowadays.
>
> BUT:
>
> 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.
>
> What JOSM needs to do is detect the type of relation, look it up in
> some kind of list and determine what to do exactly.
>  
You are right. It's not as straightforward as it seems at first. It's
probably true that more people are using route relations than any other
type of relations. You'll get around to the more intelligent solution
eventually, I'm sure of it.

Would it be very hard to check whether a way is already a member of a
relation before adding it? Or is that also specific to route relations?
i.e. are there other kinds of relations where the same member can appear
multiple times?

Thanks,

Polyglot

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: 2 more bug fixes in relation handling

Dirk Stöcker
On Sat, 28 Jun 2008, Jo wrote:

>>> I second that! 637 made me pull my hair out a few times before I
>>> understood what was going on and why I was getting that 500 error. 701
>>> is annoying if you don't realise that you're breaking other people's work.
>>>
>>
>> I will commit 701 because people are using a lot of route relations
>> nowadays.
>>
>> BUT:
>>
>> 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?

>> What JOSM needs to do is detect the type of relation, look it up in
>> some kind of list and determine what to do exactly.
>>
> You are right. It's not as straightforward as it seems at first. It's
> probably true that more people are using route relations than any other
> type of relations. You'll get around to the more intelligent solution
> eventually, I'm sure of it.

Probably the easiest would be to have the behaviour to copy the relation
to both ways and warn in case of non-route based relations? That would be
easy.

BTW: I will add an easier way to remove ways from relations also soon.

> Would it be very hard to check whether a way is already a member of a
> relation before adding it? Or is that also specific to route relations?
> i.e. are there other kinds of relations where the same member can appear
> multiple times?

According to the discussion on 637 there should be no relations, which
have one member twice.

Ciao
--
http://www.dstoecker.eu/ (PGP key available)

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: 2 more bug fixes in relation handling

Frederik Ramm
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 [hidden email]  ##  N49°00'09" E008°23'33"


_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: 2 more bug fixes in relation handling

Dirk Stöcker
On Sat, 28 Jun 2008, Frederik Ramm wrote:

>>>> 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.

Ah ok. Thanks for the examples.

I would not invest many work hours into that for now, but forward than
until is is really used very often. For now I think a "warning note"
telling you, that a non-route way is splitted should be enough.

Ciao
--
http://www.dstoecker.eu/ (PGP key available)

_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: 2 more bug fixes in relation handling

Frederik Ramm
Hi,

> I would not invest many work hours into that for now, but forward than
> until is is really used very often. For now I think a "warning note"
> telling you, that a non-route way is splitted should be enough.

Yes. We're not Potlatch, we are allowed to have popup dialogs ;-)

Bye
Frederik

--
Frederik Ramm  ##  eMail [hidden email]  ##  N49°00'09" E008°23'33"


_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev
Reply | Threaded
Open this post in threaded view
|

Re: 2 more bug fixes in relation handling

Dirk Stöcker
On Sat, 28 Jun 2008, Frederik Ramm wrote:

>> I would not invest many work hours into that for now, but forward than
>> until is is really used very often. For now I think a "warning note"
>> telling you, that a non-route way is splitted should be enough.
>
> Yes. We're not Potlatch, we are allowed to have popup dialogs ;-)

Attached is a patch for this. I do not base it on the relation type, but
on the fact whether the way has a role or not. I think that should catch
all relevant cases.

Also I abort the member scanning when current member was found.

Ciao
--
http://www.dstoecker.eu/ (PGP key available)
_______________________________________________
josm-dev mailing list
[hidden email]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/josm-dev