mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 18:05:42 +02:00
Clean up collinearities in coalesced features
This commit is contained in:
+1
-1
@@ -771,7 +771,7 @@ void *join_worker(void *v) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!pk && compressed.size() > 500000) {
|
if (!pk && compressed.size() > 500000) {
|
||||||
fprintf(stderr, "Tile %lld/%lld/%lld size is %lld, >500000. Skipping this tile\n.", ai->first.z, ai->first.x, ai->first.y, (long long) compressed.size());
|
fprintf(stderr, "Tile %lld/%lld/%lld size is %lld, >500000. Skipping this tile.\n", ai->first.z, ai->first.x, ai->first.y, (long long) compressed.size());
|
||||||
} else {
|
} else {
|
||||||
a->outputs.insert(std::pair<zxy, std::string>(ai->first, compressed));
|
a->outputs.insert(std::pair<zxy, std::string>(ai->first, compressed));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -634,6 +634,13 @@ static double simplify_feature(serial_feature *p, drawvec const &shared_nodes, n
|
|||||||
// continues to simplify to line_detail even if we have extra detail
|
// continues to simplify to line_detail even if we have extra detail
|
||||||
drawvec ngeom = simplify_lines(geom, z, p->tx, p->ty, line_detail, !(prevent[P_CLIPPING] || prevent[P_DUPLICATION]), p->simplification, t == VT_POLYGON ? 4 : 0, shared_nodes, shared_nodes_map, nodepos);
|
drawvec ngeom = simplify_lines(geom, z, p->tx, p->ty, line_detail, !(prevent[P_CLIPPING] || prevent[P_DUPLICATION]), p->simplification, t == VT_POLYGON ? 4 : 0, shared_nodes, shared_nodes_map, nodepos);
|
||||||
|
|
||||||
|
if (p->coalesced && prevent[P_SIMPLIFY_SHARED_NODES]) {
|
||||||
|
// do another simplification to eliminate collinearities
|
||||||
|
// that were left behind at the former corners between
|
||||||
|
// coalesced geometries
|
||||||
|
ngeom = simplify_lines(ngeom, z, p->tx, p->ty, line_detail, !(prevent[P_CLIPPING] || prevent[P_DUPLICATION]), 0.1, t == VT_POLYGON ? 4 : 0, shared_nodes, NULL, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (t != VT_POLYGON || ngeom.size() >= 3) {
|
if (t != VT_POLYGON || ngeom.size() >= 3) {
|
||||||
geom = ngeom;
|
geom = ngeom;
|
||||||
}
|
}
|
||||||
@@ -2355,7 +2362,6 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
|||||||
} else if (mingap < ULONG_MAX && (additional[A_DROP_DENSEST_AS_NEEDED] || additional[A_COALESCE_DENSEST_AS_NEEDED] || additional[A_CLUSTER_DENSEST_AS_NEEDED])) {
|
} else if (mingap < ULONG_MAX && (additional[A_DROP_DENSEST_AS_NEEDED] || additional[A_COALESCE_DENSEST_AS_NEEDED] || additional[A_CLUSTER_DENSEST_AS_NEEDED])) {
|
||||||
mingap_fraction = mingap_fraction * max_tile_features / totalsize * 0.90;
|
mingap_fraction = mingap_fraction * max_tile_features / totalsize * 0.90;
|
||||||
unsigned long long m = choose_mingap(gaps, mingap_fraction, mingap);
|
unsigned long long m = choose_mingap(gaps, mingap_fraction, mingap);
|
||||||
printf("was %llu, now %llu\n", mingap, m);
|
|
||||||
if (m != mingap) {
|
if (m != mingap) {
|
||||||
mingap = m;
|
mingap = m;
|
||||||
if (mingap > arg->mingap_out) {
|
if (mingap > arg->mingap_out) {
|
||||||
@@ -2458,7 +2464,6 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
|||||||
} else if (mingap < ULONG_MAX && (additional[A_DROP_DENSEST_AS_NEEDED] || additional[A_COALESCE_DENSEST_AS_NEEDED] || additional[A_CLUSTER_DENSEST_AS_NEEDED])) {
|
} else if (mingap < ULONG_MAX && (additional[A_DROP_DENSEST_AS_NEEDED] || additional[A_COALESCE_DENSEST_AS_NEEDED] || additional[A_CLUSTER_DENSEST_AS_NEEDED])) {
|
||||||
mingap_fraction = mingap_fraction * scaled_max_tile_size / (kept_adjust * compressed.size()) * 0.90;
|
mingap_fraction = mingap_fraction * scaled_max_tile_size / (kept_adjust * compressed.size()) * 0.90;
|
||||||
unsigned long long m = choose_mingap(gaps, mingap_fraction, mingap);
|
unsigned long long m = choose_mingap(gaps, mingap_fraction, mingap);
|
||||||
printf("was %llu, now %llu\n", mingap, m);
|
|
||||||
if (m != mingap) {
|
if (m != mingap) {
|
||||||
mingap = m;
|
mingap = m;
|
||||||
if (mingap > arg->mingap_out) {
|
if (mingap > arg->mingap_out) {
|
||||||
|
|||||||
Reference in New Issue
Block a user