mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 18:05:42 +02:00
Report the actual max zoom of any tiles as the metadata maxzoom
This commit is contained in:
+3
-3
File diff suppressed because one or more lines are too long
@@ -1,14 +1,15 @@
|
|||||||
{ "type": "FeatureCollection", "properties": {
|
{ "type": "FeatureCollection", "properties": {
|
||||||
"antimeridian_adjusted_bounds": "0.000000,85.051129,0.000000,85.051129",
|
"antimeridian_adjusted_bounds": "0.000000,85.051129,0.000000,85.051129",
|
||||||
"bounds": "-180.000000,85.051129,180.000000,85.051129",
|
"bounds": "-180.000000,85.051129,180.000000,85.051129",
|
||||||
"center": "-179.989014,85.051129,14",
|
"center": "0.000000,85.051129,0",
|
||||||
"description": "tests/raw-tiles/nothing",
|
"description": "tests/raw-tiles/nothing",
|
||||||
"format": "pbf",
|
"format": "pbf",
|
||||||
"generator_options": "./tippecanoe -q -f -e tests/raw-tiles/nothing tests/raw-tiles/nothing.geojson",
|
"generator_options": "./tippecanoe -q -f -e tests/raw-tiles/nothing tests/raw-tiles/nothing.geojson",
|
||||||
"json": "{\"vector_layers\":[{\"id\":\"nothing\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":14,\"fields\":{}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"nothing\",\"count\":1,\"geometry\":\"Point\",\"attributeCount\":0,\"attributes\":[]}]}}",
|
"json": "{\"vector_layers\":[{\"id\":\"nothing\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"nothing\",\"count\":1,\"geometry\":\"Point\",\"attributeCount\":0,\"attributes\":[]}]}}",
|
||||||
"maxzoom": "14",
|
"maxzoom": "0",
|
||||||
"minzoom": "0",
|
"minzoom": "0",
|
||||||
"name": "tests/raw-tiles/nothing",
|
"name": "tests/raw-tiles/nothing",
|
||||||
|
"tippecanoe_decisions": "{\"basezoom\":14,\"droprate\":2.5,\"retain_points_multiplier\":1}",
|
||||||
"type": "overlay",
|
"type": "overlay",
|
||||||
"version": "2"
|
"version": "2"
|
||||||
}, "features": [
|
}, "features": [
|
||||||
|
|||||||
+4
-3
File diff suppressed because one or more lines are too long
@@ -2826,7 +2826,6 @@ exit(EXIT_IMPOSSIBLE);
|
|||||||
dc.begin();
|
dc.begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
arg->wrote_zoom = z;
|
|
||||||
long long len;
|
long long len;
|
||||||
|
|
||||||
struct zxy parent(z - 1, x / 2, y / 2);
|
struct zxy parent(z - 1, x / 2, y / 2);
|
||||||
@@ -2834,6 +2833,7 @@ exit(EXIT_IMPOSSIBLE);
|
|||||||
skip_tile(&dc, &geompos, arg->compressed);
|
skip_tile(&dc, &geompos, arg->compressed);
|
||||||
len = 1;
|
len = 1;
|
||||||
} else {
|
} else {
|
||||||
|
arg->wrote_zoom = z;
|
||||||
len = write_tile(&dc, &geompos, arg->global_stringpool, z, x, y, z == arg->maxzoom ? arg->full_detail : arg->low_detail, arg->min_detail, arg->outdb, arg->outdir, arg->buffer, arg->fname, arg->geomfile, arg->geompos, arg->minzoom, arg->maxzoom, arg->todo, arg->along, geompos, arg->gamma, arg->child_shards, arg->pool_off, arg->initial_x, arg->initial_y, arg->running, arg->simplification, arg->layermaps, arg->layer_unmaps, arg->tiling_seg, arg->pass, arg->mingap, arg->minextent, arg->mindrop_sequence, arg->prefilter, arg->postfilter, arg->filter, arg, arg->strategy, arg->compressed, arg->shared_nodes_map, arg->nodepos, *(arg->shared_nodes_bloom), (*arg->unidecode_data), estimated_complexity, arg->skip_children_out);
|
len = write_tile(&dc, &geompos, arg->global_stringpool, z, x, y, z == arg->maxzoom ? arg->full_detail : arg->low_detail, arg->min_detail, arg->outdb, arg->outdir, arg->buffer, arg->fname, arg->geomfile, arg->geompos, arg->minzoom, arg->maxzoom, arg->todo, arg->along, geompos, arg->gamma, arg->child_shards, arg->pool_off, arg->initial_x, arg->initial_y, arg->running, arg->simplification, arg->layermaps, arg->layer_unmaps, arg->tiling_seg, arg->pass, arg->mingap, arg->minextent, arg->mindrop_sequence, arg->prefilter, arg->postfilter, arg->filter, arg, arg->strategy, arg->compressed, arg->shared_nodes_map, arg->nodepos, *(arg->shared_nodes_bloom), (*arg->unidecode_data), estimated_complexity, arg->skip_children_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2927,6 +2927,8 @@ int traverse_zooms(int *geomfd, off_t *geom_size, char *global_stringpool, std::
|
|||||||
std::set<zxy> skip_children;
|
std::set<zxy> skip_children;
|
||||||
|
|
||||||
int z;
|
int z;
|
||||||
|
int largest_written = -1;
|
||||||
|
|
||||||
for (z = iz; z <= maxzoom; z++) {
|
for (z = iz; z <= maxzoom; z++) {
|
||||||
std::atomic<long long> most(0);
|
std::atomic<long long> most(0);
|
||||||
|
|
||||||
@@ -3146,6 +3148,9 @@ int traverse_zooms(int *geomfd, off_t *geom_size, char *global_stringpool, std::
|
|||||||
if (args[thread].wrote_zoom > z) {
|
if (args[thread].wrote_zoom > z) {
|
||||||
z = args[thread].wrote_zoom;
|
z = args[thread].wrote_zoom;
|
||||||
}
|
}
|
||||||
|
if (args[thread].wrote_zoom > largest_written) {
|
||||||
|
largest_written = args[thread].wrote_zoom;
|
||||||
|
}
|
||||||
|
|
||||||
if (args[thread].still_dropping) {
|
if (args[thread].still_dropping) {
|
||||||
extend_zooms = true;
|
extend_zooms = true;
|
||||||
@@ -3208,6 +3213,10 @@ int traverse_zooms(int *geomfd, off_t *geom_size, char *global_stringpool, std::
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (largest_written >= 0 && maxzoom > largest_written) {
|
||||||
|
maxzoom = largest_written;
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t j = 0; j < TEMP_FILES; j++) {
|
for (size_t j = 0; j < TEMP_FILES; j++) {
|
||||||
// Can be < 0 if there is only one source file, at z0
|
// Can be < 0 if there is only one source file, at z0
|
||||||
if (geomfd[j] >= 0) {
|
if (geomfd[j] >= 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user