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

Maximum Bounding Box Size of Tile Expiry #776

Open
Nakaner opened this issue Jul 27, 2017 · 1 comment
Open

Maximum Bounding Box Size of Tile Expiry #776

Nakaner opened this issue Jul 27, 2017 · 1 comment

Comments

@Nakaner
Copy link
Contributor

Nakaner commented Jul 27, 2017

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:

  1. 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.
  2. 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.

@lonvia
Copy link
Collaborator

lonvia commented Aug 12, 2017

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.

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

No branches or pull requests

2 participants