More commenting to stop confusing myself about hole logic

This commit is contained in:
Erica Fischer
2023-08-25 14:16:33 -07:00
parent 93d77d32e7
commit ecd71fde10
2 changed files with 9 additions and 2 deletions
+4 -2
View File
@@ -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;
@@ -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 ] ] ] } }
] }
] }
] }