Remove --drop-denser

This commit is contained in:
Erica Fischer
2024-01-26 16:28:50 -08:00
parent 9adb032d9e
commit ea0f04d4d1
4 changed files with 2 additions and 1810 deletions
-2
View File
@@ -459,8 +459,6 @@ the same layer, enclose them in an `all` expression so they will all be evaluate
You can also specify a marker-width with `-Bg`*width* to allow fewer features in the densest tile to
compensate for the larger marker, or `-Bf`*number* to allow at most *number* features in the densest tile.
* `--retain-points-multiplier=`_multiple_: Retain the specified multiple of points instead of just the number of points that would ordinarily be retained by the drop rate. These can be thinned out later with the `-m` option to `tippecanoe-overzoom`. The start of each cluster is marked in the feature sequence by the `tippecanoe:retain_points_multiplier_first` attribute.
* `--drop-denser=`_percentage_: When dropping dots at zoom levels below the base zoom, give the specified _percentage_
preference to retaining points in sparse areas and dropping points in dense areas.
* `--limit-base-zoom-to-maximum-zoom` or `-Pb`: Limit the guessed base zoom not to exceed the maxzoom, even if this would put more than the requested number of features in a base zoom tile.
* `-al` or `--drop-lines`: Let "dot" dropping at lower zooms apply to lines too
* `-ap` or `--drop-polygons`: Let "dot" dropping at lower zooms apply to polygons too
+2 -46
View File
@@ -90,7 +90,6 @@ long justx = -1, justy = -1;
std::string attribute_for_id = "";
size_t limit_tile_feature_count = 0;
size_t limit_tile_feature_count_at_maxzoom = 0;
unsigned int drop_denser = 0;
std::map<std::string, serial_val> set_attributes;
unsigned long long preserve_point_density_threshold = 0;
long long extend_zooms_max = 0;
@@ -2606,7 +2605,7 @@ std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, i
fix_dropping = true;
}
if (fix_dropping || drop_denser > 0) {
if (fix_dropping) {
// Fix up the minzooms for features, now that we really know the base zoom
// and drop rate.
@@ -2626,43 +2625,7 @@ std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, i
struct drop_state ds[maxzoom + 1];
prep_drop_states(ds, maxzoom, basezoom, droprate);
if (drop_denser > 0) {
std::vector<drop_densest> ddv;
unsigned long long previndex = 0;
for (long long ip = 0; ip < indices; ip++) {
if (map[ip].t == VT_POINT ||
(additional[A_LINE_DROP] && map[ip].t == VT_LINE) ||
(additional[A_POLYGON_DROP] && map[ip].t == VT_POLYGON)) {
if (map[ip].ix % 100 < drop_denser) {
drop_densest dd;
dd.gap = map[ip].ix - previndex;
dd.seq = ip;
ddv.push_back(dd);
previndex = map[ip].ix;
} else {
int feature_minzoom = calc_feature_minzoom(&map[ip], ds, maxzoom);
geom[map[ip].end - 1] = feature_minzoom;
}
}
}
std::sort(ddv.begin(), ddv.end());
size_t i = 0;
for (int z = 0; z <= basezoom; z++) {
double keep_fraction = 1.0 / std::exp(std::log(droprate) * (basezoom - z));
size_t keep_count = ddv.size() * keep_fraction;
for (; i < keep_count && i < ddv.size(); i++) {
geom[map[ddv[i].seq].end - 1] = z;
}
}
for (; i < ddv.size(); i++) {
geom[map[ddv[i].seq].end - 1] = basezoom;
}
} else {
{
for (long long ip = 0; ip < indices; ip++) {
if (ip > 0 && map[ip].start != map[ip - 1].end) {
fprintf(stderr, "Mismatched index at %lld: %lld vs %lld\n", ip, map[ip].start, map[ip].end);
@@ -3024,7 +2987,6 @@ int main(int argc, char **argv) {
{"drop-rate", required_argument, 0, 'r'},
{"retain-points-multiplier", required_argument, 0, '~'},
{"base-zoom", required_argument, 0, 'B'},
{"drop-denser", required_argument, 0, '~'},
{"limit-base-zoom-to-maximum-zoom", no_argument, &prevent[P_BASEZOOM_ABOVE_MAXZOOM], 1},
{"drop-lines", no_argument, &additional[A_LINE_DROP], 1},
{"drop-polygons", no_argument, &additional[A_POLYGON_DROP], 1},
@@ -3235,12 +3197,6 @@ int main(int argc, char **argv) {
limit_tile_feature_count = atoll_require(optarg, "Limit tile feature count");
} else if (strcmp(opt, "limit-tile-feature-count-at-maximum-zoom") == 0) {
limit_tile_feature_count_at_maxzoom = atoll_require(optarg, "Limit tile feature count at maxzoom");
} else if (strcmp(opt, "drop-denser") == 0) {
drop_denser = atoi_require(optarg, "Drop denser rate");
if (drop_denser > 100) {
fprintf(stderr, "%s: --drop-denser can be at most 100\n", argv[0]);
exit(EXIT_ARGS);
}
} else if (strcmp(opt, "preserve-point-density-threshold") == 0) {
preserve_point_density_threshold = atoll_require(optarg, "Preserve point density threshold");
} else if (strcmp(opt, "extend-zooms-if-still-dropping-maximum") == 0) {
-3
View File
@@ -574,9 +574,6 @@ compensate for the larger marker, or \fB\fC\-Bf\fR\fInumber\fP to allow at most
.IP \(bu 2
\fB\fC\-\-retain\-points\-multiplier=\fR\fImultiple\fP: Retain the specified multiple of points instead of just the number of points that would ordinarily be retained by the drop rate. These can be thinned out later with the \fB\fC\-m\fR option to \fB\fCtippecanoe\-overzoom\fR\&. The start of each cluster is marked in the feature sequence by the \fB\fCtippecanoe:retain_points_multiplier_first\fR attribute.
.IP \(bu 2
\fB\fC\-\-drop\-denser=\fR\fIpercentage\fP: When dropping dots at zoom levels below the base zoom, give the specified \fIpercentage\fP
preference to retaining points in sparse areas and dropping points in dense areas.
.IP \(bu 2
\fB\fC\-\-limit\-base\-zoom\-to\-maximum\-zoom\fR or \fB\fC\-Pb\fR: Limit the guessed base zoom not to exceed the maxzoom, even if this would put more than the requested number of features in a base zoom tile.
.IP \(bu 2
\fB\fC\-al\fR or \fB\fC\-\-drop\-lines\fR: Let "dot" dropping at lower zooms apply to lines too
File diff suppressed because it is too large Load Diff