Option to not averaging clusters of points (#326)

This commit is contained in:
Denis Govorkov
2025-03-19 13:56:36 -07:00
committed by GitHub
parent de4e1e478f
commit 9d1637f7c1
3 changed files with 4 additions and 1 deletions
+1
View File
@@ -3097,6 +3097,7 @@ int main(int argc, char **argv) {
{"coalesce-smallest-as-needed", no_argument, &additional[A_COALESCE_SMALLEST_AS_NEEDED], 1}, {"coalesce-smallest-as-needed", no_argument, &additional[A_COALESCE_SMALLEST_AS_NEEDED], 1},
{"force-feature-limit", no_argument, &prevent[P_DYNAMIC_DROP], 1}, {"force-feature-limit", no_argument, &prevent[P_DYNAMIC_DROP], 1},
{"cluster-densest-as-needed", no_argument, &additional[A_CLUSTER_DENSEST_AS_NEEDED], 1}, {"cluster-densest-as-needed", no_argument, &additional[A_CLUSTER_DENSEST_AS_NEEDED], 1},
{"keep-point-cluster-position", no_argument, &additional[A_KEEP_POINT_CLUSTER_POSITION], 1},
{"Dropping tightly overlapping features", 0, 0, 0}, {"Dropping tightly overlapping features", 0, 0, 0},
{"gamma", required_argument, 0, 'g'}, {"gamma", required_argument, 0, 'g'},
+1
View File
@@ -28,6 +28,7 @@
#define A_VARIABLE_DEPTH_PYRAMID ((int) 't') #define A_VARIABLE_DEPTH_PYRAMID ((int) 't')
#define A_VISVALINGAM ((int) 'v') #define A_VISVALINGAM ((int) 'v')
#define A_DETECT_WRAPAROUND ((int) 'w') #define A_DETECT_WRAPAROUND ((int) 'w')
#define A_KEEP_POINT_CLUSTER_POSITION ((int) 'a')
#define P_TILE_COMPRESSION ((int) 'C') #define P_TILE_COMPRESSION ((int) 'C')
#define P_DUPLICATION ((int) 'D') #define P_DUPLICATION ((int) 'D')
+2 -1
View File
@@ -1948,7 +1948,8 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
if ((sf.index < merge_previndex || sf.index - merge_previndex < cluster_mingap) && find_feature_to_accumulate_onto(features, sf, which_serial_feature, layer_unmaps, LLONG_MAX)) { if ((sf.index < merge_previndex || sf.index - merge_previndex < cluster_mingap) && find_feature_to_accumulate_onto(features, sf, which_serial_feature, layer_unmaps, LLONG_MAX)) {
features[which_serial_feature]->clustered++; features[which_serial_feature]->clustered++;
if (features[which_serial_feature]->t == VT_POINT && if (!additional[A_KEEP_POINT_CLUSTER_POSITION] &&
features[which_serial_feature]->t == VT_POINT &&
features[which_serial_feature]->geometry.size() == 1 && features[which_serial_feature]->geometry.size() == 1 &&
sf.geometry.size() == 1) { sf.geometry.size() == 1) {
double x = (double) features[which_serial_feature]->geometry[0].x * features[which_serial_feature]->clustered; double x = (double) features[which_serial_feature]->geometry[0].x * features[which_serial_feature]->clustered;