Add the option not to limit the feature count at maxzoom

This commit is contained in:
Erica Fischer
2022-11-08 10:32:35 -08:00
parent f5bd2a7522
commit ace173ab7a
7 changed files with 741 additions and 2 deletions
+1
View File
@@ -528,6 +528,7 @@ the same layer, enclose them in an `all` expression so they will all be evaluate
* `-O` _features_ or `--maximum-tile-features=`_features_: Use the specified number of _features_ as the maximum in a tile instead of 200,000.
* `--maximum-tile-geometry=`_vertices_: Use the specified number of _vertices_ as the maximum in a tile.
* `-pf` or `--no-feature-limit`: Don't limit tiles to 200,000 features
* `-pF` or `--no-feature-limit-at-maximum-zoom`: Don't limit tiles to 200,000 features at the maximum zoom level, but do limit them at other zoom levels
* `-pk` or `--no-tile-size-limit`: Don't limit tiles to 500K bytes
* `-pC` or `--no-tile-compression`: Don't compress the PBF vector tile data. If you are getting "Unimplemented type 3" error messages from a renderer, it is probably because it expects uncompressed tiles using this option rather than the normal gzip-compressed tiles.
* `-pg` or `--no-tile-stats`: Don't generate the `tilestats` row in the tileset metadata. Uploads without [tilestats](https://github.com/mapbox/mapbox-geostats) will take longer to process.
-1
View File
@@ -1612,7 +1612,6 @@ drawvec polygon_to_anchor(const drawvec &geom) {
return drawvec();
}
static double dist(long long x1, long long y1, long long x2, long long y2) {
double dx = x2 - x1;
double dy = y2 - y1;
+1
View File
@@ -2813,6 +2813,7 @@ int main(int argc, char **argv) {
{"maximum-tile-features", required_argument, 0, 'O'},
{"maximum-tile-geometry", required_argument, 0, '~'},
{"no-feature-limit", no_argument, &prevent[P_FEATURE_LIMIT], 1},
{"no-feature-limit-at-maximum-zoom", no_argument, &prevent[P_FEATURE_LIMIT_MAXZOOM], 1},
{"no-tile-size-limit", no_argument, &prevent[P_KILOBYTE_LIMIT], 1},
{"no-tile-compression", no_argument, &prevent[P_TILE_COMPRESSION], 1},
{"no-tile-stats", no_argument, &prevent[P_TILE_STATS], 1},
+2
View File
@@ -689,6 +689,8 @@ the line or polygon within one tile unit of its proper location. You can probabl
.IP \(bu 2
\fB\fC\-pf\fR or \fB\fC\-\-no\-feature\-limit\fR: Don't limit tiles to 200,000 features
.IP \(bu 2
\fB\fC\-pF\fR or \fB\fC\-\-no\-feature\-limit\-at\-maximum\-zoom\fR: Don't limit tiles to 200,000 features at the maximum zoom level, but do limit them at other zoom levels
.IP \(bu 2
\fB\fC\-pk\fR or \fB\fC\-\-no\-tile\-size\-limit\fR: Don't limit tiles to 500K bytes
.IP \(bu 2
\fB\fC\-pC\fR or \fB\fC\-\-no\-tile\-compression\fR: Don't compress the PBF vector tile data. If you are getting "Unimplemented type 3" error messages from a renderer, it is probably because it expects uncompressed tiles using this option rather than the normal gzip\-compressed tiles.
+1
View File
@@ -32,6 +32,7 @@
#define P_SIMPLIFY_SHARED_NODES ((int) 'n')
#define P_SINGLE_PRECISION ((int) 'N')
#define P_FEATURE_LIMIT ((int) 'f')
#define P_FEATURE_LIMIT_MAXZOOM ((int) 'F')
#define P_KILOBYTE_LIMIT ((int) 'k')
#define P_DYNAMIC_DROP ((int) 'd')
#define P_INPUT_ORDER ((int) 'i')
File diff suppressed because one or more lines are too long
+2 -1
View File
@@ -2582,7 +2582,8 @@ long long write_tile(FILE *geoms, std::atomic<long long> *geompos_in, char *meta
}
}
if (totalsize > max_tile_features && !prevent[P_FEATURE_LIMIT]) {
if (totalsize > max_tile_features && !(prevent[P_FEATURE_LIMIT] ||
(z == maxzoom && prevent[P_FEATURE_LIMIT_MAXZOOM]))) {
if (totalsize > arg->feature_count_out) {
arg->feature_count_out = totalsize;
}