mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 18:05:42 +02:00
Avoid initializing drop state with known-bad values
This commit is contained in:
@@ -64,10 +64,6 @@ int calc_feature_minzoom(struct index *ix, struct drop_state ds[], int maxzoom,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void prep_drop_states(struct drop_state ds[], int maxzoom, int basezoom, double droprate) {
|
void prep_drop_states(struct drop_state ds[], int maxzoom, int basezoom, double droprate) {
|
||||||
if (basezoom < 0) {
|
|
||||||
basezoom = maxzoom;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Needs to be signed for interval calculation
|
// Needs to be signed for interval calculation
|
||||||
for (ssize_t i = 0; i <= maxzoom; i++) {
|
for (ssize_t i = 0; i <= maxzoom; i++) {
|
||||||
ds[i].previndex = 0;
|
ds[i].previndex = 0;
|
||||||
|
|||||||
@@ -1056,7 +1056,11 @@ void radix(std::vector<struct reader> &readers, int nreaders, FILE *geomfile, FI
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct drop_state ds[maxzoom + 1];
|
struct drop_state ds[maxzoom + 1];
|
||||||
prep_drop_states(ds, maxzoom, basezoom, droprate);
|
if (maxzoom < 0 || droprate <= 0) { // not guessed with -zg yet
|
||||||
|
prep_drop_states(ds, 0, 0, 1);
|
||||||
|
} else {
|
||||||
|
prep_drop_states(ds, maxzoom, basezoom, droprate);
|
||||||
|
}
|
||||||
|
|
||||||
long long progress = 0, progress_max = geom_total, progress_reported = -1;
|
long long progress = 0, progress_max = geom_total, progress_reported = -1;
|
||||||
long long availfiles_before = availfiles;
|
long long availfiles_before = availfiles;
|
||||||
|
|||||||
Reference in New Issue
Block a user