-
Notifications
You must be signed in to change notification settings - Fork 819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
way_area filtering #1566
Comments
This is a tricky matter and will require some rendering samples. Am i right to assume that your graph includes all areas including those not rendered at the zoom level in question and those rendered with an outline (most notably buildings at the higher zooms)? Size filtering in combination with the AGG polygon rendering and the size dependent gamma manipulation introduces a bias into area rendering, i.e. the acutal fraction of surface areas covered by a certain area type differs significantly from what is shown. Parameters could be tuned to minimize this but unfortunately this also depends a lot on how small grained the mapping is. This is already a problem right now, notice the brighter color of forest areas around http://www.openstreetmap.org/#map=8/52.655/15.614 resulting from the regular grid splitting of the forest mapping there. Such effects would be even stronger when you fully leave out polygons already when they still cover a significant fraction of a pixel. |
using tile 8/138/83, sampling with gimp at pixel 52,16, averaging with a radius of 3. Area highlighted below. I wouldn't advocate going all the way to 1.0, but did it to put something in place at the extreme end of the scale. |
That area obviously does not make any particular difficulties for raising the way_area limit since it contains mostly large forest areas and the tiling is larger than the pixel size at z=8. Areas with many small lakes will usually offer a better test case since they have a more continuous size distribution. In Europe you could try southern Norway or this area in France: http://www.openstreetmap.org/#map=9/46.8423/1.1467 - in North America Newfoundland and Labrador offer a good size distribution of lakes. I also have my doubts about how much performance gain this will actually bring. Water and wood/forest at z=6-8 is the obvious candidate but these zooms do not weigh much in terms of overall rendering ressources i think. Landcovers at z=10-12 might be more relevant but how many polygons of those types actually exist in the <0.1-0.25 pixel range at those zooms? |
The advantage is that it enables use of partial indexes on way_area, which use the first graph. For landcover, it can be approximated by |
That looks more like it - as already hinted the fraction of very small polygons probably varies a lot depending on types - some urban landcovers, in particular leisure/amenity things and water have a lot of very small features while others like wood/farmland do not. For urban stuff a change in threshold will probably have little practical effect since these areas are extremely crowded anyway at these zooms and it is just a subtle change in noise. But i am pretty sure the effect on water areas at z=6-8 will be noticeable even if it is not stronger that the general bias we already have. |
I think we have effectively closed this by #2874. If you think it would be useful to have it opened, feel free to do it. |
Currently low-zoom landcover and water are still filtered at < 0.01 pixel size to z9, while mid-zoom to high zoom landcover (z10 and greater) is filtered at 1 pixel, and inland water areas (natural=water and waterway=riverbank) are filtered at 1 pixel at all zoom levels. Also, above @pnorman had said that "I wouldn't advocate going all the way to 1.0 ... at the extreme end of the scale", yet that's what was implemented. I think this issue should be reopened to discussion. |
Low-zoom waterbodies should be filtered at 0.01 again, same as landcover at <z10. To use indexes efficiently, we could set the filtering to 0.04 at z10 and 0.16 at z11. Thus the filter would be at the same way_area size from z9 to z11. Then z12 could be set to 0.25, or 1/4 of a pixel, if in fact this is a safe limit. As more fine-grained areas of landcover and water are being mapped near the equator, it is likely that many areas will show problems at 0.5 pixels as well. I'm not certain that 0.25 is safe; this requires testing. Hopefully we can find an area with very-well mapped small plots of farmland or forest near the equator? |
Three remarks:
|
Currently we filter by way_area to require some areas to be at least 1% of a pixel with
way_area > 0.01*!pixel_width!::real*!pixel_height!::real
0.01 was chosen as a very conservative value for water rendering problems, and may not be the best value.
It turns out that dropping small areas significantly reduces the number of objects returned by the database at up to medium zooms.
Going from 0.01 to to 0.1 or 0.25 would cut the areas returned by a factor of 3-5 and make partial indexes on area useful two zoom levels sooner.
Data from Europe extract.
The text was updated successfully, but these errors were encountered: