Modify

Opened 8 years ago

Last modified 6 years ago

#3495 new enhancement

Automatic way combining

Reported by: Bürste Owned by: team
Priority: normal Milestone:
Component: Core validator Version: latest
Keywords: way glomming Cc: bilbo, yoshimit@…, joshdoe

Description

It would be a nice function to have a button to combine all ways which could be combined, cause same roles in every of there relation, same tags and in a straight line. This would make removing a relation which split up many ways to parts very easy.

Attachments (0)

Change History (12)

comment:1 Changed 8 years ago by Gubaer

Owner: changed from team to Bürste
Status: newneedinfo

I'm not sure whether I understand what you are proposing. Could you submit it again in german (a user called Bürste must be german, right?)

comment:2 Changed 8 years ago by xeen

It actually quite simple:

Find all connected ways that share (one of) their endpoints and combine them if all tags and roles are equal. In other words: combine all ways that have been split for no reason.

However, if a relation is part of many ways: Just select the relation in the relation dialog (the one that appears on the righthand side) and remove it?

comment:3 Changed 8 years ago by Gubaer

ah, I see, sounds reasonable

comment:4 Changed 8 years ago by bilbo

Cc: bilbo added

comment:5 Changed 8 years ago by Bürste

xeen, thank you for rewriting my idea.

And you're right it's quite easy to remove a relation from the database, but not to clean up after a relation have deleted and if you think of bus routes and other roles like turn restrictions relations will be used more heavily in future. So this function would be nice.

Before we upload a dataset a question if the user want let JOSM search for ways which might be combined and with a nice select-box that JOSM going to search in future for this automatically.

...

is there a way to remove the needinfo status again?

comment:6 Changed 8 years ago by Gubaer

Owner: changed from Bürste to team
Status: needinfonew

is there a way to remove the needinfo status again?

You can select "reassign to" and select "team" as target

comment:7 Changed 8 years ago by bilbo

This could become another test in validator:

Possible algorithm

  • Collect all way endpoint in some map (keys are nodes, values are lists of ways having node as endnode)
  • iterate over map, for each node having:
    • exactly two ways with same keys and membership: offer combining (automatically combinable ways)
    • more than two: can't be combined automatically, but can be reported (manually combinable ways)

For combinable ways, the program should hop to other ends to see if the way can be combined further and if yes, add them to combining and remove these from further iteration.

As a result, you'll get list of automatically combinable ways (pressing fix would combine them) and manually combinable ways.

comment:8 Changed 8 years ago by Bürste

Maybe is the other way round faster, if we got all ways in a fast compareable form we might also compare them first, and then search the endpoints and remove any which doesn't fit.

Addionally it should use existing IDs and if there are more than one it should use the lowest ID.

comment:9 Changed 8 years ago by Claudius

Component: CoreCore validator

comment:10 Changed 7 years ago by Yoshimit

I would like to suggest that not all tags are equal, but the user could inform which tags must be searched as equals and then, if possible, combine the ways.
I have a bunch of data here with too many segments of ways that must be combined, so I'm searching all ways with a particular tag with the same value and calling the combineWaysWorker(Collection<Way> ways) method to do the job. Some of them can't be combined automatically, but save me a lot of time.
The plugin could do something similar.
Thank you.

comment:11 Changed 7 years ago by Yoshimit

Cc: yoshimit@… added

comment:12 Changed 6 years ago by joshdoe

Cc: joshdoe added
Keywords: way glomming added

This is something I've done while preprocessing files. Frederik Ramm made merge-ways.pl for doing this, but I took some C# code from Mike Nice and modified it to avoid combining ways of dual-carriageways (based on the angle) which did a pretty good job. Also, some call this process of combining ways as glomming.

I think this features would be useful in JOSM, and I believe it fits well in with validator.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to Bürste
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.