JOSM / areaselector

JOSM Area Selection Plugin
https://github.com/JOSM/JOSM-areaselector/wiki
18 stars 3 forks source link

Shouldn't Distance tolerance setting be in m or cm? #20

Closed a-pirard closed 7 years ago

a-pirard commented 8 years ago

Shouldn't Distance tolerance setting be in m or cm? In pixels, it depends on zoom factor right? A small multiplication to add to the program. But not so easy to figure pixels for the mapper. In line with the SPW server tuning (other message), I modified tolerance but I could not make much sense out of it. btw, where are the doc improvements you spoke of?

r00tat commented 8 years ago

I thought about making the whole algorithm depending on the zoom level, but I was not really successful on that.

In fact it depends on the zoom and the quality of the images. Therefore also m or cm would not always make it better. Pixels are now used directly by the algorithm, so that's the reason I'm using it there.

If you got some patches I'd like to review and implement them.

You can find the updated docs in the Wiki: https://github.com/JOSM/JOSM-areaselector/wiki

a-pirard commented 8 years ago

On 2015-11-04 22:35, Paul wrote :

I thought about making the whole algorithm depending on the zoom level, but I was not really successful on that.

In fact it depends on the zoom and the quality of the images. Therefore also m or cm would not always make it better. Pixels are now used directly by the algorithm, so that's the reason I'm using it there.

If you got some patches I'd like to review and implement them.

Hi, I've been impressed with the description of the algorithm; more comments later in my other issue.

I'm unable to write a patch, but read this (more a suggestion than a question ;-)) My suggestion is much more simple that what you say (I don't understand much).

At the top left of the JOSM window, there is a scale let's say constant P pixels long. Depending on zoom, the scale also indicates a corresponding varying length in meters, let's say M. The varying zoom is P/M pixels per meter as M varies.

If you use a number of pixels from the "Distance tolerance" DP for your algorithm, then the tolerated distance (in meters) varies according to zoom, isn't it. It is DP/P_M. Now if you use a "Distance tolerance" DM setting in meters, then you can use instead DM/M_P as that (varying) number of pixels for your algorithm. Then the tolerated distance in meters will always be the same DM. Then if a user chooses some value for DM, he will always use the same tolerated distance and, I suppose, see the same result whatever the zoom, isn't it?

In short, specifying the tolerance DM in meters produces a constant physical tolerance while specifying it in pixels DP produces a varying physical tolerance.

Best regards, André.

a-pirard commented 8 years ago

I've just had a thought: Are your computations made using the image that's displayed by JOSM or using the image that's fetched from the server? In the second case, my considerations about the zoom level are, of course, totally irrelevant. However, the suggestion that the tolerance should be in meters rather than in pixels still holds, because meters are more figurable than pixels. The answer to this is necessary to tune AS settings. Please make this ticket a suggestion, not a question.

r00tat commented 8 years ago

I did not forget your issue, I didn't have time lately. I'll try to work on it in the upcoming weeks.

a-pirard commented 7 years ago

As we are deep in the subject with #25, I meant this issue not as a question but as a suggestion. If I'm correct: Distance tolerance setting should be in cm. Because different zooms produce different results, I think that you are working on the zoomed image, not on the server's image. Hence, the tolerance dots numbers must be zoomed too (multiplied by the level) and you must say to which zoom the setting applies. Or the setting should be in cm that need no explanation and that you must convert to the correct dot numbers at each zoom level.