Merge pull request #206 from mapbox/chatty-polygon

Add an option to drop a fraction of polygons by zoom.
This commit is contained in:
Eric Fischer 2016-04-06 14:33:48 -07:00
commit 22ede9ac8c
9 changed files with 2587 additions and 3 deletions

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
* Use an on-disk radix sort for the index to control virtual memory thrashing

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
* -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
* -ap or --drop-polygons: Let "dot" dropping at lower zooms apply to polygons too
### Doing less

View File

@ -2396,6 +2396,7 @@ int main(int argc, char **argv) {
{"reverse", no_argument, &additional[A_REVERSE], 1},
{"reorder", no_argument, &additional[A_REORDER], 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},
{"no-line-simplification", no_argument, &prevent[P_SIMPLIFY], 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)) {
fprintf(stderr, "Polygon clean failed\n");
static bool complained = false;
if (!complained) {
fprintf(stderr, "Polygon clean failed\n");
complained = true;
}
}
}

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
.IP \(bu 2
\-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
.SS Doing less
.RS

File diff suppressed because one or more lines are too long

View File

@ -793,7 +793,9 @@ long long write_tile(char **geoms, char *metabase, char *stringpool, int z, unsi
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++;
if (seq >= 0) {
seq -= interval;

2
tile.h
View File

@ -46,6 +46,8 @@ static int additional_options[] = {
A_REORDER,
#define A_LINE_DROP ((int) 'l')
A_LINE_DROP,
#define A_POLYGON_DROP ((int) 'p')
A_POLYGON_DROP,
#define A_PREFER_RADIX_SORT ((int) 'r')
A_PREFER_RADIX_SORT,
};

View File

@ -1 +1 @@
#define VERSION "tippecanoe v1.9.8\n"
#define VERSION "tippecanoe v1.9.9\n"