GoMap icon indicating copy to clipboard operation
GoMap copied to clipboard

When rectangularizing a way, preserve right angles when possible.

Open Beakerboy opened this issue 3 years ago • 3 comments

When making a building with parts, if you draw an outline and rectangularize it, then say, draw a line across the object to make a building part, you’re obviously not going to make a perfect rectangle by hand. Two angles will be shared with the outer wall and be fine though. If you select this inner way and rectangularize it, all the points move.

The algorithm should iterate along the outer wall first and preserve as many 90° and 180° angle in a row, that it can.

Another example of this frustration, there is a strip mall, I create a rectangle for one store. With this, I could extend the store and maintain the shape by adding three lines to make it longer. You would draw the new lines, join to the existing way with existing 90° angles, and those points would not move, just the new ones would shift to extend the rectangle.

Besides this, I love the app! Since you removed 3D visualization, I’ve started my own: Petronas Towers GitHub repo

Beakerboy avatar Mar 31 '22 11:03 Beakerboy

Does iD or JOSM handle this situation better? If so I can take a look at the algorithm they use.

bryceco avatar Apr 16 '22 00:04 bryceco

I’ve not used either of them extensively. The way I would do it is iterate along the nodes and if the angle is already 90°, or attached to one that is, do not move it. Otherwise move the point the least amount possible to place it on a line orthogonal to the previous line.

Beakerboy avatar Apr 16 '22 00:04 Beakerboy

I would like to add that there are more cases to indoor mapping when preservation of right angles is needed. For example, attaching a hand drawn parking lot to an already rectangulazied building.

euf avatar Apr 09 '23 20:04 euf