Skip to content

Conversation

@nextfullstorm
Copy link
Contributor

Tile bounds calculated BaseProjection::CalculateGeogBounds can 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 row BaseProjection returns 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 (why BaseProjection calculates right height 18 for them), but able to patch it around overriding BaseProjection::CalculateGeogBounds in MercatorProjection::CalculateGeogBounds and checking calculated tile bounds against min/max lat/lon.

That's vanilla MapWindow:
error

Again, with fix:
fixed

@ultraTCS
Copy link

ultraTCS commented Dec 4, 2019

Hi, is this issue perhaps the same as this?
https://mapwindow.discourse.group/t/shapefile-polygon-fill/254?u=ultralt

thanks.

@nextfullstorm
Copy link
Contributor Author

Hi, is this issue perhaps the same as this?
As far as I can tell, no, it isn't. This bug is about wrong tile bound box calculation. Do you have "GDAL FAILURE: latitude or longitude exceed limits" message when you changing zoom level?

@ultraTCS
Copy link

ultraTCS commented Dec 4, 2019

No. Do not get that GDAL error. There is no error message at all in this scenario.
Thanks for your response.

@jerryfaust jerryfaust merged commit 58c0153 into MapWindow:develop Dec 5, 2019
@jerryfaust
Copy link
Contributor

Assigned to MWGIS-208.

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.

3 participants