Repository navigation
Conversation
|
Point 1 is a duplicate of PR #933 I did the same as you but this introduced some new effects so i had to change to a 2-step approach Don't know which PR will be merged by the maintainer but this should be considered |
|
Thanks both! I'm currently waiting for feedback on #939 but once we have that then I'll look at applying the currently outstanding PRs over that. |
|
@TimSC, a quick status of the three parts of this PR against current master:
Since you said you don't mind what happens to this PR: would it be OK if I open a small follow-up PR with just the ring skipping, rebased on master and credited to you? This one could then be closed once #933 is in. |
|
@dktue Sounds good! |
|
@TimSC, thanks again for the OK to take the ring skipping from this PR forward. We measured it on current master before opening anything, and it doesn't make a measurable difference anymore, so we're not opening a separate PR for it. OpenMapTiles profile, 32 threads, 3 interleaved rounds each, master vs. the same commit with ring skipping (British Columbia and Norway: d0ab14b,
Wall times are within noise too, and the output is the same apart from the usual |
Fix dropped polygons in
scaleRing; skip shapefile records and rings outside the clipping boxTwo changes, both affecting shapefile polygons such as the coastline's water polygons.
1.
TileBbox::scaleRingcould drop whole polygonsscaleRingremoves small loops by comparing each point with the last few added, but it never compares with the first point. If clipping leaves a ring whose first point is repeated (p0 p0 p1 p2 p3 p0), the repeat is kept. When the ring closes onp0, it matches the repeat and is taken for a loop, so the ring is cut down to two points and the polygon is dropped.Clipping a large polygon to a tile can leave exactly this four-cornered shape. In my renders, large areas of sea disappeared at particular tiles and zooms, for example off the Moroccan coast at z8 and in the Bay of Biscay at z9.
The fix skips any point identical to the one before it, including the first.
2. Faster shapefile reading against a clipping box
SHPReadObjectstays, as a fallback for records whose box can't be read this way.This helps renders of a regional extract (
--bbox, or an input with bounds) using the worldwide coastline shapefile. A whole-planet render is unaffected.Testing
I rendered two coastal extracts (
--bbox -6,35,-3,37and--bbox -3,43,-1,45, up to z10) withconfig-openmaptiles.json, comparing against currentmaster: