Opened 4 years ago
Last modified 15 months ago
#21449 new enhancement
Replace relations/multipolygons
Reported by: | nkamapper | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Plugin utilsplugin2 | Version: | |
Keywords: | Cc: |
Description
It would be very efficient to have support for replacing one relation with a new one. The typical use case is when importing data which contains many multipolygons, for example buildings or nature reserves, which needs to be conflated with existing multipolygons in OSM. In this situation, I would like the existing multipolygon to be updated not only with members of the import relation, but also with the tags of the relation. And then for the import relation to be deleted.
There is already support for updating members of relations with the "Update multipolygon" function, but not for the tags of the relations. The "Past tags for previous selection" function could have been used, but it is very difficult to get the order right between the two relations.
The new functionality could be added as an extension of the "Update multipolygon" function or as an extension of the "Replace geometry" function.
I sometimes have hundres of multipolygons to replace, so this would certainly be a helpful enhancement.
Attachments (0)
Change History (9)
comment:1 by , 4 years ago
Component: | Core → Plugin utilsplugin2 |
---|
comment:2 by , 4 years ago
Owner: | changed from | to
---|---|
Status: | new → needinfo |
It already works with the utilsplugin2 feature, no?
comment:3 by , 4 years ago
No, ReplaceGeometry does not work with a relation as original/target. Replacing a multipolygon with another one or a route relation with a new one does not work, atm.
comment:4 by , 4 years ago
Owner: | changed from | to
---|---|
Status: | needinfo → new |
comment:5 by , 4 years ago
Seems natural that it should work, but no, it does not work. So no way to replace a multipolygon/relation. And the manual workaround is tedious :)
comment:6 by , 4 years ago
Replying to nkamapper:
It would be very efficient to have support for replacing one relation with a new one. The typical use case is when importing data which contains many multipolygons, for example buildings or nature reserves, which needs to be conflated with existing multipolygons in OSM. In this situation, I would like the existing multipolygon to be updated not only with members of the import relation, but also with the tags of the relation. And then for the import relation to be deleted.
There is already support for updating members of relations with the "Update multipolygon" function, but not for the tags of the relations. The "Past tags for previous selection" function could have been used, but it is very difficult to get the order right between the two relations.
Here is my workflow:
- Select both relation in relation list
- Open relation editor for both
- Delete all members in old relation
- Select (all) members in new relation and "select objects of selected reletions members"
- Add all selected objects to old relation
- repeat last two steps for each role or adjust roles, see below.
- Close the relation editors
- Select new relation and copy to buffer (
Ctrl+C
) and delete the relation - Select old relation and paste tags (
Ctrl+Shift+V
)- I copy the tags at last, cause it is harder to distinguish the different relations if they have the identical tags
For MPs this works but the roles are not keep, so have to repeat step 4. and 5. for each role.
For Route relations it is similar
For PTv2 this works but not if a member is listed multiple times in the member list and again the roles for stops are not kept like platform_exit_only
.
The new functionality could be added as an extension of the "Update multipolygon" function or as an extension of the "Replace geometry" function.
I prefer it as extension of Replace Geometry as I am interested in all relations and not just MPs and boundaries.
I sometimes have hundres of multipolygons to replace, so this would certainly be a helpful enhancement.
Yes, it needs quite some effort and conflation plugin relies on Replace Geometry and does not help.
comment:7 by , 4 years ago
Summary: | Replace tags of relations/multipolygons → Replace relations/multipolygons |
---|
comment:8 by , 3 years ago
I agree that an extension of Replace Geometry would be the preferred solution. A crude implementation would be ok, despite manual fixes needed for relation members afterwards, because it would still save a considerable amount of work.
comment:9 by , 15 months ago
A very simple fix would be to just swap the id's of two relations. The new relation would then get the id of the old relation, which finally could be deleted.
@nkamapper: Replace geometry is actually part of utilsplugin2. There is an open ticket to move it into JOSM core (see #8821 ).
That being said, it would be a useful enhancement.