iD icon indicating copy to clipboard operation
iD copied to clipboard

Create a way to snap new nodes on ways to existing node positions and select angles

Open WillPittenger opened this issue 12 years ago • 1 comments

The orthogonal tool comes in handy but has limitations as noted below:

  • It only works on areas and closed lines. Lines that aren't closed won't show the tool's button.
  • It has problems when two adjacent nodes are within a few pixels of one another. This is because the current version, from what I heard, only processes nodes where the angle changes only 7°. When two nodes are too close together, it is extremely difficult to get it within 7°.
  • There is no ability to line up part of the way with nodes in adjacent ways. This is handy for situations where you have a fence turning a corner and you want that corner to line up with the corner of a building.
  • It can be almost impossible to keep two areas that share adjacent common nodes both square. Suppose you have a duplex. The current guidelines call for both units to get their own building=house areas. But it it tough, or even impossible, to make both of them orthogonal.

My solution is to use snapping while the ways are being drawn in the first place. This would be similar to drawing lines in a drawing program where you can snap to a grid or snap to select angles. Some notes below:

  1. Unless you hold down a modifier key while create a node, iD would behave as it does now.
  2. If you hold down Shift (in my example anyway) and this is at least the second node in the way, iD would snap to the nearest 45° angle from the previous node.
  3. If you hold down Control (in my example anyway), iD would look for a previous node and attempt to identify a distance in the direction you are moving. It would place the new node there.
  4. If you hold down Alt (in my example anyway) and Shift, iD would behave as in 1, except the snap angle would be 15°.
  5. If you hold down Alt and Control, iD would behave as in 2, but iD would also consider nodes in nearby ways. (Something close enough to be on the same city lot.)
  6. If you hold down Shift and Control, iD would use both snapping methods as described in 1 and 2.
  7. If you hold down all three modifier keys, iD would use both snapping methods as described in 4 and 5.

I delayed filing this because I wanted to carefully consider how this would work. There may be some issues here, especially with the distance snapping. Getting that to work might be a challenge. I don't envy the devs there. Plus, the last node in a closed way might be an issue with angle snapping. The existing orthogonal tool has an advantage there.

As for the duplex, I have a tip there if the angle snapping is in play. Start with snapping the first unit. For the second unit, do as many of the common nodes first. Those will automatically be square. Then snap the remaining nodes as you can.

WillPittenger avatar Nov 05 '13 09:11 WillPittenger

[The orthogonal tool] only works on areas and closed lines. Lines that aren't closed won't show the tool's button.

Only on connected lines image

It has problems when two adjacent nodes are within a few pixels of one another. This is because the current version, from what I heard, only processes nodes where the angle changes only 7°. When two nodes are too close together, it is extremely difficult to get it within 7°.

The validator should give a warning if nodes are too close together. It is true however that there are some limitations.

There is no ability to line up part of the way with nodes in adjacent ways. This is handy for situations where you have a fence turning a corner and you want that corner to line up with the corner of a building.

Related #1931 / #9001 being tracked in #2987

It can be almost impossible to keep two areas that share adjacent common nodes both square. Suppose you have a duplex. The current guidelines call for both units to get their own building=house areas. But it it tough, or even impossible, to make both of them orthogonal.

Duplicate of #6226

danieldegroot2 avatar Aug 23 '24 15:08 danieldegroot2