mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 16:35:40 +02:00
Somewhat less shardy
This commit is contained in:
+7
-1
@@ -926,7 +926,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 const &shared_nodes) {
|
||||
drawvec simplify_lines(drawvec &geom, int z, int detail, bool mark_tile_bounds, double simplification, size_t retain, drawvec const &shared_nodes, std::set<std::pair<long long, long long>> &kept) {
|
||||
int res = 1 << (32 - detail - z);
|
||||
long long area = 1LL << (32 - z);
|
||||
|
||||
@@ -939,6 +939,11 @@ drawvec simplify_lines(drawvec &geom, int z, int detail, bool mark_tile_bounds,
|
||||
geom[i].necessary = 1;
|
||||
}
|
||||
|
||||
auto found = kept.find(std::pair<long long, long long>((long long) geom[i].x, (long long) geom[i].y));
|
||||
if (found != kept.end()) {
|
||||
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]) {
|
||||
@@ -985,6 +990,7 @@ drawvec simplify_lines(drawvec &geom, int z, int detail, bool mark_tile_bounds,
|
||||
for (size_t i = 0; i < geom.size(); i++) {
|
||||
if (geom[i].necessary) {
|
||||
out.push_back(geom[i]);
|
||||
kept.insert(std::pair<long long, long long>((long long) geom[i].x, (long long) geom[i].y));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user