iD icon indicating copy to clipboard operation
iD copied to clipboard

create a 'divide' operation

Open k-yle opened this issue 2 years ago ā€¢ 7 comments

This PR creates a "divide" operation, similar to the JOSM gridify plugin. It lets you divide an area into a grid of smaller areas. This is useful for mapping parking spaces, terraced houses, and camp pitches.

You can try it out here. Select an area and press K.

Closes #6988

https://user-images.githubusercontent.com/16009897/157165940-b2f6e20a-c885-4f74-8814-716f912a6c74.mp4

More Examples
house1 house2
camp1 camp2

Remaining issues:

  • [ ] needs an icon
  • [ ] needs a different shortcut instead of K
  • [ ] Since this operation is only useful for a small number of features it should possibly be hidden by default?

k-yle avatar Mar 08 '22 04:03 k-yle

Nifty, this will tempt me to start nanomapping the individual modules of solar panels. šŸ˜‰

I wonder if it would be possible to replace the two prompts with something more interactive. Perhaps you hit the shortcut key, then move the mouse along the long and short axes to control the number of divisions. Itā€™d be similar to how you can scrub the mouse cursor while rotating a feature, except that this gesture would snap to widths that evenly divide the area. For things like parking spaces, itā€™d be more convenient to eyeball the right width than to count the divisions manually.

Since this operation is only useful for a small number of features it should possibly be hidden by default?

If we expect this operation to be used somewhat less frequently than, say, the merge operation, how about keeping it available in the context menu for all areas but avoid assigning a keyboard shortcut? Itā€™s becoming ever more difficult to assign memorable single-key shortcuts without modifiers, especially in locales that translate them. Currently, operationsā€™ availability depends on the selected geometry type, but it would be more difficult to communicate to the user that this operation depends on certain tags.

1ec5 avatar Mar 08 '22 05:03 1ec5

If we expect this operation to be used somewhat less frequently than, say, the merge operation, how about keeping it available in the context menu for all areas but avoid assigning a keyboard shortcut?

That's a good idea - my concern was also that it will clutter the context menu, which already has 8 items, but maybe that's not a problem...

I wonder if it would be possible to replace the two prompts with something more interactive. Perhaps you hit the shortcut key, then move the mouse along the long and short axes to control the number of divisions.

šŸ‘ I'll give this some thought, another option could be to replace the two prompts with a modal. That modal could have a preview similar to the turn-restriction editor. Both options will be quite complicated.

k-yle avatar Mar 08 '22 21:03 k-yle

Probably out of scope for this PR, but may be worth considering as a follow up: Would be nice if this supported use of custom dividing line (something like: draw way across area, select both, perform divide operation). Useful for things like drawing a footprint and splitting into non-uniform buildings or building parts, or splitting land use to re-tag a section.

kymckay avatar Mar 08 '22 23:03 kymckay

Would be nice if this supported use of custom dividing line (something like: draw way across area, select both, perform divide operation). Useful for things like drawing a footprint and splitting into non-uniform buildings or building parts, or splitting land use to re-tag a section.

Vector drawing tools have a similar operation. It isnā€™t the most discoverable, but it makes a lot of sense once youā€™re made aware of it, similar to how iD supports punching holes in polygons using the merge operation. In that case, you could even hook it up to the split operation, so you can select an area and a line that cuts across it, but donā€™t select a vertex, then split the area along the line. It would be quite outside the scope of this PR, but it might be worth considering how to make the UX for this feature consistent with what might be possible for that other feature.

1ec5 avatar Mar 08 '22 23:03 1ec5

This is looking superb! It'd be nice if it could split based on the bbox instead of the actual nodes, but that can be implemented after this :)

A case where splitting with bbox would be useful: Screenshot 2022-04-01 at 21 26 57

RedAuburn avatar Apr 01 '22 20:04 RedAuburn

It would be nice if we could also do this with ways, for if we know there's windows/doors or extensions along a building wall.

danieldegroot2 avatar Aug 20 '22 17:08 danieldegroot2

It's been 2 years... anything going on?

xnousnow avatar Feb 06 '24 07:02 xnousnow