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

fix: filter by zoom level for min/max zoom 0 #871

Merged
merged 1 commit into from
Aug 30, 2022

Conversation

iwpnd
Copy link
Member

@iwpnd iwpnd commented Jul 4, 2022

Prior to this, setting min_zoom=0 and max_zoom=0 would result
in the layer being present across the entire zoom range.

Should fix #870

@iwpnd iwpnd requested review from gdey and ARolek as code owners July 4, 2022 12:01
@coveralls
Copy link

coveralls commented Jul 4, 2022

Pull Request Test Coverage Report for Build dcc9261d9-PR-871

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 45.274%

Totals Coverage Status
Change from base Build c3aeca0fa: 0.0%
Covered Lines: 5599
Relevant Lines: 12367

💛 - Coveralls

@iwpnd
Copy link
Member Author

iwpnd commented Jul 6, 2022

Now that i think of it, it might not be necessary. It might suffice if you prompt the user that 0 is not a supported min zoom level and/or default to 1. Either way, your input would be much appreciated here @ARolek

@ARolek
Copy link
Member

ARolek commented Jul 17, 2022

@iwpnd the change you submitted is really simple, so no issues there. I'm trying to figure out why I put the logic check in for zoom == 0. Looking back at the blame history it was something I put in 5 years ago when I originally authored this file and I can't for the life of me remember why.

It might suffice if you prompt the user that 0 is not a supported min zoom level and/or default to 1

I like this idea. Just add a log in saying min_zoom of 0 is not supported. adjusting to '1'.

Thanks for the PR and investigation.

@iwpnd
Copy link
Member Author

iwpnd commented Jul 24, 2022

@ARolek I'm afraid that won't work for max_zoom 0 as tegola sets the constant max zoom of 22 if the MaxZoom is left blank in the toml. Modifying ParseInt would potentially negatively impact other variables in the config, so that is not an option either.

edit: nevermind my dumb ass, i can just check whether value is 0 after I make sure that l.MaxZoom is not a nil pointer.

iwpnd added a commit to iwpnd/tegola that referenced this pull request Jul 24, 2022
as per go-spatial#870, setting max_zoom to 0 currently causes the layer to bleed through
over the entire zoom range. Either we fix filtering as per go-spatial#871
or make sure max_zoom is never 0 as I do in this PR.
@iwpnd iwpnd mentioned this pull request Jul 24, 2022
@iwpnd
Copy link
Member Author

iwpnd commented Jul 24, 2022

#874 will change max_zoom to 1 if set to 0 by the user. I leave the choice of which route to take to you. Either merge #871 or #874. :)

Copy link
Member

@gdey gdey left a comment

Choose a reason for hiding this comment

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

LGTM

Prior to this, setting min_zoom=0 and max_zoom=0 would result
in the layer being present across the entire zoom range.
@gdey gdey merged commit a78880d into go-spatial:master Aug 30, 2022
gdey pushed a commit to iwpnd/tegola that referenced this pull request Aug 30, 2022
as per go-spatial#870, setting max_zoom to 0 currently causes the layer to bleed through
over the entire zoom range. Either we fix filtering as per go-spatial#871
or make sure max_zoom is never 0 as I do in this PR.
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.

Unexpected shapes from z0 layer included in z13 tile
4 participants