mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-03 17:05:41 +02:00
Add an option to produce only a single tile
This commit is contained in:
@@ -71,6 +71,7 @@ double simplification = 1;
|
||||
size_t max_tile_size = 500000;
|
||||
size_t max_tile_features = 200000;
|
||||
int cluster_distance = 0;
|
||||
long justx = -1, justy = -1;
|
||||
|
||||
int prevent[256];
|
||||
int additional[256];
|
||||
@@ -1774,6 +1775,12 @@ int read_input(std::vector<source> &sources, char *fname, int maxzoom, int minzo
|
||||
unsigned iz = 0, ix = 0, iy = 0;
|
||||
choose_first_zoom(file_bbox, readers, &iz, &ix, &iy, minzoom, buffer);
|
||||
|
||||
if (justx >= 0) {
|
||||
iz = minzoom;
|
||||
ix = justx;
|
||||
iy = justy;
|
||||
}
|
||||
|
||||
long long geompos = 0;
|
||||
|
||||
/* initial tile is 0/0/0 */
|
||||
@@ -2312,6 +2319,7 @@ int main(int argc, char **argv) {
|
||||
{"maximum-zoom", required_argument, 0, 'z'},
|
||||
{"minimum-zoom", required_argument, 0, 'Z'},
|
||||
{"extend-zooms-if-still-dropping", no_argument, &additional[A_EXTEND_ZOOMS], 1},
|
||||
{"one-tile", required_argument, 0, 'R'},
|
||||
|
||||
{"Tile resolution", 0, 0, 0},
|
||||
{"full-detail", required_argument, 0, 'd'},
|
||||
@@ -2489,6 +2497,19 @@ int main(int argc, char **argv) {
|
||||
minzoom = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'R': {
|
||||
unsigned z, x, y;
|
||||
if (sscanf(optarg, "%u/%u/%u", &z, &x, &y) == 3) {
|
||||
minzoom = z;
|
||||
maxzoom = z;
|
||||
justx = x;
|
||||
justy = y;
|
||||
} else {
|
||||
fprintf(stderr, "--one-tile argument must be z/x/y\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
case 'B':
|
||||
if (strcmp(optarg, "g") == 0) {
|
||||
basezoom = -2;
|
||||
|
||||
Reference in New Issue
Block a user