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
{{ message }}
Repository navigation
self intersecting polygons reported when processing shapefile #403
I am using the land polygons from natural earth and get self intersections reported, however when I analyse the source geometry in QGIS it seems to be valid. I thought this could be coming from the simplification, but even if it is turned off it still reports the problem:
layer config
Bounding box -180, -85.06, 180, 85.06
Reading .shp land
Shapefile entity #0 type 5 is invalid. Parts:98. Reason:Geometry has invalid self-intersections. A self-intersection point was found at (-159.369, -180); method: m; operations: i/x; segment IDs {source, multi, ring, segment}: {0, 0, -1, 7989}/{0, 0, -1, 8119}... failed to correct. Reason: Multi-polygon has intersecting interiors
Shapefile entity #6 type 5 is invalid. Parts:69. Reason:Geometry has invalid self-intersections. A self-intersection point was found at (165.088, -21.8912); method: i; operations: i/u; segment IDs {source, multi, ring, segment}: {0, 56, -1, 280}/{0, 56, -1, 282}... failed to correct. Reason: Geometry has invalid self-intersections. A self-intersection point was found at (165.088, -21.8912); method: i; operations: i/u; segment IDs {source, multi, ring, segment}: {0, 56, -1, 280}/{0, 56, -1, 282}
Reading .shp landcp
Shapefile entity #0 type 5 is invalid. Parts:98. Reason:Geometry has invalid self-intersections. A self-intersection point was found at (-159.369, -180); method: m; operations: i/x; segment IDs {source, multi, ring, segment}: {0, 0, -1, 7989}/{0, 0, -1, 8119}... failed to correct. Reason: Multi-polygon has intersecting interiors
Shapefile entity #6 type 5 is invalid. Parts:69. Reason:Geometry has invalid self-intersections. A self-intersection point was found at (165.088, -21.8912); method: i; operations: i/u; segment IDs {source, multi, ring, segment}: {0, 56, -1, 280}/{0, 56, -1, 282}... failed to correct. Reason: Geometry has invalid self-intersections. A self-intersection point was found at (165.088, -21.8912); method: i; operations: i/u; segment IDs {source, multi, ring, segment}: {0, 56, -1, 280}/{0, 56, -1, 282}
Could be reprojection artefacts, or a difference in validity tests between JTS/GEOS (as used by QGIS) and Boost.Geometry (as used by tilemaker). They're only warnings - you can safely ignore them, but if you find any land polygons disappearing as a result then do lodge an issue.
for completeness, this is the config line for the land polygons:
"land": { "minzoom": 0, "maxzoom": 8, "source": "ne_data/ne_10m_land/ne_10m_land.shp", "simplify_below": 8, "simplify_level": 0.0001, "simplify_ratio": 2 },
as you can see I only created tiles to zoom 8, and did not simplify the z8 tiles, so what you see above is likely coming from reprojection as you suggested.
I retested this with current master (4e0f03d) and the config from the first post (ne_10m_land, z0–8, one layer unsimplified, one simplified). The "invalid ... failed to correct" warnings for entities #0 and #6 still appear. More importantly, many output polygons are invalid in tile coordinates (crossing/overlapping edges, spikes), which is what makes renderers drop or misdraw land:
z0
z3
z8
unsimplified layer
10 of 11
127 of 370
38 of 32524
simplified layer
5 of 11
16 of 370
40 of 32524
The cause is that polygons are only repaired when they were simplified; quantising them onto the tile grid can make them invalid too. #929 with "invalid_polygon_repair_scope": "all" brings the unsimplified layer down to 36 at z3 and 2 at z8 (and the simplified layer to 2 at z8). Details in #929.
Activity
systemed commentedon Mar 30, 2022
Could be reprojection artefacts, or a difference in validity tests between JTS/GEOS (as used by QGIS) and Boost.Geometry (as used by tilemaker). They're only warnings - you can safely ignore them, but if you find any land polygons disappearing as a result then do lodge an issue.
dieterdreist commentedon Apr 5, 2022
I just found land polygons disappearing here (zooming in):

zooming close:

systemed commentedon Apr 5, 2022
Thanks. I'm not going to have a chance to look at this immediately but that's helpful.
dieterdreist commentedon Apr 5, 2022
for completeness, this is the config line for the land polygons:
"
land": { "minzoom": 0, "maxzoom": 8, "source": "ne_data/ne_10m_land/ne_10m_land.shp", "simplify_below": 8, "simplify_level": 0.0001, "simplify_ratio": 2 },as you can see I only created tiles to zoom 8, and did not simplify the z8 tiles, so what you see above is likely coming from reprojection as you suggested.
systemed commentedon Oct 3, 2022
There have been a few changes recently that might fix this - I haven't tried it out with this dataset but you might want to have a look.
dktue commentedon Oct 29, 2026
I retested this with current master (
4e0f03d) and the config from the first post (ne_10m_land, z0–8, one layer unsimplified, one simplified). The "invalid ... failed to correct" warnings for entities #0 and #6 still appear. More importantly, many output polygons are invalid in tile coordinates (crossing/overlapping edges, spikes), which is what makes renderers drop or misdraw land:The cause is that polygons are only repaired when they were simplified; quantising them onto the tile grid can make them invalid too. #929 with
"invalid_polygon_repair_scope": "all"brings the unsimplified layer down to 36 at z3 and 2 at z8 (and the simplified layer to 2 at z8). Details in #929.