Id: Circularize action creates far too many nodes for small objects

Created on 8 Nov 2016  Â·  10Comments  Â·  Source: openstreetmap/iD

Working on a missing maps task in Africa where we are mapping mostly huts with a diameter of perhaps 3-4 meters I've noticed that iD is extremely liberal with the number of nodes it adds (a rough count would indicate around 24) when using the circularize action on such a small object.

The other aspect is that most other editors distinguish between creating a circular way and simply arranging existing way nodes in a circle. The iD function combines both which as said above makes it impossible to create a small circular object with a reasonable number of nodes (for example 6).

question

All 10 comments

Yes this is #2061

OSM isn't running out of nodes anytime soon, so it's no problem to create 20 node circles. Even "small" objects will look big when zoomed in.

But your issue did prompt me to try to create the Smallest Circle In The World. Here's what it looks like at zoom 26:

screenshot 2016-11-08 08 04 12

So, the OSM server truncates lat/lng to some coordinate precision below which it really doesn't make sense to add more nodes. Perhaps we should make our operations aware of this quantum limit, to avoid _really_ creating too many nodes in one place.

No it is not #2061, nobody is arguing against using lots of nodes for larger objects or objects that can be surveyed with high precision. For example I wouldn't have an issue with using 24 nodes for a professionally surveyed manhole cover (were we could easily determine the geometries within mms), but doing the same for roughly traced objects from blurry imagery indicates accuracy that just doesn't exist.

But regardless of the above, as I pointed out, it is the merging of two different functions: arranging existing nodes in a circle and generating a circle that causes the issue in the first place. If they were separated the user would have the option of whatever number of nodes they considered appropriate or using whatever iD thinks is best.

@simonpoole, is #2048 close to what you are asking for? Maybe a better title for that issue would be "inscribe multiple selected points in a circle".

The problem of the circularize function is that it uses a fix number of nodes – 20. That's a good number for a usual roundabout or a circular turnaround in Europe or the US but it is too much for smaller features. See also https://wiki.openstreetmap.org/wiki/Good_practice#Map_bends_with_an_appropriate_number_of_nodes

There are two options to solve this issue. Either you do it like JOSM and only move the nodes without adding/removing nodes or you have a formula which determines an appropriate number of nodes dependent from the radius of the circle. People can discuss a lot about the latter one – whether you use just the the arc distance between two nodes A and B or the deviation h between the secant and the arc between A and B.

sketch

I think that the simple solution is to keep the number of nodes and let the user decide by drawing a rough circle how good he wants to approximate the circle by a polygon.

I'd like to support @Nakaner's proposal and Simon's issue.
I stumbled over this looking at round buildings entered in African areas where many missingmaps / HOT projects are going on. There's now even http://learnosm.org/en/hot-tips/tracing-round-buildings/ promoting using this function / tool.
In OGR there are at least two implementations of arc segmentation: See option "-segmentize"
https://github.com/OSGeo/gdal/search?utf8=%E2%9C%93&q=segmentize . Or see parameter OGR_ARC_STEPSIZE https://github.com/OSGeo/gdal/search?utf8=%E2%9C%93&q=OGR_ARC_STEPSIZE&type=Code .

There are two options to solve this issue.
Either you do it like JOSM and only move the nodes without adding/removing nodes

2048 would handle this. I am imagining that the user could draw their points and then multiselect them all as points and circularizes them like that (instead of as a way).

or you have a formula which determines an appropriate number of nodes dependent from the radius of the circle.

I'm wary of this because whatever formula we come up with would be weird at certain zooms. At high zooms you might end up with an octogon or something, and there are plenty of places with high resolution orthoimagery where you can reasonably trace small structures with precision.

Also, I'm pretty sure my users do not want a configuration option to choose the number of nodes in a circle. I think we could make some rule to not add more than some-N points per sq meter or something. Or I could do nothing and hope somebody makes a "regular polygon" drawing plugin someday.

Honestly, I'm surprised people care so much about this issue. There are so many other things that we could improve in iD that would make editing better for new users.

I've been tempted to accuse a mapper of bulk import after he added just few round small huts - just because of the abundance of this 20 points been generated with one click.

@sfkeller wrote:

I've been tempted to accuse a mapper of bulk import after he added just few round small huts - just because of the abundance of this 20 points been generated with one click.

Something similar happened with me. I found a changeset which was flagged as "possible import" [1] by OSMcha as it happens often with HOT mappers drawing lots of buildings. Usually they use changeset comments which clearly state that they are HOT mappers and no importers. I looked at that changeset and thought: "Well, this hut has a little bit too much nodes, hasn't it?" That's why I wrote a message and later investigated that the tool is imperfect, not its user.

@bhousel wrote:

2048 would handle this. I am imagining that the user could draw their points and then multiselect them all as points and circularizes them like that (instead of as a way).

Doing a multiselect on every round hut you draw is a little bit too laborious, isn't it? I suggest to improve the implementation of the feature. In addition, multisections are dangerous because if people forgot what they selected, strange and unexpected things may happen.

JOSM circularize tool works both with exactly one selected way or a selection of at least four of nodes.

@bhousel wrote:

Honestly, I'm surprised people care so much about this issue. There are so many other things that we could improve in iD that would make editing better for new users.

Experienced mappers care for the data. :-)

[1] I usually add a filter min_additions>800 to reduce the number of false positives.

I reviewed the hut linked to above, and it seems fine to me.
Closing this issue as the appropriate number of nodes in a circle is a silly thing to argue over.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

skylerbunny picture skylerbunny  Â·  22Comments

simonpoole picture simonpoole  Â·  55Comments

jidanni picture jidanni  Â·  19Comments

bhousel picture bhousel  Â·  21Comments

bhousel picture bhousel  Â·  19Comments