Merged
Conversation
This replaces systemed#606 Rather than dealing with the special case of fully covered or fully excluded, we keep a cache of recently clipped geometries. A higher zoom will look in the cache for a clipped geometry of the object from a lower zoom and re-use it if possible, falling back to the whole geometry only if no cache entry is found. Hudson Bay, master: 22m27s this PR: 1m28s This relies on the assumption that clipping a clipped polygon gives the same result as clipping the original polygon. That seems reasonable to me, but if you know of edge cases to consider, let me know.
This is another fix in the vein of systemed@066ca0a Testing Antarctica with this PR: 9m5s The generated mbtiles doesn't seem to be convertible to a pmtiles file -- `pmtiles convert` fails with: ``` main.go:162: Failed to convert /home/cldellow/src/basemap/tiles.mbtiles, Missing row ``` I've never generated Antarctica with the previous code, so I'm not sure if this is specific to this PR or not. My intuition is this is not specific to this PR. Wild guess is that we're creating tiles with no features, due to https://github.com/systemed/tilemaker/blob/d470dc94fea6ae74e948c1a858c6e1228c9f4bf9/src/tile_worker.cpp#L210, and pmtiles doesn't like that.
Contributor
Author
|
This and #590 lets me generate North America in 43 minutes! The resulting mbtiles was able to be converted to a pmtiles file, which gives me some comfort that the Antarctica thing is probably unique to Antarctica. Runtime looked like it was also impacted by #596, so hopefully we can do better than 43 minutes, too. (updated: with #608, it takes a little less than 40 minutes) |
Owner
|
This is a really neat, elegant solution! Thank you. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This replaces #606, fixes #605
When writing, we keep a cache of previously clipped geometries. Higher zooms will prefer to clip a cached, clipped geometry over an uncached, unclipped geometry.
With this PR:
Antarctica doesn't max out the CPU due to #596 - I think a next step there could be to have a buffer so workers can just enqueue a tile (up to some limit) and move on with their work.
I also noticed that the Antarctica mbtiles couldn't be converted by the
pmtiles convertcommand. I suspect this is a pre-existing issue, but I've never generated Antarctica before. My guess is it's related totilemaker/src/tile_worker.cpp
Line 187 in 06b68df
Probably it's OK to tackle that as a separate issue.