fixed disappering tiles on zoom 1-3 #188
Merged
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.
Tile bounds calculated
BaseProjection::CalculateGeogBoundscan overlap projection limits, causing GDAL error and tile disappearing. Take world map for example: we have tile grid 4*4 on zoom level 2, tile height (lat) will be ~18, 66, 66, 18. But for lower tile rowBaseProjectionreturns top lat -66 and height 66, which causes to transform via OGRCoordinateTransformation::transform latitudes like -133 (-66 - 66, top lat - height) and GDAL error. I'm not able to understand, why this doesn't happens with top tiles row (whyBaseProjectioncalculates right height 18 for them), but able to patch it around overridingBaseProjection::CalculateGeogBoundsinMercatorProjection::CalculateGeogBoundsand checking calculated tile bounds against min/max lat/lon.That's vanilla MapWindow:

Again, with fix:
