From 829619048780e54dae05107fc856f6db9569397c Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 26 Oct 2016 15:47:26 -0700 Subject: [PATCH] Remove leftovers from early versions of --detect-shared-borders --- geometry.cpp | 32 +++++++++----------------------- geometry.hpp | 2 +- tile.cpp | 6 +++--- 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/geometry.cpp b/geometry.cpp index 89cf541..28feb63 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -1038,19 +1038,17 @@ drawvec impose_tile_boundaries(drawvec &geom, long long extent) { return out; } -drawvec simplify_lines(drawvec &geom, int z, int detail, bool mark_tile_bounds, double simplification, bool already_marked) { +drawvec simplify_lines(drawvec &geom, int z, int detail, bool mark_tile_bounds, double simplification) { int res = 1 << (32 - detail - z); long long area = 1LL << (32 - z); - if (!already_marked) { - for (size_t i = 0; i < geom.size(); i++) { - if (geom[i].op == VT_MOVETO) { - geom[i].necessary = 1; - } else if (geom[i].op == VT_LINETO) { - geom[i].necessary = 0; - } else { - geom[i].necessary = 1; - } + for (size_t i = 0; i < geom.size(); i++) { + if (geom[i].op == VT_MOVETO) { + geom[i].necessary = 1; + } else if (geom[i].op == VT_LINETO) { + geom[i].necessary = 0; + } else { + geom[i].necessary = 1; } } @@ -1071,19 +1069,7 @@ drawvec simplify_lines(drawvec &geom, int z, int detail, bool mark_tile_bounds, geom[j - 1].necessary = 1; if (j - i > 1) { - if (already_marked && geom[j - 1] < geom[i]) { - drawvec dv; - for (size_t k = j; k > i; k--) { - dv.push_back(geom[k - 1]); - } - douglas_peucker(dv, 0, j - i, res * simplification); - size_t l = 0; - for (size_t k = j; k > i; k--) { - geom[k - 1] = dv[l++]; - } - } else { - douglas_peucker(geom, i, j - i, res * simplification); - } + douglas_peucker(geom, i, j - i, res * simplification); } i = j - 1; } diff --git a/geometry.hpp b/geometry.hpp index 5ba9455..b8af1d3 100644 --- a/geometry.hpp +++ b/geometry.hpp @@ -64,7 +64,7 @@ drawvec reduce_tiny_poly(drawvec &geom, int z, int detail, bool *reduced, double drawvec clip_lines(drawvec &geom, int z, int detail, long long buffer); bool point_within_tile(long long x, long long y, int z, int detail, long long buffer); int quick_check(long long *bbox, int z, int detail, long long buffer); -drawvec simplify_lines(drawvec &geom, int z, int detail, bool mark_tile_bounds, double simplification, bool already_marked); +drawvec simplify_lines(drawvec &geom, int z, int detail, bool mark_tile_bounds, double simplification); drawvec reorder_lines(drawvec &geom); drawvec fix_polygon(drawvec &geom); std::vector chop_polygon(std::vector &geoms); diff --git a/tile.cpp b/tile.cpp index db1bdfe..58ac1e1 100644 --- a/tile.cpp +++ b/tile.cpp @@ -469,7 +469,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, already_marked); + drawvec ngeom = simplify_lines(geom, z, line_detail, !(prevent[P_CLIPPING] || prevent[P_DUPLICATION]), (*partials)[i].simplification); if (t != VT_POLYGON || ngeom.size() >= 3) { geom = ngeom; @@ -922,7 +922,7 @@ bool find_common_edges(std::vector &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, false); + simplified_arcs[ai->second] = simplify_lines(dv, z, line_detail, !(prevent[P_CLIPPING] || prevent[P_DUPLICATION]), simplification); } else { simplified_arcs[ai->second] = dv; } @@ -1617,7 +1617,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, false); + !(prevent[P_CLIPPING] || prevent[P_DUPLICATION]), simplification); } if (layer_features[x].type == VT_POLYGON) {