Don't let line simplification reduce a polygon ring to below 3 points

This commit is contained in:
Eric Fischer
2016-11-14 11:22:21 -08:00
parent 32aa653082
commit 9ea29601ab
16 changed files with 460 additions and 459 deletions
+3 -3
View File
@@ -460,7 +460,7 @@ void *partial_feature_worker(void *v) {
}
if (!already_marked) {
drawvec ngeom = simplify_lines(geom, z, line_detail, !(prevent[P_CLIPPING] || prevent[P_DUPLICATION]), (*partials)[i].simplification);
drawvec ngeom = simplify_lines(geom, z, line_detail, !(prevent[P_CLIPPING] || prevent[P_DUPLICATION]), (*partials)[i].simplification, t == VT_POLYGON ? 4 : 0);
if (t != VT_POLYGON || ngeom.size() >= 3) {
geom = ngeom;
@@ -913,7 +913,7 @@ bool find_common_edges(std::vector<partial> &partials, int z, int line_detail, d
}
}
if (!(prevent[P_SIMPLIFY] || (z == maxzoom && prevent[P_SIMPLIFY_LOW]))) {
simplified_arcs[ai->second] = simplify_lines(dv, z, line_detail, !(prevent[P_CLIPPING] || prevent[P_DUPLICATION]), simplification);
simplified_arcs[ai->second] = simplify_lines(dv, z, line_detail, !(prevent[P_CLIPPING] || prevent[P_DUPLICATION]), simplification, 3);
} else {
simplified_arcs[ai->second] = dv;
}
@@ -1666,7 +1666,7 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
if (layer_features[x].coalesced && layer_features[x].type == VT_LINE) {
layer_features[x].geom = remove_noop(layer_features[x].geom, layer_features[x].type, 0);
layer_features[x].geom = simplify_lines(layer_features[x].geom, 32, 0,
!(prevent[P_CLIPPING] || prevent[P_DUPLICATION]), simplification);
!(prevent[P_CLIPPING] || prevent[P_DUPLICATION]), simplification, layer_features[x].type == VT_POLYGON ? 4 : 0);
}
if (layer_features[x].type == VT_POLYGON) {