Add an option to keep intersection nodes from being simplified away

This commit is contained in:
Eric Fischer
2019-05-13 17:39:07 -07:00
parent 9dc92a452a
commit 42ee195bc3
8 changed files with 835 additions and 5 deletions
+8 -1
View File
@@ -802,7 +802,7 @@ 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, size_t retain) {
drawvec simplify_lines(drawvec &geom, int z, int detail, bool mark_tile_bounds, double simplification, size_t retain, drawvec const &shared_nodes) {
int res = 1 << (32 - detail - z);
long long area = 1LL << (32 - z);
@@ -814,6 +814,13 @@ drawvec simplify_lines(drawvec &geom, int z, int detail, bool mark_tile_bounds,
} else {
geom[i].necessary = 1;
}
if (prevent[P_SIMPLIFY_SHARED_NODES]) {
auto pt = std::lower_bound(shared_nodes.begin(), shared_nodes.end(), geom[i]);
if (pt != shared_nodes.end() && *pt == geom[i]) {
geom[i].necessary = true;
}
}
}
if (mark_tile_bounds) {