Make it a little thicker.

Don't change the tiny polygon rules unless the option is set
This commit is contained in:
Erica Fischer
2023-10-27 23:00:18 -07:00
parent 6c58ae4162
commit 23009c2cca
2 changed files with 20 additions and 16 deletions
+19 -15
View File
@@ -197,21 +197,25 @@ drawvec reduce_tiny_poly(drawvec &geom, int z, int detail, bool *still_needs_sim
double area = get_area(geom, i, j); double area = get_area(geom, i, j);
long long minx = LLONG_MAX; // if we are trying to salvage polygons that would otherwise drop out,
long long maxx = LLONG_MIN; // also raise the standards for what can qualify as polygon dust
long long miny = LLONG_MAX; if (additional[A_BUFFER_POLYGONS_OUTWARD]) {
long long maxy = LLONG_MIN; long long minx = LLONG_MAX;
for (auto const &d : geom) { long long maxx = LLONG_MIN;
minx = std::min(minx, (long long) d.x); long long miny = LLONG_MAX;
maxx = std::max(maxx, (long long) d.x); long long maxy = LLONG_MIN;
miny = std::min(miny, (long long) d.y); for (auto const &d : geom) {
maxy = std::max(maxy, (long long) d.y); minx = std::min(minx, (long long) d.x);
} maxx = std::max(maxx, (long long) d.x);
if (area > 0 && area <= pixel * pixel && area < (maxx - minx) * (maxy - miny) / 5) { miny = std::min(miny, (long long) d.y);
// if the polygon doesn't use most of its area, maxy = std::max(maxy, (long long) d.y);
// don't let it be dust, because the shape is }
// probably something weird and interesting. if (area > 0 && area <= pixel * pixel && area < (maxx - minx) * (maxy - miny) / 3) {
area = pixel * pixel * 2; // if the polygon doesn't use most of its area,
// don't let it be dust, because the shape is
// probably something weird and interesting.
area = pixel * pixel * 2;
}
} }
// XXX There is an ambiguity here: If the area of a ring is 0 and it is followed by holes, // XXX There is an ambiguity here: If the area of a ring is 0 and it is followed by holes,
+1 -1
View File
@@ -614,7 +614,7 @@ void *partial_feature_worker(void *v) {
drawvec geom = (*partials)[i].geoms[0]; drawvec geom = (*partials)[i].geoms[0];
if (additional[A_BUFFER_POLYGONS_OUTWARD] && t == VT_POLYGON) { if (additional[A_BUFFER_POLYGONS_OUTWARD] && t == VT_POLYGON) {
geom = buffer_poly(geom, (1LL << (32 - z - out_detail)) * sqrt(2) / 2, z, (*partials)[i].tx, (*partials)[i].ty, a->shared_nodes_map, a->nodepos); geom = buffer_poly(geom, (1LL << (32 - z - out_detail)) * sqrt(2), z, (*partials)[i].tx, (*partials)[i].ty, a->shared_nodes_map, a->nodepos);
} }
to_tile_scale(geom, z, out_detail); to_tile_scale(geom, z, out_detail);