mirror of
https://github.com/felt/tippecanoe.git
synced 2026-11-24 17:31:19 +01:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fee56eaa51 | ||
|
|
0adcd22b95 | ||
|
|
42c4426e32 |
@@ -1188,37 +1188,6 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
|
||||
static const std::string retain_points_multiplier_sequence = "tippecanoe:retain_points_multiplier_sequence";
|
||||
|
||||
for (auto feature : layer.features) {
|
||||
bool flush_multiplier_cluster = false;
|
||||
if (demultiply) {
|
||||
for (ssize_t i = feature.tags.size() - 2; i >= 0; i -= 2) {
|
||||
if (layer.keys[feature.tags[i]] == retain_points_multiplier_first) {
|
||||
mvt_value v = layer.values[feature.tags[i + 1]];
|
||||
if (v.type == mvt_bool && v.numeric_value.bool_value) {
|
||||
flush_multiplier_cluster = true;
|
||||
feature.tags.erase(feature.tags.begin() + i, feature.tags.begin() + i + 2);
|
||||
}
|
||||
} else if (i < (ssize_t) feature.tags.size() && layer.keys[feature.tags[i]] == retain_points_multiplier_sequence) {
|
||||
mvt_value v = layer.values[feature.tags[i + 1]];
|
||||
feature.seq = mvt_value_to_long_long(v);
|
||||
feature.tags.erase(feature.tags.begin() + i, feature.tags.begin() + i + 2);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
flush_multiplier_cluster = true;
|
||||
}
|
||||
|
||||
if (flush_multiplier_cluster) {
|
||||
if (pending_tile_features.size() > 0) {
|
||||
feature_out(pending_tile_features, *outlayer, keep, attribute_accum, tile_stringpool);
|
||||
pending_tile_features.clear();
|
||||
}
|
||||
}
|
||||
|
||||
std::set<std::string> exclude_attributes;
|
||||
if (filter != NULL && !evaluate(feature, layer, filter, exclude_attributes, nz, unidecode_data)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
drawvec geom;
|
||||
int t = feature.type;
|
||||
|
||||
@@ -1268,6 +1237,7 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
|
||||
|
||||
long long b = outtilesize * buffer / 256;
|
||||
if (xmax < -b || ymax < -b || xmin > outtilesize + b || ymin > outtilesize + b) {
|
||||
// quick exclusion by bounding box
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1281,6 +1251,42 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
|
||||
}
|
||||
}
|
||||
|
||||
if (geom.size() == 0) {
|
||||
// clipped away
|
||||
continue;
|
||||
}
|
||||
|
||||
bool flush_multiplier_cluster = false;
|
||||
if (demultiply) {
|
||||
for (ssize_t i = feature.tags.size() - 2; i >= 0; i -= 2) {
|
||||
if (layer.keys[feature.tags[i]] == retain_points_multiplier_first) {
|
||||
mvt_value v = layer.values[feature.tags[i + 1]];
|
||||
if (v.type == mvt_bool && v.numeric_value.bool_value) {
|
||||
flush_multiplier_cluster = true;
|
||||
feature.tags.erase(feature.tags.begin() + i, feature.tags.begin() + i + 2);
|
||||
}
|
||||
} else if (i < (ssize_t) feature.tags.size() && layer.keys[feature.tags[i]] == retain_points_multiplier_sequence) {
|
||||
mvt_value v = layer.values[feature.tags[i + 1]];
|
||||
feature.seq = mvt_value_to_long_long(v);
|
||||
feature.tags.erase(feature.tags.begin() + i, feature.tags.begin() + i + 2);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
flush_multiplier_cluster = true;
|
||||
}
|
||||
|
||||
if (flush_multiplier_cluster) {
|
||||
if (pending_tile_features.size() > 0) {
|
||||
feature_out(pending_tile_features, *outlayer, keep, attribute_accum, tile_stringpool);
|
||||
pending_tile_features.clear();
|
||||
}
|
||||
}
|
||||
|
||||
std::set<std::string> exclude_attributes;
|
||||
if (filter != NULL && !evaluate(feature, layer, filter, exclude_attributes, nz, unidecode_data)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool still_need_simplification_after_reduction = false;
|
||||
if (t == VT_POLYGON && tiny_polygon_size > 0) {
|
||||
bool simplified_away_by_reduction = false;
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
@@ -1,14 +1,15 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "0.000000,85.051129,0.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",
|
||||
"format": "pbf",
|
||||
"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\":[]}]}}",
|
||||
"maxzoom": "14",
|
||||
"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": "0",
|
||||
"minzoom": "0",
|
||||
"name": "tests/raw-tiles/nothing",
|
||||
"tippecanoe_decisions": "{\"basezoom\":14,\"droprate\":2.5,\"retain_points_multiplier\":1}",
|
||||
"type": "overlay",
|
||||
"version": "2"
|
||||
}, "features": [
|
||||
|
||||
+4
-3
File diff suppressed because one or more lines are too long
@@ -2826,7 +2826,6 @@ exit(EXIT_IMPOSSIBLE);
|
||||
dc.begin();
|
||||
}
|
||||
|
||||
arg->wrote_zoom = z;
|
||||
long long len;
|
||||
|
||||
struct zxy parent(z - 1, x / 2, y / 2);
|
||||
@@ -2834,6 +2833,7 @@ exit(EXIT_IMPOSSIBLE);
|
||||
skip_tile(&dc, &geompos, arg->compressed);
|
||||
len = 1;
|
||||
} 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);
|
||||
}
|
||||
|
||||
@@ -2927,6 +2927,8 @@ int traverse_zooms(int *geomfd, off_t *geom_size, char *global_stringpool, std::
|
||||
std::set<zxy> skip_children;
|
||||
|
||||
int z;
|
||||
int largest_written = -1;
|
||||
|
||||
for (z = iz; z <= maxzoom; z++) {
|
||||
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) {
|
||||
z = args[thread].wrote_zoom;
|
||||
}
|
||||
if (args[thread].wrote_zoom > largest_written) {
|
||||
largest_written = args[thread].wrote_zoom;
|
||||
}
|
||||
|
||||
if (args[thread].still_dropping) {
|
||||
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++) {
|
||||
// Can be < 0 if there is only one source file, at z0
|
||||
if (geomfd[j] >= 0) {
|
||||
|
||||
Reference in New Issue
Block a user