Add an option to produce only a single tile

This commit is contained in:
Eric Fischer 2018-01-26 12:41:30 -08:00
parent 7ab94d43c6
commit 17942b3a89
6 changed files with 85 additions and 1 deletions

View File

@ -1,3 +1,7 @@
## 1.27.7
* Add an option to produce only a single tile
## 1.27.6
* Fix opportunities for integer overflow and out-of-bounds references

View File

@ -162,6 +162,8 @@ Parallel processing will also be automatic if the input file is in Geobuf format
* `-ae` or `--extend-zooms-if-still-dropping`: Increase the maxzoom if features are still being dropped at that zoom level.
The detail and simplification options that ordinarily apply only to the maximum zoom level will apply both to the originally
specified maximum zoom and to any levels added beyond that.
* `-R` _zoom_`/`_x_`/`_y_ or `--one-tile=`_zoom_`/`_x_`/`_y_: Set the minzoom and maxzoom to _zoom_ and produce only
the single specified tile at that zoom level.
### Tile resolution

View File

@ -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;

View File

@ -176,6 +176,9 @@ Parallel processing will also be automatic if the input file is in Geobuf format
\fB\fC\-ae\fR or \fB\fC\-\-extend\-zooms\-if\-still\-dropping\fR: Increase the maxzoom if features are still being dropped at that zoom level.
The detail and simplification options that ordinarily apply only to the maximum zoom level will apply both to the originally
specified maximum zoom and to any levels added beyond that.
.IP \(bu 2
\fB\fC\-R\fR \fIzoom\fP\fB\fC/\fR\fIx\fP\fB\fC/\fR\fIy\fP or \fB\fC\-\-one\-tile=\fR\fIzoom\fP\fB\fC/\fR\fIx\fP\fB\fC/\fR\fIy\fP: Set the minzoom and maxzoom to \fIzoom\fP and produce only
the single specified tile at that zoom level.
.RE
.SS Tile resolution
.RS

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
#ifndef VERSION_HPP
#define VERSION_HPP
#define VERSION "tippecanoe v1.27.6\n"
#define VERSION "tippecanoe v1.27.7\n"
#endif