Closes #3 -- zoom doesnt increment to 19 if minNumTiles not met #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Root problem is that if
zoomreaches to18andminNumTilesis still not reached,zoomincrements to19butminX/minY/maxX/maxYdon't change. So the tiles produced are incorrect.Approach here is just to stop searching at
zoom = 18no matter what. This could optionally throw awarningin the case thati == 18L && ntiles < minNumTiles.Further, I think that
zoom = 19is valid; we could change the loop to tryi = 1:19and then stop no matter what after19...I also think we can just calculate immediately what the zoom level should be, rather than iterating like is done now... at least we can narrow the focus to within one or two zooms and then do a local search to
zoom_start +/-1... for another day