Opened 15 years ago

Last modified 4 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


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 (14)

comment:1 by Gubaer, 15 years ago

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 by xeen, 15 years ago

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 by Gubaer, 15 years ago

ah, I see, sounds reasonable

comment:4 by bilbo, 15 years ago

Cc: bilbo added

comment:5 by Bürste, 15 years ago

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 by Gubaer, 15 years ago

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 by bilbo, 15 years ago

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 by Bürste, 15 years ago

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 by Claudius, 15 years ago

Component: CoreCore validator

comment:10 by Yoshimit, 13 years ago

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 by Yoshimit, 13 years ago

Cc: yoshimit@… added

comment:12 by joshdoe, 12 years ago

Cc: joshdoe added
Keywords: way glomming added

This is something I've done while preprocessing files. Frederik Ramm made 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.

comment:13 by skyper, 4 years ago

For new ways with id:0, this might be fine. For ways with positive id at least all parents need to be downloaded first.

comment:14 by GerdP, 4 years ago

I think one should also consider boundaries and residential areas before combining ways. It might be intended that a highway=unclassified is split because the road belongs to a different city or maybe has a different implicit maxspeed value.
For me this is a clear wontfix.

Modify Ticket

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

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.