Add an option to drop a fraction of polygons by zoom.

Only warn once about polygon cleaning failures.
This commit is contained in:
Eric Fischer
2016-04-06 14:17:44 -07:00
parent d1456c0f66
commit 574a2b79c8
9 changed files with 2587 additions and 3 deletions
+5
View File
@@ -1,3 +1,8 @@
## 1.9.9
* Add --drop-polygons to drop a fraction of polygons by zoom level
* Only complain once about failing to clean polygons
## 1.9.8 ## 1.9.8
* Use an on-disk radix sort for the index to control virtual memory thrashing * Use an on-disk radix sort for the index to control virtual memory thrashing
+1
View File
@@ -113,6 +113,7 @@ resolution is obtained than by using a smaller _maxzoom_ or _detail_.
* -ar or --reverse: Try reversing the directions of lines to make them coalesce and compress better * -ar or --reverse: Try reversing the directions of lines to make them coalesce and compress better
* -ao or --reorder: Reorder features to put ones with the same properties in sequence, to try to get them to coalesce * -ao or --reorder: Reorder features to put ones with the same properties in sequence, to try to get them to coalesce
* -al or --drop-lines: Let "dot" dropping at lower zooms apply to lines too * -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
### Doing less ### Doing less
+1
View File
@@ -2396,6 +2396,7 @@ int main(int argc, char **argv) {
{"reverse", no_argument, &additional[A_REVERSE], 1}, {"reverse", no_argument, &additional[A_REVERSE], 1},
{"reorder", no_argument, &additional[A_REORDER], 1}, {"reorder", no_argument, &additional[A_REORDER], 1},
{"drop-lines", no_argument, &additional[A_LINE_DROP], 1}, {"drop-lines", no_argument, &additional[A_LINE_DROP], 1},
{"drop-polygons", no_argument, &additional[A_POLYGON_DROP], 1},
{"prefer-radix-sort", no_argument, &additional[A_PREFER_RADIX_SORT], 1}, {"prefer-radix-sort", no_argument, &additional[A_PREFER_RADIX_SORT], 1},
{"no-line-simplification", no_argument, &prevent[P_SIMPLIFY], 1}, {"no-line-simplification", no_argument, &prevent[P_SIMPLIFY], 1},
+6 -1
View File
@@ -311,7 +311,12 @@ drawvec clean_or_clip_poly(drawvec &geom, int z, int detail, int buffer, bool cl
} }
if (!clipper.Execute(ClipperLib::ctUnion, clipped)) { if (!clipper.Execute(ClipperLib::ctUnion, clipped)) {
fprintf(stderr, "Polygon clean failed\n"); static bool complained = false;
if (!complained) {
fprintf(stderr, "Polygon clean failed\n");
complained = true;
}
} }
} }
+2
View File
@@ -138,6 +138,8 @@ compensate for the larger marker, or \-rf\fInumber\fP to allow at most \fInumber
\-ao or \-\-reorder: Reorder features to put ones with the same properties in sequence, to try to get them to coalesce \-ao or \-\-reorder: Reorder features to put ones with the same properties in sequence, to try to get them to coalesce
.IP \(bu 2 .IP \(bu 2
\-al or \-\-drop\-lines: Let "dot" dropping at lower zooms apply to lines too \-al or \-\-drop\-lines: Let "dot" dropping at lower zooms apply to lines too
.IP \(bu 2
\-ap or \-\-drop\-polygons: Let "dot" dropping at lower zooms apply to polygons too
.RE .RE
.SS Doing less .SS Doing less
.RS .RS
File diff suppressed because one or more lines are too long
+3 -1
View File
@@ -793,7 +793,9 @@ long long write_tile(char **geoms, char *metabase, char *stringpool, int z, unsi
continue; continue;
} }
if (gamma >= 0 && (t == VT_POINT || (additional[A_LINE_DROP] && t == VT_LINE))) { if (gamma >= 0 && (t == VT_POINT ||
(additional[A_LINE_DROP] && t == VT_LINE) ||
(additional[A_POLYGON_DROP] && t == VT_POLYGON))) {
seq++; seq++;
if (seq >= 0) { if (seq >= 0) {
seq -= interval; seq -= interval;
+2
View File
@@ -46,6 +46,8 @@ static int additional_options[] = {
A_REORDER, A_REORDER,
#define A_LINE_DROP ((int) 'l') #define A_LINE_DROP ((int) 'l')
A_LINE_DROP, A_LINE_DROP,
#define A_POLYGON_DROP ((int) 'p')
A_POLYGON_DROP,
#define A_PREFER_RADIX_SORT ((int) 'r') #define A_PREFER_RADIX_SORT ((int) 'r')
A_PREFER_RADIX_SORT, A_PREFER_RADIX_SORT,
}; };
+1 -1
View File
@@ -1 +1 @@
#define VERSION "tippecanoe v1.9.8\n" #define VERSION "tippecanoe v1.9.9\n"