mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Make it a command-line option
This commit is contained in:
@@ -3098,6 +3098,7 @@ int main(int argc, char **argv) {
|
|||||||
{"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},
|
{"keep-point-cluster-position", no_argument, &additional[A_KEEP_POINT_CLUSTER_POSITION], 1},
|
||||||
|
{"distinguish-duplicates", no_argument, &additional[A_DISTINGUISH_DUPLICATES], 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'},
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#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 A_KEEP_POINT_CLUSTER_POSITION ((int) 'a')
|
||||||
|
#define A_DISTINGUISH_DUPLICATES ((int) 'u')
|
||||||
|
|
||||||
#define P_TILE_COMPRESSION ((int) 'C')
|
#define P_TILE_COMPRESSION ((int) 'C')
|
||||||
#define P_DUPLICATION ((int) 'D')
|
#define P_DUPLICATION ((int) 'D')
|
||||||
|
|||||||
+2
-1
@@ -732,7 +732,7 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf, std::
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (true || additional[A_DROP_DENSEST_AS_NEEDED] ||
|
if (additional[A_DROP_DENSEST_AS_NEEDED] ||
|
||||||
additional[A_COALESCE_DENSEST_AS_NEEDED] ||
|
additional[A_COALESCE_DENSEST_AS_NEEDED] ||
|
||||||
additional[A_CLUSTER_DENSEST_AS_NEEDED] ||
|
additional[A_CLUSTER_DENSEST_AS_NEEDED] ||
|
||||||
additional[A_CALCULATE_FEATURE_DENSITY] ||
|
additional[A_CALCULATE_FEATURE_DENSITY] ||
|
||||||
@@ -743,6 +743,7 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf, std::
|
|||||||
prevent[P_DYNAMIC_DROP] ||
|
prevent[P_DYNAMIC_DROP] ||
|
||||||
additional[A_INCREASE_GAMMA_AS_NEEDED] ||
|
additional[A_INCREASE_GAMMA_AS_NEEDED] ||
|
||||||
additional[A_GENERATE_POLYGON_LABEL_POINTS] ||
|
additional[A_GENERATE_POLYGON_LABEL_POINTS] ||
|
||||||
|
additional[A_DISTINGUISH_DUPLICATES] ||
|
||||||
sst->uses_gamma ||
|
sst->uses_gamma ||
|
||||||
retain_points_multiplier > 1 ||
|
retain_points_multiplier > 1 ||
|
||||||
preserve_multiplier_density_threshold > 0 ||
|
preserve_multiplier_density_threshold > 0 ||
|
||||||
|
|||||||
@@ -1088,7 +1088,7 @@ static serial_feature next_feature(decompressor *geoms, std::atomic<long long> *
|
|||||||
}
|
}
|
||||||
|
|
||||||
s.resize(len);
|
s.resize(len);
|
||||||
if (fread((void *) s.c_str(), 1, len, next_feature_state.deferrals[next_feature_state.which_deferral]) != len) {
|
if (fread((void *) s.c_str(), 1, len, next_feature_state.deferrals[next_feature_state.which_deferral]) != (size_t) len) {
|
||||||
fprintf(stderr, "short read in deferred deserialization: %s\n", strerror(errno));
|
fprintf(stderr, "short read in deferred deserialization: %s\n", strerror(errno));
|
||||||
exit(EXIT_READ);
|
exit(EXIT_READ);
|
||||||
}
|
}
|
||||||
@@ -1123,7 +1123,7 @@ static serial_feature next_feature(decompressor *geoms, std::atomic<long long> *
|
|||||||
sf = deserialize_feature(s, z, tx, ty, initial_x, initial_y);
|
sf = deserialize_feature(s, z, tx, ty, initial_x, initial_y);
|
||||||
sf.stringpool = global_stringpool + pool_off[sf.segment];
|
sf.stringpool = global_stringpool + pool_off[sf.segment];
|
||||||
|
|
||||||
if (!next_feature_state.doing_deferrals && sf.index == next_feature_state.previndex) {
|
if (!next_feature_state.doing_deferrals && additional[A_DISTINGUISH_DUPLICATES] && sf.index == next_feature_state.previndex) {
|
||||||
if (next_feature_state.which_deferral >= next_feature_state.deferrals.size()) {
|
if (next_feature_state.which_deferral >= next_feature_state.deferrals.size()) {
|
||||||
std::string tmpname = "/tmp/XXXXXXXXXX";
|
std::string tmpname = "/tmp/XXXXXXXXXX";
|
||||||
int fd = mkstemp((char *) tmpname.c_str());
|
int fd = mkstemp((char *) tmpname.c_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user