Skip to content
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 conditions for all ST_PointOnSurface layers #4042

Merged
merged 2 commits into from
Mar 3, 2020

Conversation

pnorman
Copy link
Collaborator

@pnorman pnorman commented Feb 26, 2020

Fixes #4030

I used 768000 for POIs, which is about 12 tiles, and 4000000, which is about 64 tiles for cases like countries where we want to show larger objects.

@pnorman pnorman changed the title Pixel size way_area conditions for all ST_PointOnSurface layers Feb 26, 2020
@imagico
Copy link
Collaborator

imagico commented Feb 26, 2020

I am strictly against introducing a lower (starting) way_area limit for features where there is no visual feedback on the geometry - in this case place=square.

Regarding changing way_area > 1*!pixel_width!::real*!pixel_height!::real - i am not sure this is a good idea. This limit had been introduced as arbitrary limit based on the cargo culted assumption that the threshold of one pixel in rendering has somehow a magic significance. Promoting this to a scale independent limit would make it even more baseless. What should be done here is to get rid of this arbitrary and distorting limit in the first place - a matter that i have discussed at length in the past (see #3273 for the most recent collection of references).

In the single case of the 0.01*!pixel_width!::real*!pixel_height!::real - that should definitely stay tied to the rendering resolution because the reasoning behind that limit is connected to the actual pixel size of the rendering, see also #1566.

@pnorman
Copy link
Collaborator Author

pnorman commented Feb 26, 2020

I am strictly against introducing a lower (starting) way_area limit for features where there is no visual feedback on the geometry - in this case place=square.

I am not introducing it - it already exists:

openstreetmap-carto/roads.mss

Lines 3307 to 3309 in e7de1cd

#roads-area-text-name {
[way_pixels > 3000],
[zoom >= 17] {

For the other limits, I believe it is important that the feature selection and queries are the same independent of scale factor. If you want to get rid of the limit, that belongs in a different PR.

@imagico
Copy link
Collaborator

imagico commented Feb 26, 2020

I am not introducing it - it already exists:

Ah, sorry. See #4043.

For the other limits, I believe it is important that the feature selection and queries are the same independent of scale factor.

Well - as explained the reasoning behind these limits is not independent of the scale factor.

Copy link
Collaborator

@jeisenbe jeisenbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I support most of these changes, but would like to keep using pixel_width/pixel_height for the 1 pixel and sub-pixel rendering layers, where the limit is supposed to represent polygons which are too small to affect the final rendering. This depends on rendering resolution, so scale_denominator would not be the best idea.

project.mml Outdated Show resolved Hide resolved
project.mml Outdated Show resolved Hide resolved
project.mml Show resolved Hide resolved
project.mml Show resolved Hide resolved
@jeisenbe jeisenbe mentioned this pull request Mar 2, 2020
!pixel_height! and !pixel_width! do not work for area-based filtering
when using high dpi rendering. Instead, !scale_denominator! needs to
be used.
We don't want to display points for giant polygons, both because
it's bad cartographically and because it hurts performance.
Copy link
Collaborator

@jeisenbe jeisenbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks fine, though I haven't had a chance to do a test rendering with the latest commit.

Copy link
Collaborator

@jeisenbe jeisenbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test renderings are fine.

Copy link
Collaborator

@imagico imagico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not specifically tested all the thresholds but in general the code works fine.

@pnorman pnorman merged commit 1e2c5c1 into gravitystorm:master Mar 3, 2020
@pnorman pnorman deleted the pixel_size branch March 3, 2020 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add conditions and functional indexes on ST_PointOnSurface(way)
3 participants