diff --git a/README.md b/README.md index 74f23071..95946d3b 100644 --- a/README.md +++ b/README.md @@ -494,6 +494,7 @@ the same layer, enclose them in an `all` expression so they will all be evaluate * `--simplification-at-maximum-zoom=`_scale_: Use the specified _scale_ at maxzoom instead of the standard simplification scale (which still applies at lower zooms) * `-pn` or `--no-simplification-of-shared-nodes`: Don't simplify away nodes that appear in more than one feature or are used multiple times within the same feature, so that the intersection node will not be lost from intersecting roads. (This will not be effective if you also use `--coalesce` or `--detect-shared-borders`.) * `-pt` or `--no-tiny-polygon-reduction`: Don't combine the area of very small polygons into small squares that represent their combined area. + * `-pT` or `--no-tiny-polygon-reduction-at-maximum-zoom`: Combine the area of very small polygons into small squares that represent their combined area only at zoom levels below the maximum. * `--tiny-polygon-size=`_size_: Use the specified _size_ for tiny polygons instead of the default 2. Anything above 6 or so will lead to visible artifacts with the default tile detail. * `-av` or `--visvalingam`: Use Visvalingam's simplification algorithm rather than Douglas-Peucker's. diff --git a/main.cpp b/main.cpp index 4980df94..51028168 100644 --- a/main.cpp +++ b/main.cpp @@ -2952,6 +2952,7 @@ int main(int argc, char **argv) { {"simplify-only-low-zooms", no_argument, &prevent[P_SIMPLIFY_LOW], 1}, {"simplification-at-maximum-zoom", required_argument, 0, '~'}, {"no-tiny-polygon-reduction", no_argument, &prevent[P_TINY_POLYGON_REDUCTION], 1}, + {"no-tiny-polygon-reduction-at-maximum-zoom", no_argument, &prevent[P_TINY_POLYGON_REDUCTION_AT_MAXZOOM], 1}, {"tiny-polygon-size", required_argument, 0, '~'}, {"no-simplification-of-shared-nodes", no_argument, &prevent[P_SIMPLIFY_SHARED_NODES], 1}, {"visvalingam", no_argument, &additional[A_VISVALINGAM], 1}, diff --git a/man/tippecanoe.1 b/man/tippecanoe.1 index 6cf89c8c..6e699f91 100644 --- a/man/tippecanoe.1 +++ b/man/tippecanoe.1 @@ -27,7 +27,11 @@ see the shape and relative popularity of every point of interest and every significant travel corridor. .SH Installation .PP -For this fork you will need to build from the source repository: +The easiest way to install tippecanoe on OSX is with Homebrew \[la]http://brew.sh/\[ra]: +.PP +$ brew install tippecanoe +.PP +On Ubuntu it will usually be easiest to build from the source repository: .PP .RS .nf @@ -629,6 +633,8 @@ the line or polygon within one tile unit of its proper location. You can probabl .IP \(bu 2 \fB\fC\-pt\fR or \fB\fC\-\-no\-tiny\-polygon\-reduction\fR: Don't combine the area of very small polygons into small squares that represent their combined area. .IP \(bu 2 +\fB\fC\-pT\fR or \fB\fC\-\-no\-tiny\-polygon\-reduction\-at\-maximum\-zoom\fR: Combine the area of very small polygons into small squares that represent their combined area only at zoom levels below the maximum. +.IP \(bu 2 \fB\fC\-\-tiny\-polygon\-size=\fR\fIsize\fP: Use the specified \fIsize\fP for tiny polygons instead of the default 2. Anything above 6 or so will lead to visible artifacts with the default tile detail. .IP \(bu 2 \fB\fC\-av\fR or \fB\fC\-\-visvalingam\fR: Use Visvalingam's simplification algorithm rather than Douglas\-Peucker's. diff --git a/options.hpp b/options.hpp index cb3f2578..c56c5fcd 100644 --- a/options.hpp +++ b/options.hpp @@ -39,6 +39,7 @@ #define P_CLIPPING ((int) 'c') #define P_DUPLICATION ((int) 'D') #define P_TINY_POLYGON_REDUCTION ((int) 't') +#define P_TINY_POLYGON_REDUCTION_AT_MAXZOOM ((int) 'T') #define P_TILE_COMPRESSION ((int) 'C') #define P_TILE_STATS ((int) 'g') #define P_USE_SOURCE_POLYGON_WINDING ((int) 'w') diff --git a/tile.cpp b/tile.cpp index dda92506..2ac8b771 100644 --- a/tile.cpp +++ b/tile.cpp @@ -2184,7 +2184,9 @@ long long write_tile(decompressor *geoms, std::atomic *geompos_in, ch bool reduced = false; if (sf.t == VT_POLYGON) { - if (!prevent[P_TINY_POLYGON_REDUCTION] && !additional[A_GRID_LOW_ZOOMS]) { + bool prevent_tiny = prevent[P_TINY_POLYGON_REDUCTION] || + (prevent[P_TINY_POLYGON_REDUCTION_AT_MAXZOOM] && z == maxzoom); + if (!prevent_tiny && !additional[A_GRID_LOW_ZOOMS]) { sf.geometry = reduce_tiny_poly(sf.geometry, z, line_detail, &reduced, &accum_area, &sf, &tiny_feature); if (reduced) { strategy->tiny_polygons++;