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

ST_SimplifyPreserveTopology() slows down tile generation of shortbread style #43

Open
lonvia opened this issue Nov 25, 2024 · 0 comments

Comments

@lonvia
Copy link

lonvia commented Nov 25, 2024

The ocean and land layer of the shortbread style use ST_SimplifyPreserveTopology() in their layer queries. This function considerably slows down tile generation for me. Some tiles take more than a minute to generate because of that.

Given that the ocean layer relies on external data anyway, the MVT geometries could simply be pre-generated. Doing so for zoom 0-12 takes less than 4 hours on my machine and results in about 3GB of data. That means the data could even be pre-generated once a night when new coastlines arrive. Zoom 13 and 14 should probably better off holding the original OSM data. If that is still too much data, a global simplify over the entire (unified) water_polygon table should only take a couple of minutes.

The land layer is a bit more tricky because it needs to be minutely updated. Just speculating but how about a generated column which is filled with a simplified geometry, but only iff the geometry is too large to reasonably handle (ST_MemSize is a great function for quickly estimating how big the polygons are). Then use coalesce(simplified_way, way) to get reasonably sized data.

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

1 participant