From dc9e68b128d3fc56a91e76e3eac7a62bfa292769 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Thu, 17 Nov 2016 12:40:11 -0800 Subject: [PATCH] Make feature-dropping option names a little more consistent --- README.md | 2 +- geojson.cpp | 2 +- main.cpp | 2 +- man/tippecanoe.1 | 2 +- options.hpp | 2 +- tile.cpp | 8 ++++---- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 58d4f91..0c9fa25 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ resolution is obtained than by using a smaller _maxzoom_ or _detail_. * -ab or --detect-shared-borders: In the manner of [TopoJSON](https://github.com/mbostock/topojson/wiki/Introduction), detect borders that are shared between multiple polygons and simplify them identically in each polygon. This takes more time and memory than considering each polygon individually. * -aG or --increase-gamma-as-needed: If a tile is too large, try to reduce it to under 500K by increasing the `-g` gamma. The discovered gamma applies to the entire zoom level. * -am or --merge-polygons-as-needed: If a tile is too large, try to reduce it to under 500K by merging adjacent polygons together - * -as or --increase-spacing-as-needed: If a tile is too large, try to reduce it to under 500K by increasing the minimum spacing between features. The discovered spacing applies to the entire zoom level. + * -as or --drop-densest-as-needed: If a tile is too large, try to reduce it to under 500K by increasing the minimum spacing between features. The discovered spacing applies to the entire zoom level. * -ad or --drop-fraction-as-needed: Dynamically drop some fraction of features from each zoom level to keep large tiles under the 500K size limit. (This is like `-pd` but applies to the entire zoom level, not to each tile.) * -an or --drop-smallest-as-needed: Dynamically drop the smallest features (physically smallest: the shortest lines or the smallest polygons) from each zoom level to keep large tiles under the 500K size limit. This option will not work for point features. diff --git a/geojson.cpp b/geojson.cpp index c5b8e93..c04e2b8 100644 --- a/geojson.cpp +++ b/geojson.cpp @@ -421,7 +421,7 @@ int serialize_geometry(json_object *geometry, json_object *properties, json_obje long long midy = (bbox[1] / 2 + bbox[3] / 2) & ((1LL << 32) - 1); bbox_index = encode(midx, midy); - if (additional[A_INCREASE_SPACING_AS_NEEDED] || additional[A_CALCULATE_FEATURE_DENSITY] || additional[A_INCREASE_GAMMA_AS_NEEDED] || uses_gamma) { + if (additional[A_DROP_DENSEST_AS_NEEDED] || additional[A_CALCULATE_FEATURE_DENSITY] || additional[A_INCREASE_GAMMA_AS_NEEDED] || uses_gamma) { sf.index = bbox_index; } diff --git a/main.cpp b/main.cpp index 562004e..6b135a8 100644 --- a/main.cpp +++ b/main.cpp @@ -1918,7 +1918,7 @@ int main(int argc, char **argv) { {"detect-shared-borders", no_argument, &additional[A_DETECT_SHARED_BORDERS], 1}, {"increase-gamma-as-needed", no_argument, &additional[A_INCREASE_GAMMA_AS_NEEDED], 1}, {"merge-polygons-as-needed", no_argument, &additional[A_MERGE_POLYGONS_AS_NEEDED], 1}, - {"increase-spacing-as-needed", no_argument, &additional[A_INCREASE_SPACING_AS_NEEDED], 1}, + {"drop-densest-as-needed", no_argument, &additional[A_DROP_DENSEST_AS_NEEDED], 1}, {"drop-fraction-as-needed", no_argument, &additional[A_DROP_FRACTION_AS_NEEDED], 1}, {"drop-smallest-as-needed", no_argument, &additional[A_DROP_SMALLEST_AS_NEEDED], 1}, diff --git a/man/tippecanoe.1 b/man/tippecanoe.1 index 6e4915e..e5d69e4 100644 --- a/man/tippecanoe.1 +++ b/man/tippecanoe.1 @@ -157,7 +157,7 @@ which may not be what you want. .IP \(bu 2 \-am or \-\-merge\-polygons\-as\-needed: If a tile is too large, try to reduce it to under 500K by merging adjacent polygons together .IP \(bu 2 -\-as or \-\-increase\-spacing\-as\-needed: If a tile is too large, try to reduce it to under 500K by increasing the minimum spacing between features. The discovered spacing applies to the entire zoom level. +\-as or \-\-drop\-densest\-as\-needed: If a tile is too large, try to reduce it to under 500K by increasing the minimum spacing between features. The discovered spacing applies to the entire zoom level. .IP \(bu 2 \-ad or \-\-drop\-fraction\-as\-needed: Dynamically drop some fraction of features from each zoom level to keep large tiles under the 500K size limit. (This is like \fB\fC\-pd\fR but applies to the entire zoom level, not to each tile.) .IP \(bu 2 diff --git a/options.hpp b/options.hpp index 5c5b7af..b02bdba 100644 --- a/options.hpp +++ b/options.hpp @@ -9,7 +9,7 @@ #define A_CALCULATE_FEATURE_DENSITY ((int) 'g') #define A_INCREASE_GAMMA_AS_NEEDED ((int) 'G') #define A_MERGE_POLYGONS_AS_NEEDED ((int) 'm') -#define A_INCREASE_SPACING_AS_NEEDED ((int) 's') +#define A_DROP_DENSEST_AS_NEEDED ((int) 's') #define A_DROP_FRACTION_AS_NEEDED ((int) 'd') #define A_DROP_SMALLEST_AS_NEEDED ((int) 'n') diff --git a/tile.cpp b/tile.cpp index 3b782d0..3996de6 100644 --- a/tile.cpp +++ b/tile.cpp @@ -1480,7 +1480,7 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s } } - if (additional[A_INCREASE_SPACING_AS_NEEDED]) { + if (additional[A_DROP_DENSEST_AS_NEEDED]) { indices.push_back(index); if (index - merge_previndex < mingap) { continue; @@ -1792,7 +1792,7 @@ 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 continue; - } else if (additional[A_INCREASE_SPACING_AS_NEEDED]) { + } else if (additional[A_DROP_DENSEST_AS_NEEDED]) { mingap_fraction = mingap_fraction * 200000.0 / totalsize * 0.90; mingap = choose_mingap(indices, mingap_fraction); if (mingap > arg->mingap_out) { @@ -1858,7 +1858,7 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s fprintf(stderr, "Going to try gamma of %0.3f to make it fit\n", gamma); } line_detail++; // to keep it the same when the loop decrements it - } else if (additional[A_INCREASE_SPACING_AS_NEEDED]) { + } 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); if (mingap > arg->mingap_out) { @@ -2140,7 +2140,7 @@ int traverse_zooms(int *geomfd, off_t *geom_size, char *metabase, char *stringpo int err = INT_MAX; size_t start = 1; - if (additional[A_INCREASE_GAMMA_AS_NEEDED] || additional[A_INCREASE_SPACING_AS_NEEDED] || additional[A_DROP_FRACTION_AS_NEEDED] || additional[A_DROP_SMALLEST_AS_NEEDED]) { + if (additional[A_INCREASE_GAMMA_AS_NEEDED] || additional[A_DROP_DENSEST_AS_NEEDED] || additional[A_DROP_FRACTION_AS_NEEDED] || additional[A_DROP_SMALLEST_AS_NEEDED]) { start = 0; }