mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 16:35:40 +02:00
Add the command-line option to specify the filter
This commit is contained in:
@@ -943,7 +943,7 @@ void radix(struct reader *reader, int nreaders, FILE *geomfile, int geomfd, FILE
|
||||
}
|
||||
}
|
||||
|
||||
int read_input(std::vector<source> &sources, char *fname, const char *layername, int maxzoom, int minzoom, int basezoom, double basezoom_marker_width, sqlite3 *outdb, std::set<std::string> *exclude, std::set<std::string> *include, int exclude_all, double droprate, int buffer, const char *tmpdir, double gamma, int read_parallel, int forcetable, const char *attribution, bool uses_gamma) {
|
||||
int read_input(std::vector<source> &sources, char *fname, const char *layername, int maxzoom, int minzoom, int basezoom, double basezoom_marker_width, sqlite3 *outdb, std::set<std::string> *exclude, std::set<std::string> *include, int exclude_all, double droprate, int buffer, const char *tmpdir, double gamma, int read_parallel, int forcetable, const char *attribution, bool uses_gamma, const char *filter) {
|
||||
int ret = EXIT_SUCCESS;
|
||||
|
||||
struct reader reader[CPUS];
|
||||
@@ -1725,7 +1725,7 @@ int read_input(std::vector<source> &sources, char *fname, const char *layername,
|
||||
}
|
||||
|
||||
unsigned midx = 0, midy = 0;
|
||||
int written = traverse_zooms(fd, size, meta, stringpool, &midx, &midy, maxzoom, minzoom, basezoom, outdb, droprate, buffer, fname, tmpdir, gamma, full_detail, low_detail, min_detail, meta_off, pool_off, initial_x, initial_y, simplification, layermaps);
|
||||
int written = traverse_zooms(fd, size, meta, stringpool, &midx, &midy, maxzoom, minzoom, basezoom, outdb, droprate, buffer, fname, tmpdir, gamma, full_detail, low_detail, min_detail, meta_off, pool_off, initial_x, initial_y, simplification, layermaps, filter);
|
||||
|
||||
if (maxzoom != written) {
|
||||
fprintf(stderr, "\n\n\n*** NOTE TILES ONLY COMPLETE THROUGH ZOOM %d ***\n\n\n", written);
|
||||
@@ -1864,6 +1864,7 @@ int main(int argc, char **argv) {
|
||||
const char *tmpdir = "/tmp";
|
||||
const char *attribution = NULL;
|
||||
std::vector<source> sources;
|
||||
const char *filter = NULL;
|
||||
|
||||
std::set<std::string> exclude, include;
|
||||
int exclude_all = 0;
|
||||
@@ -1899,6 +1900,7 @@ int main(int argc, char **argv) {
|
||||
{"projection", required_argument, 0, 's'},
|
||||
{"simplification", required_argument, 0, 'S'},
|
||||
{"maximum-tile-bytes", required_argument, 0, 'M'},
|
||||
{"filter", required_argument, 0, 'c'},
|
||||
|
||||
{"exclude-all", no_argument, 0, 'X'},
|
||||
{"force", no_argument, 0, 'f'},
|
||||
@@ -1954,7 +1956,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
while ((i = getopt_long(argc, argv, "n:l:z:Z:B:d:D:m:o:x:y:r:b:t:g:p:a:XfFqvPL:A:s:S:M:", long_options, NULL)) != -1) {
|
||||
while ((i = getopt_long(argc, argv, "n:l:z:Z:B:d:D:m:o:x:y:r:b:t:g:p:a:XfFqvPL:A:s:S:M:c:", long_options, NULL)) != -1) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
break;
|
||||
@@ -2137,6 +2139,10 @@ int main(int argc, char **argv) {
|
||||
max_tile_size = atoll(optarg);
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
filter = optarg;
|
||||
break;
|
||||
|
||||
default: {
|
||||
int width = 7 + strlen(argv[0]);
|
||||
fprintf(stderr, "Unknown option -%c\n", i);
|
||||
@@ -2237,7 +2243,7 @@ int main(int argc, char **argv) {
|
||||
sources.push_back(src);
|
||||
}
|
||||
|
||||
ret = read_input(sources, name ? name : outdir, layer, maxzoom, minzoom, basezoom, basezoom_marker_width, outdb, &exclude, &include, exclude_all, droprate, buffer, tmpdir, gamma, read_parallel, forcetable, attribution, gamma != 0);
|
||||
ret = read_input(sources, name ? name : outdir, layer, maxzoom, minzoom, basezoom, basezoom_marker_width, outdb, &exclude, &include, exclude_all, droprate, buffer, tmpdir, gamma, read_parallel, forcetable, attribution, gamma != 0, filter);
|
||||
|
||||
mbtiles_close(outdb, argv);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user