You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tile expiry only expires polygons if their bounding box (width and height) is smaller than a threshold. The default value of this threshold is 20000.
The check whether a polygon is smaller or larger happens before it is transformed to Web Mercator projection. This is not a problem if the database is in Web Mercator projection but it is a problem is someone imports the database in another projection, e.g. EPSG:4326. If he does not change the maximum bounding box size, all polygons will be expired because even a polygon which spans around the world is smaller than the default (20000.0 > 360.0).
There are two possible bug fixes:
Users must set the maximum bounding box size explicitly if they enable the tile expiry. This is checked at the start of osm2pgsql. The bounding box size is in the unit of measurement of the projection of the database.
The corners of the bounding box are transformed to Web Mercator before they are checked. The unit of measurement of the bounding box is always Web Mercator.
Fix 1 has the advantage that the bounding box size does not suffer from the distortion of the Mercator projection which depends on the latitude. Fix 2 has the advantage that the user interface does not change for most of our users (assuming they have EPSG:3857 databases). If fix 2 is chosen, users who import data in a length-preserving projection, cannot use a bounding box which has the same size all over the world.
What do you think? How should the bug be fixed? I myself prefer fix 1.
The bug fix is independent from #709 but I can include the fix in the second pull request which results from that issue.
The text was updated successfully, but these errors were encountered:
There is a third possibility: compute a maximum bounding box size that is roughly equivalent to the mercator default in the database projection once and use that as before.
I'm a bit worried that very few user would have an idea what setting a box value means. If we can set a half-way sensible default we should.
The tile expiry only expires polygons if their bounding box (width and height) is smaller than a threshold. The default value of this threshold is 20000.
The check whether a polygon is smaller or larger happens before it is transformed to Web Mercator projection. This is not a problem if the database is in Web Mercator projection but it is a problem is someone imports the database in another projection, e.g. EPSG:4326. If he does not change the maximum bounding box size, all polygons will be expired because even a polygon which spans around the world is smaller than the default (20000.0 > 360.0).
There are two possible bug fixes:
Fix 1 has the advantage that the bounding box size does not suffer from the distortion of the Mercator projection which depends on the latitude. Fix 2 has the advantage that the user interface does not change for most of our users (assuming they have EPSG:3857 databases). If fix 2 is chosen, users who import data in a length-preserving projection, cannot use a bounding box which has the same size all over the world.
What do you think? How should the bug be fixed? I myself prefer fix 1.
The bug fix is independent from #709 but I can include the fix in the second pull request which results from that issue.
The text was updated successfully, but these errors were encountered: