diff --git a/geometry.cpp b/geometry.cpp index 54df8d68..162ec6b5 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -221,8 +221,10 @@ drawvec reduce_tiny_poly(drawvec &geom, int z, int detail, bool *reduced, double // in a tiny polygon rather than letting it represent itself, // OR it is an inner ring and we haven't output an outer ring for it to be // cut out of, so we are just subtracting its area from the tiny polygon - // rather than trying to deal with it geometrically - if ((area > 0 && area <= pixel * pixel) || (area < 0 && -area <= pixel * pixel && !included_last_outer)) { + // rather than trying to deal with it geometrically (even if it is too big + // to really be considered a tiny polygon, which shouldn't happen because + // it should be smaller than its outer ring, which was considered tiny). + if ((area > 0 && area <= pixel * pixel) || (area < 0 && !included_last_outer)) { // printf("area is only %f vs %lld so using square\n", area, pixel * pixel); *accum_area += area; diff --git a/tests/polygon-winding/out/-z0_--reverse-source-polygon-winding.json b/tests/polygon-winding/out/-z0_--reverse-source-polygon-winding.json index 7ab54f5f..fcbc8b14 100644 --- a/tests/polygon-winding/out/-z0_--reverse-source-polygon-winding.json +++ b/tests/polygon-winding/out/-z0_--reverse-source-polygon-winding.json @@ -12,4 +12,9 @@ "type": "overlay", "version": "2" }, "features": [ +{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [ +{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [ +{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 100.810547, 0.790990 ], [ 100.810547, 0.175781 ], [ 100.195312, 0.175781 ], [ 100.195312, 0.790990 ], [ 100.810547, 0.790990 ] ] ] } } +] } +] } ] }