Skip to content

Commit

Permalink
Avoid potential infinite loop from choosing the same min density again
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed May 31, 2017
1 parent cf3a080 commit dba2495
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.19.1

* Add an option to increase maxzoom if features are still being dropped

## 1.19.0

* Tile-join can merge and create directories, not only mbtiles
Expand Down
14 changes: 11 additions & 3 deletions tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1803,7 +1803,11 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
continue;
} else if (additional[A_DROP_DENSEST_AS_NEEDED]) {
mingap_fraction = mingap_fraction * 200000.0 / totalsize * 0.90;
mingap = choose_mingap(indices, mingap_fraction);
unsigned long long mg = choose_mingap(indices, mingap_fraction);
if (mg <= mingap) {
mg = mingap * 1.5;
}
mingap = mg;
if (mingap > arg->mingap_out) {
arg->mingap_out = mingap;
arg->still_dropping = true;
Expand Down Expand Up @@ -1883,7 +1887,11 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
line_detail++; // to keep it the same when the loop decrements it
} else if (additional[A_DROP_DENSEST_AS_NEEDED]) {
mingap_fraction = mingap_fraction * max_tile_size / compressed.size() * 0.90;
mingap = choose_mingap(indices, mingap_fraction);
unsigned long long mg = choose_mingap(indices, mingap_fraction);
if (mg <= mingap) {
mg = mingap * 1.5;
}
mingap = mg;
if (mingap > arg->mingap_out) {
arg->mingap_out = mingap;
arg->still_dropping = true;
Expand Down Expand Up @@ -2272,7 +2280,7 @@ int traverse_zooms(int *geomfd, off_t *geom_size, char *metabase, char *stringpo
i = args[thread].wrote_zoom;
}

if (i == maxzoom && args[thread].still_dropping && maxzoom < MAX_ZOOM) {
if (additional[A_EXTEND_ZOOMS] && i == maxzoom && args[thread].still_dropping && maxzoom < MAX_ZOOM) {
maxzoom++;
}
}
Expand Down
2 changes: 1 addition & 1 deletion version.hpp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define VERSION "tippecanoe v1.19.0\n"
#define VERSION "tippecanoe v1.19.1\n"

0 comments on commit dba2495

Please sign in to comment.