Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operations: merge #435

Open
tmcw opened this issue Jan 18, 2013 · 21 comments
Open

Operations: merge #435

tmcw opened this issue Jan 18, 2013 · 21 comments
Assignees
Labels
operation An editing operation / edit menu item

Comments

@tmcw
Copy link
Contributor

tmcw commented Jan 18, 2013

This should be a 'unified merge' I think, which works for (uses different algorithms) for lines & for areas, but has the same UI.

@jfirebaugh
Copy link
Member

This would be awesome. Also, it should work for merging a point and an area (just merges the point tags to the area).

@tmcw
Copy link
Contributor Author

tmcw commented Jan 24, 2013

Looking for options here. geoscript-js is written in java. jsts is big (90KB) https://github.com/bjornharrtell/jsts (why oh why do people write geo javascript in eclipse) spatial_query might be a good place to reference the algo.

@jfirebaugh
Copy link
Member

I guess we were thinking on different lines about how this would work. I thought it would be something like, if the selection is:

  • Multiple lines, linearly connected -> join then
  • Multiple areas -> convert to a multipolygon, merging tags
  • Point and area -> merge point tags to area, delete point
  • Otherwise -> disabled

jfirebaugh added a commit that referenced this issue Feb 1, 2013
It's currently limited to merging (joining) exactly two lines.

Fixes #370.
@ghost ghost assigned jfirebaugh Feb 6, 2013
@jfirebaugh
Copy link
Member

@springmeyer pointed me to http://www.angusj.com/delphi/clipper.php, and from there I found http://sourceforge.net/projects/jsclipper/. Currently looking at stripping out 99% of the code from that.

@yvecai
Copy link
Contributor

yvecai commented Feb 21, 2013

Merging ways mess up the tags: concatenating tags with ; is not the solution.
Actually, maybe you could merge a way with tags to another way without. But does somebody need to merge ways at all ?
Node fusion is probably more than enough to merge ways.

@jfirebaugh
Copy link
Member

@yvecai Merging ways is pretty important. Ways that should be contiguous are often found to be disconnected, for a variety of reasons, and merging them is often the first step to doing further cleanup. For an extreme example, check out what happened with the TIGER import in Hawaii: just about every road is in multiple (sometimes hundreds of) pieces. I'd hate to have to do cleanup there without being able to merge them.

Could you elaborate on the problems with semicolon concatenation and any solutions you see?

@systemed
Copy link
Contributor

P2's (imperfect but good enough) solution is a little warning triangle and red text whenever it finds a tag containing a semicolon, absent a list of keys where it's ok.

@yvecai
Copy link
Contributor

yvecai commented Feb 26, 2013

@jfirebaugh, I was never exposed to Tiger data, but I don't doubt that in that case merging is useful.
However it's still a particular case and I'm not comfortable with a merging tool just a clic away.
The semicolon is expressed as a separator in the wiki, but with some caution. And to my knowledge it is not that much taken into account by data consumers (at all?).
P2's warning is imperfect in the sense that some users don't dare to use a semicolon even if its good practise (example: piste:type=classic;skating).

I would say that adding manually a semicolon should not trigger a red sign (at least not more than a new and un-documented value).
But definitely, a merge operation should be guided to reconciliate tags, probably with a reconciliation interface of some kind (keep right, keep left, keep both with a semicolon).

I'm not sure if it really fit ID's target, nor if it the good stage to go that deep.

@tmcw
Copy link
Contributor Author

tmcw commented Mar 5, 2013

@jfirebaugh A lot has moved here. What's left?

@jfirebaugh
Copy link
Member

Main things:

  • Multiple non-intersecting areas -> convert to a multipolygon, merging tags
  • Intersecting areas -> union

I'm hoping that d3/d3-plugins gets a polygon union algorithm we can use for this. Cleaning up jsclipper was not looking fun.

I'll move the questions about a tag reconciliation UI to a separate issue.

@pnorman
Copy link
Contributor

pnorman commented Mar 8, 2013

I'm sceptical about merging non-intersecting areas. Data consumers will tend to break these MPs down into separate areas and I think they'll only add confusing when the MP model is abstracted away.

@homersimpsons
Copy link
Contributor

Sorry for #3074 didn't find this tread when research...
I hope this will exist, in France a lot of building are extracted from 'cadastre' (government map) but there are a lot of buildings composed of multiple area like here (google maps) , I have corrected this in OSM [I kept some fragments because I'm not there to check if it's really one building or differents ones]. But it's ugly and constitute a lack of space. This tool could be apply on 70% of multiple area I think, so this would be really usefull.
Another helpfull tool could be split (from 2 non consecutive points of an area) in 2 area, this is usefull when mapping adress a group of building.

@egonzale
Copy link

Hi, I think this is the right place to mention a problem we had yesterday.
Mapping riverbanks as indicated in wiki, we make them by sections, so we draw polygons that have a common border where they continue (see example here ).
Problem is that if you select them and merge them (using the + symbol), it merges "ways" instead of "area" which is what you would expect... mergin these areas as ways simply breaks it all (you can test in iD and then try to make some sense of it in JOSM...)
Would it make sense to change the algorithm when two areas are selected (and have a common border) they are merged into one single area? Does it make sense?
As reference, the action currently implemented in the + symbol seems to do the same as in JOSM Tools>Combine ways ... the one I would expect is JOSM Tools>Join overlaping areas

@homersimpsons
Copy link
Contributor

@egonzale This is exactly what I was asking for in my previous answer :) Hope this will be realised.

@bhousel
Copy link
Member

bhousel commented Dec 13, 2016

Hi @egonzale and @homersimpsons, yes I'd really like to see iD have an area merge tool. Ideally my plan is to bring in turf's polygonal operations like turf-union, turf-difference, turf-intersect after they finish removing the JSTS dependency, see Turfjs/turf#88

This is something that the Turf team could use help with and would benefit not just iD but a lot of projects. Maybe someone whose skills lie at the intersection of JavaScript and computational geometry could move this across the finish line (paging dr. @paulmach?).

@EdLoach
Copy link

EdLoach commented Dec 13, 2019

If there is a more relevant open issue I've not found it, but apparently it is possible to merge a split roundabout back into a single way without even a warning about the 132 route relations that pass through the roundabout. Edit: Or at least didn't warn in May 2019 now I've checked the date of the changeset.

@quincylvania
Copy link
Collaborator

@EdLoach That sounds like something more specific than this. Feel free to open a new issue for it.

@Filip10
Copy link

Filip10 commented Nov 3, 2022

Are there some news about merging two areas into one area (not multipolygon)?

A lot of people are making not needed multipolygons instead of one area.

Maybe recommend them using JOSM and function "Join overplapping areas" (Shift+J)? ;)

@dbdean
Copy link

dbdean commented Nov 4, 2022

I agree with @Filip10's comments. I wanted to merge two adjacent shops recently that had been combined into one (in the real world), and it took me a while to realise it was creating a multipolygon. I would have expected it to just join the two areas. I ended up having to go and do it in JOSM.

@Binnette
Copy link

Are there some news about merging two areas into one area (not multipolygon)?

A lot of people are making not needed multipolygons instead of one area.

Maybe recommend them using JOSM and function "Join overplapping areas" (Shift+J)? ;)

Same here. I would love to see an option to "really merge two areas" and not create a multipolygon with them.

I am pretty sure it was working "correctly" before in ideditor. This feature is really essential for me.

Have a nice day 👍

@RedAuburn
Copy link

what is needed for this to be implemented? it's a really sorely missing feature imo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
operation An editing operation / edit menu item
Projects
None yet
Development

No branches or pull requests