mirror of
https://github.com/felt/tippecanoe.git
synced 2026-11-28 19:31:19 +01:00
Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8780064cde | ||
|
|
6dd49be6c9 | ||
|
|
c2a973d8f6 | ||
|
|
8ac730718a | ||
|
|
5d01a067aa | ||
|
|
355cc31d5b | ||
|
|
9d00c92ff2 |
+5
-5
@@ -1,19 +1,19 @@
|
||||
## [Visualizing a Month of Lightning](http://rousseau.io/2015/03/23/visualizing-a-month-of-lightning) by Jordan Rousseau
|
||||
## [Visualizing a Month of Lightning](https://medium.com/@jvrousseau/visualizing-a-month-of-lightning-8ab63d040d8c) by Jordan Rousseau
|
||||
|
||||

|
||||
|
||||
## [Making the most detailed tweet map ever](https://www.mapbox.com/blog/twitter-map-every-tweet/) by Eric Fischer
|
||||
## [Making the most detailed tweet map ever](https://web.archive.org/web/20161220144946/https://www.mapbox.com/blog/twitter-map-every-tweet/) by Eric Fischer
|
||||
|
||||

|
||||
|
||||
## [Superpowering Runkeeper's 1.5 million walks, runs, and bike rides](https://www.mapbox.com/blog/runkeeper-million-routes/)
|
||||
## [Superpowering Runkeeper's 1.5 million walks, runs, and bike rides](https://web.archive.org/web/20161219225305/https://www.mapbox.com/blog/runkeeper-million-routes/)
|
||||
|
||||

|
||||
|
||||
## [The Geotaggers' World Atlas](https://www.mapbox.com/blog/geotaggers-world-atlas/) by Eric Fischer
|
||||
## [The Geotaggers' World Atlas](https://web.archive.org/web/20170319084321/https://www.mapbox.com/blog/geotaggers-world-atlas/) by Eric Fischer
|
||||
|
||||

|
||||
|
||||
## [Atmospheric River](https://www.mapbox.com/blog/atmospheric-river/)
|
||||
## [Atmospheric River](https://web.archive.org/web/20161011171030/https://www.mapbox.com/blog/atmospheric-river/)
|
||||
|
||||

|
||||
|
||||
@@ -418,7 +418,6 @@ be reduced to the maximum that can be used with the specified _maxzoom_.
|
||||
`sum`, `product`, `mean`, `max`, `min`, `concat`, or `comma`
|
||||
to specify how the named _attribute_ is accumulated onto the attribute of the same name in a feature that does survive.
|
||||
The attributes and operations may also be specified as JSON keys and values: `--accumulate-attribute='{"attr": "operation", "attr2": "operation2"}'`.
|
||||
* `--accumulate-numeric-attributes` _prefix_: Accumulate sum, count, min, and max for all numeric attributes into new attributes with the specified _prefix_.
|
||||
* `--set-attribute` _attribute_`:`_value_: Set the value of the specified _attribute_ in each feature to the specified _value_. This is mostly useful to give an attribute in each feature an initial value for `--accumulate-attribute`.
|
||||
The attributes and values may also be specified as JSON keys and values: `--set-attribute='{"attr": value, "attr2": value}'`.
|
||||
* `-pe` or `--empty-csv-columns-are-null`: Treat empty CSV columns as nulls rather than as empty strings.
|
||||
@@ -431,7 +430,6 @@ be reduced to the maximum that can be used with the specified _maxzoom_.
|
||||
|
||||
* `-j` *filter* or `--feature-filter`=*filter*: Check features against a per-layer filter (as defined in the [Mapbox GL Style Specification](https://docs.mapbox.com/mapbox-gl-js/style-spec/#other-filter) or in a Felt filter specification still to be finalized) and only include those that match. Any features in layers that have no filter specified will be passed through. Filters for the layer `"*"` apply to all layers. The special variable `$zoom` refers to the current zoom level.
|
||||
* `-J` *filter-file* or `--feature-filter-file`=*filter-file*: Like `-j`, but read the filter from a file.
|
||||
* `--unidecode-data` *file*: Specify transliterations that will be used when evaluating expressions, in the format from https://metacpan.org/pod/Text::Unidecode
|
||||
|
||||
Example: to find the Natural Earth countries with low `scalerank` but high `LABELRANK`:
|
||||
|
||||
@@ -470,16 +468,14 @@ the same layer, enclose them in an `all` expression so they will all be evaluate
|
||||
compensate for the larger marker, or `-Bf`*number* to allow at most *number* features in the densest tile.
|
||||
* `--retain-points-multiplier=`_multiple_: Retain the specified multiple of points instead of just the number of points that would ordinarily be retained by the drop rate. These can be thinned out later with the `-m` option to `tippecanoe-overzoom`. The start of each cluster is marked in the feature sequence by the `tippecanoe:retain_points_multiplier_first` attribute. The `--tile-size-limit` will also be extended at low zoom levels to allow for the multiplied features.
|
||||
* `--drop-denser=`_percentage_: When dropping dots at zoom levels below the base zoom, give the specified _percentage_
|
||||
preference to retaining points in sparse areas and dropping points in dense areas. Use `--preserve-point-density-threshold` instead.
|
||||
preference to retaining points in sparse areas and dropping points in dense areas.
|
||||
* `--limit-base-zoom-to-maximum-zoom` or `-Pb`: Limit the guessed base zoom not to exceed the maxzoom, even if this would put more than the requested number of features in a base zoom tile.
|
||||
* `-al` or `--drop-lines`: Let "dot" dropping at lower zooms apply to lines too
|
||||
* `-ap` or `--drop-polygons`: Let "dot" dropping at lower zooms apply to polygons too
|
||||
* `-K` _distance_ or `--cluster-distance=`_distance_: Cluster points (as with `--cluster-densest-as-needed`, but without the experimental discovery process) that are approximately within _distance_ of each other. The units are tile coordinates within a nominally 256-pixel tile, so the maximum value of 255 allows only one feature per tile. Values around 10 are probably appropriate for typical marker sizes. See `--cluster-densest-as-needed` below for behavior.
|
||||
* `-k` _zoom_ or `--cluster-maxzoom=`_zoom_: Max zoom on which to cluster points if clustering is enabled.
|
||||
* `-kg` or `--cluster-maxzoom=g`: Set `--cluster-maxzoom=` to `maxzoom - 1` so that all features are visible at the maximum zoom level.
|
||||
* `--keep-point-cluster-position`: Do not average the location of points as they are clustered.
|
||||
* `--preserve-point-density-threshold=`_level_: At the low zoom levels, do not reduce point density below the specified _level_, even if the specfied drop rate would normally call for it, so that low-density areas of the map do not appear blank. The unit is the distance between preserved points, as a fraction of the size of a tile. Values of 32 or 64 are probably appropriate for typical marker sizes.
|
||||
* `--preserve-multiplier-density-threshold=`_level_: Preserve a minimum point density, but as `--retain-points-multiplier` features, not primary features.
|
||||
* `--preserve-point-density-threshold=`_level_: At the low zoom levels, do not reduce point density below the specified _level_, even if the specified drop rate would normally call for it, so that low-density areas of the map do not appear blank. The unit is the distance between preserved points, as a fraction of the size of a tile. Values of 32 or 64 are probably appropriate for typical marker sizes.
|
||||
|
||||
### Dropping a fraction of features to keep under tile size limits
|
||||
|
||||
@@ -491,7 +487,6 @@ the same layer, enclose them in an `all` expression so they will all be evaluate
|
||||
* `-aS` or `--coalesce-fraction-as-needed`: Dynamically combine a fraction of features from each zoom level into other nearby features to keep large tiles under the 500K size limit. (Again, mostly useful for polygons.)
|
||||
* `-pd` or `--force-feature-limit`: Dynamically drop some fraction of features from large tiles to keep them under the 500K size limit. It will probably look ugly at the tile boundaries. (This is like `-ad` but applies to each tile individually, not to the entire zoom level.) You probably don't want to use this.
|
||||
* `-aC` or `--cluster-densest-as-needed`: If a tile is too large, try to reduce its size by increasing the minimum spacing between features, and leaving one placeholder feature from each group. The remaining feature will be given a `"clustered": true` attribute to indicate that it represents a cluster, a `"point_count"` attribute to indicate the number of features that were clustered into it, and a `"sqrt_point_count"` attribute to indicate the relative width of a feature to represent the cluster. If the features being clustered are points, the representative feature will be located at the average of the original points' locations; otherwise, one of the original features will be left as the representative.
|
||||
* `--distinguish-duplicates`: Treat sets of up to 50 exact duplicate locations as sub-layers, which will be accumulated or coalesced into other features of their own sub-layer instead of into their duplicates.
|
||||
|
||||
### Dropping tightly overlapping features
|
||||
|
||||
@@ -724,7 +719,7 @@ and perhaps
|
||||
make install
|
||||
|
||||
Tippecanoe now requires features from the 2011 C++ standard. If your compiler is older than
|
||||
that, you will need to install a newer one. On MacOS, updating to the lastest XCode should
|
||||
that, you will need to install a newer one. On MacOS, updating to the latest XCode should
|
||||
get you a new enough version of `clang++`. On Linux, you should be able to upgrade `g++` with
|
||||
|
||||
```
|
||||
|
||||
@@ -1683,7 +1683,7 @@ static bool feature_out(std::vector<tile_feature> const &features, mvt_layer &ou
|
||||
}
|
||||
}
|
||||
|
||||
outlayer.features.push_back(std::move(outfeature));
|
||||
outlayer.features.push_back(std::make_shared<mvt_feature>(outfeature));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1694,6 +1694,9 @@ static struct preservecmp {
|
||||
bool operator()(const mvt_feature &a, const mvt_feature &b) {
|
||||
return a.seq < b.seq;
|
||||
}
|
||||
bool operator()(const std::shared_ptr<mvt_feature> &a, const std::shared_ptr<mvt_feature> &b) {
|
||||
return a->seq < b->seq;
|
||||
}
|
||||
} preservecmp;
|
||||
|
||||
struct index_event {
|
||||
@@ -1819,49 +1822,10 @@ mvt_tile assign_to_bins(mvt_tile &features,
|
||||
std::set<std::string> exclude,
|
||||
std::vector<std::string> exclude_prefix,
|
||||
int buffer, std::vector<clipbbox> const &clipbboxes) {
|
||||
std::vector<index_event> events;
|
||||
key_pool key_pool;
|
||||
|
||||
if (bins.size() == 0) {
|
||||
return mvt_tile();
|
||||
}
|
||||
|
||||
// Index bins
|
||||
for (size_t i = 0; i < bins.size(); i++) {
|
||||
for (size_t j = 0; j < bins[i].features.size(); j++) {
|
||||
long long xmin, ymin, xmax, ymax;
|
||||
unsigned long long start, end;
|
||||
|
||||
get_bbox(bins[i].features[j].geometry, &xmin, &ymin, &xmax, &ymax, z, x, y, bins[i].detail());
|
||||
get_quadkey_bounds(xmin, ymin, xmax, ymax, &start, &end);
|
||||
events.emplace_back(start, index_event::ENTER, i, j, xmin, ymin, xmax, ymax);
|
||||
events.emplace_back(end, index_event::EXIT, i, j, xmin, ymin, xmax, ymax);
|
||||
}
|
||||
}
|
||||
|
||||
std::map<unsigned long long, std::pair<size_t, size_t>> fid_to_feature;
|
||||
|
||||
// Index points
|
||||
for (size_t i = 0; i < features.layers.size(); i++) {
|
||||
for (size_t j = 0; j < features.layers[i].features.size(); j++) {
|
||||
long long xmin, ymin, xmax, ymax;
|
||||
unsigned long long start, end;
|
||||
|
||||
if (features.layers[i].features[j].geometry.size() > 0) {
|
||||
if (features.layers[i].features[j].has_id) {
|
||||
fid_to_feature.emplace(features.layers[i].features[j].id, std::make_pair(i, j));
|
||||
}
|
||||
|
||||
get_bbox(features.layers[i].features[j].geometry, &xmin, &ymin, &xmax, &ymax, z, x, y, features.layers[i].detail());
|
||||
get_quadkey_bounds(xmin, ymin, xmax, ymax, &start, &end);
|
||||
events.emplace_back(start, index_event::CHECK, i, j, xmin, ymin, xmax, ymax);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::sort(events.begin(), events.end());
|
||||
std::set<active_bin> active;
|
||||
|
||||
mvt_layer outlayer;
|
||||
outlayer.extent = bins[0].extent;
|
||||
outlayer.version = 2;
|
||||
@@ -1869,40 +1833,43 @@ mvt_tile assign_to_bins(mvt_tile &features,
|
||||
|
||||
std::vector<std::vector<tile_feature>> outfeatures;
|
||||
|
||||
for (auto &e : events) {
|
||||
if (e.kind == index_event::ENTER) {
|
||||
active_bin a(e.layer, e.feature);
|
||||
a.xmin = e.xmin;
|
||||
a.ymin = e.ymin;
|
||||
a.xmax = e.xmax;
|
||||
a.ymax = e.ymax;
|
||||
|
||||
const mvt_feature &bin = bins[e.layer].features[e.feature];
|
||||
|
||||
{
|
||||
tile_feature outfeature;
|
||||
for (auto const &g : bin.geometry) {
|
||||
outfeature.geom.emplace_back(g.op, g.x, g.y);
|
||||
if (bin_by_id_list.size() > 0) {
|
||||
std::map<unsigned long long, std::pair<size_t, size_t>> fid_to_feature;
|
||||
for (size_t i = 0; i < features.layers.size(); i++) {
|
||||
for (size_t j = 0; j < features.layers[i].features.size(); j++) {
|
||||
if (features.layers[i].features[j]->geometry.size() > 0) {
|
||||
if (features.layers[i].features[j]->has_id) {
|
||||
fid_to_feature.emplace(features.layers[i].features[j]->id, std::make_pair(i, j));
|
||||
}
|
||||
}
|
||||
outfeature.t = bin.type;
|
||||
outfeature.has_id = bin.has_id;
|
||||
outfeature.id = bin.id;
|
||||
outfeature.tags = bin.tags;
|
||||
outfeature.layer = &bins[e.layer];
|
||||
outfeature.seq = e.feature;
|
||||
|
||||
a.outfeature = outfeatures.size();
|
||||
outfeatures.push_back({std::move(outfeature)});
|
||||
}
|
||||
}
|
||||
|
||||
if (bin_by_id_list.size() > 0) {
|
||||
for (size_t k = 0; k < bin.tags.size(); k += 2) {
|
||||
if (bins[e.layer].keys[bin.tags[k]] == bin_by_id_list) {
|
||||
std::vector<size_t> ids = parse_ids_string(bins[e.layer].values[bin.tags[k + 1]]);
|
||||
for (auto &binlayer : bins) {
|
||||
size_t seq = 0;
|
||||
for (auto &bin : binlayer.features) {
|
||||
{
|
||||
tile_feature outfeature;
|
||||
for (auto const &g : bin->geometry) {
|
||||
outfeature.geom.emplace_back(g.op, g.x, g.y);
|
||||
}
|
||||
outfeature.t = bin->type;
|
||||
outfeature.has_id = bin->has_id;
|
||||
outfeature.id = bin->id;
|
||||
outfeature.tags = bin->tags;
|
||||
outfeature.layer = &binlayer;
|
||||
outfeature.seq = seq++;
|
||||
|
||||
outfeatures.push_back({std::move(outfeature)});
|
||||
}
|
||||
|
||||
for (size_t k = 0; k < bin->tags.size(); k += 2) {
|
||||
if (binlayer.keys[bin->tags[k]] == bin_by_id_list) {
|
||||
std::vector<size_t> ids = parse_ids_string(binlayer.values[bin->tags[k + 1]]);
|
||||
for (auto &id : ids) {
|
||||
auto f = fid_to_feature.find(id);
|
||||
if (f != fid_to_feature.end()) {
|
||||
mvt_feature &feature = features.layers[f->second.first].features[f->second.second];
|
||||
mvt_feature &feature = *features.layers[f->second.first].features[f->second.second];
|
||||
if (feature.geometry.size() > 0) {
|
||||
tile_feature outfeature;
|
||||
for (auto const &g : feature.geometry) {
|
||||
@@ -1913,8 +1880,8 @@ mvt_tile assign_to_bins(mvt_tile &features,
|
||||
outfeature.has_id = feature.has_id;
|
||||
outfeature.id = feature.id;
|
||||
outfeature.tags = feature.tags;
|
||||
outfeature.layer = &features.layers[e.layer];
|
||||
outfeature.seq = e.feature;
|
||||
outfeature.layer = &features.layers[f->second.first];
|
||||
outfeature.seq = f->second.second;
|
||||
outfeatures.back().push_back(std::move(outfeature));
|
||||
}
|
||||
}
|
||||
@@ -1923,67 +1890,128 @@ mvt_tile assign_to_bins(mvt_tile &features,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
std::vector<index_event> events;
|
||||
|
||||
active.insert(std::move(a));
|
||||
} else if (e.kind == index_event::CHECK) {
|
||||
if (bin_by_id_list.size() > 0) {
|
||||
continue; // only bin by id, not geometrically
|
||||
// Index bins
|
||||
for (size_t i = 0; i < bins.size(); i++) {
|
||||
for (size_t j = 0; j < bins[i].features.size(); j++) {
|
||||
long long xmin, ymin, xmax, ymax;
|
||||
unsigned long long start, end;
|
||||
|
||||
get_bbox(bins[i].features[j]->geometry, &xmin, &ymin, &xmax, &ymax, z, x, y, bins[i].detail());
|
||||
get_quadkey_bounds(xmin, ymin, xmax, ymax, &start, &end);
|
||||
events.emplace_back(start, index_event::ENTER, i, j, xmin, ymin, xmax, ymax);
|
||||
events.emplace_back(end, index_event::EXIT, i, j, xmin, ymin, xmax, ymax);
|
||||
}
|
||||
}
|
||||
|
||||
auto const &feature = features.layers[e.layer].features[e.feature];
|
||||
// Index points
|
||||
for (size_t i = 0; i < features.layers.size(); i++) {
|
||||
for (size_t j = 0; j < features.layers[i].features.size(); j++) {
|
||||
long long xmin, ymin, xmax, ymax;
|
||||
unsigned long long start, end;
|
||||
|
||||
if (feature.geometry.size() == 0) {
|
||||
// already assigned by ID
|
||||
continue;
|
||||
if (features.layers[i].features[j]->geometry.size() > 0) {
|
||||
get_bbox(features.layers[i].features[j]->geometry, &xmin, &ymin, &xmax, &ymax, z, x, y, features.layers[i].detail());
|
||||
get_quadkey_bounds(xmin, ymin, xmax, ymax, &start, &end);
|
||||
events.emplace_back(start, index_event::CHECK, i, j, xmin, ymin, xmax, ymax);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if we can't find a real match,
|
||||
// assign points to the most nearby bin
|
||||
ssize_t which_outfeature = outfeatures.size() - 1;
|
||||
std::sort(events.begin(), events.end());
|
||||
std::set<active_bin> active;
|
||||
|
||||
for (auto const &a : active) {
|
||||
auto const &bin = bins[a.layer].features[a.feature];
|
||||
for (auto &e : events) {
|
||||
if (e.kind == index_event::ENTER) {
|
||||
active_bin a(e.layer, e.feature);
|
||||
a.xmin = e.xmin;
|
||||
a.ymin = e.ymin;
|
||||
a.xmax = e.xmax;
|
||||
a.ymax = e.ymax;
|
||||
|
||||
if (bbox_intersects(e.xmin, e.ymin, e.xmax, e.ymax,
|
||||
a.xmin, a.ymin, a.xmax, a.ymax)) {
|
||||
if (pnpoly_mp(bin.geometry, feature.geometry[0].x, feature.geometry[0].y)) {
|
||||
which_outfeature = a.outfeature;
|
||||
break;
|
||||
const mvt_feature &bin = *bins[e.layer].features[e.feature];
|
||||
|
||||
{
|
||||
tile_feature outfeature;
|
||||
for (auto const &g : bin.geometry) {
|
||||
outfeature.geom.emplace_back(g.op, g.x, g.y);
|
||||
}
|
||||
outfeature.t = bin.type;
|
||||
outfeature.has_id = bin.has_id;
|
||||
outfeature.id = bin.id;
|
||||
outfeature.tags = bin.tags;
|
||||
outfeature.layer = &bins[e.layer];
|
||||
outfeature.seq = e.feature;
|
||||
|
||||
a.outfeature = outfeatures.size();
|
||||
outfeatures.push_back({std::move(outfeature)});
|
||||
}
|
||||
|
||||
active.insert(std::move(a));
|
||||
} else if (e.kind == index_event::CHECK) {
|
||||
if (bin_by_id_list.size() > 0) {
|
||||
continue; // only bin by id, not geometrically
|
||||
}
|
||||
|
||||
auto const &feature = *features.layers[e.layer].features[e.feature];
|
||||
|
||||
if (feature.geometry.size() == 0) {
|
||||
// already assigned by ID
|
||||
continue;
|
||||
}
|
||||
|
||||
// if we can't find a real match,
|
||||
// assign points to the most nearby bin
|
||||
ssize_t which_outfeature = outfeatures.size() - 1;
|
||||
|
||||
for (auto const &a : active) {
|
||||
auto const &bin = *bins[a.layer].features[a.feature];
|
||||
|
||||
if (bbox_intersects(e.xmin, e.ymin, e.xmax, e.ymax,
|
||||
a.xmin, a.ymin, a.xmax, a.ymax)) {
|
||||
if (pnpoly_mp(bin.geometry, feature.geometry[0].x, feature.geometry[0].y)) {
|
||||
which_outfeature = a.outfeature;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (which_outfeature >= 0) {
|
||||
tile_feature outfeature;
|
||||
for (auto const &g : feature.geometry) {
|
||||
outfeature.geom.emplace_back(g.op, g.x, g.y);
|
||||
if (which_outfeature >= 0) {
|
||||
tile_feature outfeature;
|
||||
for (auto const &g : feature.geometry) {
|
||||
outfeature.geom.emplace_back(g.op, g.x, g.y);
|
||||
}
|
||||
outfeature.t = feature.type;
|
||||
outfeature.has_id = feature.has_id;
|
||||
outfeature.id = feature.id;
|
||||
outfeature.tags = feature.tags;
|
||||
outfeature.layer = &features.layers[e.layer];
|
||||
outfeature.seq = e.feature;
|
||||
outfeatures[which_outfeature].push_back(std::move(outfeature));
|
||||
}
|
||||
} else /* EXIT */ {
|
||||
auto const &found = active.find({e.layer, e.feature});
|
||||
if (found != active.end()) {
|
||||
active.erase(found);
|
||||
} else {
|
||||
fprintf(stderr, "event mismatch: can't happen\n");
|
||||
exit(EXIT_IMPOSSIBLE);
|
||||
}
|
||||
outfeature.t = feature.type;
|
||||
outfeature.has_id = feature.has_id;
|
||||
outfeature.id = feature.id;
|
||||
outfeature.tags = feature.tags;
|
||||
outfeature.layer = &features.layers[e.layer];
|
||||
outfeature.seq = e.feature;
|
||||
outfeatures[which_outfeature].push_back(std::move(outfeature));
|
||||
}
|
||||
} else /* EXIT */ {
|
||||
auto const &found = active.find({e.layer, e.feature});
|
||||
if (found != active.end()) {
|
||||
active.erase(found);
|
||||
} else {
|
||||
fprintf(stderr, "event mismatch: can't happen\n");
|
||||
exit(EXIT_IMPOSSIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
key_pool key_pool;
|
||||
for (size_t i = 0; i < outfeatures.size(); i++) {
|
||||
if (outfeatures[i].size() > 1) {
|
||||
if (feature_out(outfeatures[i], outlayer,
|
||||
keep, exclude, exclude_prefix, attribute_accum,
|
||||
accumulate_numeric, key_pool, buffer, true,
|
||||
clipbboxes, z, x, y, NULL)) {
|
||||
mvt_feature &nfeature = outlayer.features.back();
|
||||
mvt_feature &nfeature = *outlayer.features.back();
|
||||
mvt_value val;
|
||||
val.type = mvt_uint;
|
||||
val.numeric_value.uint_value = outfeatures[i].size() - 1;
|
||||
@@ -2069,7 +2097,8 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
|
||||
static const std::string retain_points_multiplier_first = "tippecanoe:retain_points_multiplier_first";
|
||||
static const std::string retain_points_multiplier_sequence = "tippecanoe:retain_points_multiplier_sequence";
|
||||
|
||||
for (auto feature : layer.features) {
|
||||
for (auto feature_ref : layer.features) {
|
||||
auto feature = *feature_ref; // this needs to be a copy, because tile-join still needs the original unmutated
|
||||
drawvec geom;
|
||||
int t = feature.type;
|
||||
|
||||
|
||||
+3
-3
@@ -60,11 +60,11 @@ void do_stats(mvt_tile &tile, size_t size, bool compressed, int z, unsigned x, u
|
||||
|
||||
size_t points = 0, lines = 0, polygons = 0;
|
||||
for (size_t j = 0; j < tile.layers[i].features.size(); j++) {
|
||||
if (tile.layers[i].features[j].type == mvt_point) {
|
||||
if (tile.layers[i].features[j]->type == mvt_point) {
|
||||
points++;
|
||||
} else if (tile.layers[i].features[j].type == mvt_linestring) {
|
||||
} else if (tile.layers[i].features[j]->type == mvt_linestring) {
|
||||
lines++;
|
||||
} else if (tile.layers[i].features[j].type == mvt_polygon) {
|
||||
} else if (tile.layers[i].features[j]->type == mvt_polygon) {
|
||||
polygons++;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
sudo yum install git clang sqlite-devel zlib-devel
|
||||
|
||||
2. Create a ZIP archive with the `tippecanoe` binary at `bin/tippecanoe` and upload as a Lambda layer
|
||||
3. Copy [lambda_function.py](lambda_function.py) (python 3.9 runtime)
|
||||
3. Copy [tippecanoe.py](tippecanoe.py) (python 3.9 runtime)
|
||||
4. set the environment variable `OUTPUT_BUCKET` to your output bucket; give lambda IAM role access to input/output buckets
|
||||
5. Enable ACLs on the output bucket
|
||||
|
||||
|
||||
@@ -99,7 +99,6 @@ int retain_points_multiplier = 1;
|
||||
std::vector<std::string> unidecode_data;
|
||||
size_t maximum_string_attribute_length = 0;
|
||||
std::string accumulate_numeric;
|
||||
const char *tmpdir = "/tmp";
|
||||
|
||||
std::vector<order_field> order_by;
|
||||
bool order_reverse;
|
||||
@@ -741,7 +740,7 @@ void start_parsing(int fd, STREAM *fp, long long offset, long long len, std::ato
|
||||
parser_created = true;
|
||||
}
|
||||
|
||||
void radix1(int *geomfds_in, int *indexfds_in, int inputs, int prefix, int splits, long long mem, long long *availfiles, FILE *geomfile, FILE *indexfile, std::atomic<long long> *geompos_out, long long *progress, long long *progress_max, long long *progress_reported, int maxzoom, int basezoom, double droprate, double gamma, struct drop_state *ds) {
|
||||
void radix1(int *geomfds_in, int *indexfds_in, int inputs, int prefix, int splits, long long mem, const char *tmpdir, long long *availfiles, FILE *geomfile, FILE *indexfile, std::atomic<long long> *geompos_out, long long *progress, long long *progress_max, long long *progress_reported, int maxzoom, int basezoom, double droprate, double gamma, struct drop_state *ds) {
|
||||
// Arranged as bits to facilitate subdividing again if a subdivided file is still huge
|
||||
int splitbits = log(splits) / log(2);
|
||||
splits = 1 << splitbits;
|
||||
@@ -1029,7 +1028,7 @@ void radix1(int *geomfds_in, int *indexfds_in, int inputs, int prefix, int split
|
||||
// counter backward but will be an honest estimate of the work remaining.
|
||||
*progress_max += geomst.st_size / 4;
|
||||
|
||||
radix1(&geomfds[i], &indexfds[i], 1, prefix + splitbits, *availfiles / 4, mem, availfiles, geomfile, indexfile, geompos_out, progress, progress_max, progress_reported, maxzoom, basezoom, droprate, gamma, ds);
|
||||
radix1(&geomfds[i], &indexfds[i], 1, prefix + splitbits, *availfiles / 4, mem, tmpdir, availfiles, geomfile, indexfile, geompos_out, progress, progress_max, progress_reported, maxzoom, basezoom, droprate, gamma, ds);
|
||||
already_closed = 1;
|
||||
}
|
||||
}
|
||||
@@ -1064,7 +1063,7 @@ void prep_drop_states(struct drop_state *ds, int maxzoom, int basezoom, double d
|
||||
}
|
||||
}
|
||||
|
||||
void radix(std::vector<struct reader> &readers, int nreaders, FILE *geomfile, FILE *indexfile, std::atomic<long long> *geompos, int maxzoom, int basezoom, double droprate, double gamma) {
|
||||
void radix(std::vector<struct reader> &readers, int nreaders, FILE *geomfile, FILE *indexfile, const char *tmpdir, std::atomic<long long> *geompos, int maxzoom, int basezoom, double droprate, double gamma) {
|
||||
// Run through the index and geometry for each reader,
|
||||
// splitting the contents out by index into as many
|
||||
// sub-files as we can write to simultaneously.
|
||||
@@ -1114,7 +1113,7 @@ void radix(std::vector<struct reader> &readers, int nreaders, FILE *geomfile, FI
|
||||
|
||||
long long progress = 0, progress_max = geom_total, progress_reported = -1;
|
||||
long long availfiles_before = availfiles;
|
||||
radix1(geomfds, indexfds, nreaders, 0, splits, mem, &availfiles, geomfile, indexfile, geompos, &progress, &progress_max, &progress_reported, maxzoom, basezoom, droprate, gamma, ds);
|
||||
radix1(geomfds, indexfds, nreaders, 0, splits, mem, tmpdir, &availfiles, geomfile, indexfile, geompos, &progress, &progress_max, &progress_reported, maxzoom, basezoom, droprate, gamma, ds);
|
||||
|
||||
if (availfiles - 2 * nreaders != availfiles_before) {
|
||||
fprintf(stderr, "Internal error: miscounted available file descriptors: %lld vs %lld\n", availfiles - 2 * nreaders, availfiles);
|
||||
@@ -1215,7 +1214,7 @@ double round_droprate(double r) {
|
||||
return std::round(r * 100000.0) / 100000.0;
|
||||
}
|
||||
|
||||
std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, int maxzoom, int minzoom, int basezoom, double basezoom_marker_width, sqlite3 *outdb, const char *outdir, std::set<std::string> *exclude, std::set<std::string> *include, int exclude_all, json_object *filter, double droprate, int buffer, double gamma, int read_parallel, int forcetable, const char *attribution, bool uses_gamma, long long *file_bbox, long long *file_bbox1, long long *file_bbox2, const char *prefilter, const char *postfilter, const char *description, bool guess_maxzoom, bool guess_cluster_maxzoom, std::unordered_map<std::string, int> const *attribute_types, const char *pgm, std::unordered_map<std::string, attribute_op> const *attribute_accum, std::map<std::string, std::string> const &attribute_descriptions, std::string const &commandline, int minimum_maxzoom) {
|
||||
std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, int maxzoom, int minzoom, int basezoom, double basezoom_marker_width, sqlite3 *outdb, const char *outdir, std::set<std::string> *exclude, std::set<std::string> *include, int exclude_all, json_object *filter, double droprate, int buffer, const char *tmpdir, double gamma, int read_parallel, int forcetable, const char *attribution, bool uses_gamma, long long *file_bbox, long long *file_bbox1, long long *file_bbox2, const char *prefilter, const char *postfilter, const char *description, bool guess_maxzoom, bool guess_cluster_maxzoom, std::unordered_map<std::string, int> const *attribute_types, const char *pgm, std::unordered_map<std::string, attribute_op> const *attribute_accum, std::map<std::string, std::string> const &attribute_descriptions, std::string const &commandline, int minimum_maxzoom) {
|
||||
int ret = EXIT_SUCCESS;
|
||||
|
||||
std::vector<struct reader> readers;
|
||||
@@ -2208,7 +2207,7 @@ std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, i
|
||||
serialize_uint(geomfile, ix, &geompos, fname);
|
||||
serialize_uint(geomfile, iy, &geompos, fname);
|
||||
|
||||
radix(readers, CPUS, geomfile, indexfile, &geompos, maxzoom, basezoom, droprate, gamma);
|
||||
radix(readers, CPUS, geomfile, indexfile, tmpdir, &geompos, maxzoom, basezoom, droprate, gamma);
|
||||
|
||||
/* end of tile */
|
||||
serialize_ulong_long(geomfile, 0, &geompos, fname); // EOF
|
||||
@@ -2756,7 +2755,7 @@ std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, i
|
||||
std::atomic<unsigned> midx(0);
|
||||
std::atomic<unsigned> midy(0);
|
||||
std::vector<strategy> strategies;
|
||||
int written = traverse_zooms(fd, size, stringpool, &midx, &midy, maxzoom, minzoom, outdb, outdir, buffer, fname, gamma, full_detail, low_detail, min_detail, pool_off, initial_x, initial_y, simplification, maxzoom_simplification, layermaps, prefilter, postfilter, attribute_accum, filter, strategies, iz, shared_nodes_map, nodepos, shared_nodes_bloom, basezoom, droprate, unidecode_data);
|
||||
int written = traverse_zooms(fd, size, stringpool, &midx, &midy, maxzoom, minzoom, outdb, outdir, buffer, fname, tmpdir, gamma, full_detail, low_detail, min_detail, pool_off, initial_x, initial_y, simplification, maxzoom_simplification, layermaps, prefilter, postfilter, attribute_accum, filter, strategies, iz, shared_nodes_map, nodepos, shared_nodes_bloom, basezoom, droprate, unidecode_data);
|
||||
|
||||
if (maxzoom != written) {
|
||||
if (written > minzoom) {
|
||||
@@ -2992,6 +2991,7 @@ int main(int argc, char **argv) {
|
||||
double droprate = 2.5;
|
||||
double gamma = 0;
|
||||
int buffer = 5;
|
||||
const char *tmpdir = "/tmp";
|
||||
const char *attribution = NULL;
|
||||
std::vector<source> sources;
|
||||
const char *prefilter = NULL;
|
||||
@@ -3098,7 +3098,6 @@ int main(int argc, char **argv) {
|
||||
{"force-feature-limit", no_argument, &prevent[P_DYNAMIC_DROP], 1},
|
||||
{"cluster-densest-as-needed", no_argument, &additional[A_CLUSTER_DENSEST_AS_NEEDED], 1},
|
||||
{"keep-point-cluster-position", no_argument, &additional[A_KEEP_POINT_CLUSTER_POSITION], 1},
|
||||
{"distinguish-duplicates", no_argument, &additional[A_DISTINGUISH_DUPLICATES], 1},
|
||||
|
||||
{"Dropping tightly overlapping features", 0, 0, 0},
|
||||
{"gamma", required_argument, 0, 'g'},
|
||||
@@ -3833,7 +3832,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
auto input_ret = read_input(sources, name ? name : out_mbtiles ? out_mbtiles
|
||||
: out_dir,
|
||||
maxzoom, minzoom, basezoom, basezoom_marker_width, outdb, out_dir, &exclude, &include, exclude_all, filter, droprate, buffer, gamma, read_parallel, forcetable, attribution, gamma != 0, file_bbox, file_bbox1, file_bbox2, prefilter, postfilter, description, guess_maxzoom, guess_cluster_maxzoom, &attribute_types, argv[0], &attribute_accum, attribute_descriptions, commandline, minimum_maxzoom);
|
||||
maxzoom, minzoom, basezoom, basezoom_marker_width, outdb, out_dir, &exclude, &include, exclude_all, filter, droprate, buffer, tmpdir, gamma, read_parallel, forcetable, attribution, gamma != 0, file_bbox, file_bbox1, file_bbox2, prefilter, postfilter, description, guess_maxzoom, guess_cluster_maxzoom, &attribute_types, argv[0], &attribute_accum, attribute_descriptions, commandline, minimum_maxzoom);
|
||||
|
||||
ret = std::get<0>(input_ret);
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ extern int retain_points_multiplier;
|
||||
extern size_t maximum_string_attribute_length;
|
||||
extern std::string accumulate_numeric;
|
||||
extern unsigned long long preserve_multiplier_density_threshold;
|
||||
extern const char *tmpdir;
|
||||
|
||||
struct order_field {
|
||||
std::string name;
|
||||
|
||||
+4
-14
@@ -518,12 +518,10 @@ If the type is \fB\fCint\fR and the original attribute was floating\-point, it i
|
||||
that are dropped, coalesced\-as\-needed, or clustered. The \fIoperation\fP may be
|
||||
\fB\fCsum\fR, \fB\fCproduct\fR, \fB\fCmean\fR, \fB\fCmax\fR, \fB\fCmin\fR, \fB\fCconcat\fR, or \fB\fCcomma\fR
|
||||
to specify how the named \fIattribute\fP is accumulated onto the attribute of the same name in a feature that does survive.
|
||||
The attributes and operations may also be specified as JSON keys and values: \fB\fC\-\-accumulate\-attribute='{"attr": "operation", "attr2": "operation2"}'\fR\&.
|
||||
.IP \(bu 2
|
||||
\fB\fC\-\-accumulate\-numeric\-attributes\fR \fIprefix\fP: Accumulate sum, count, min, and max for all numeric attributes into new attributes with the specified \fIprefix\fP\&.
|
||||
The attributes and operations may also be specified as JSON keys and values: \fB\fC\-\-accumulate\-attribute='{"attr": "operation", "attr2", "operation2"}'\fR\&.
|
||||
.IP \(bu 2
|
||||
\fB\fC\-\-set\-attribute\fR \fIattribute\fP\fB\fC:\fR\fIvalue\fP: Set the value of the specified \fIattribute\fP in each feature to the specified \fIvalue\fP\&. This is mostly useful to give an attribute in each feature an initial value for \fB\fC\-\-accumulate\-attribute\fR\&.
|
||||
The attributes and values may also be specified as JSON keys and values: \fB\fC\-\-set\-attribute='{"attr": value, "attr2": value}'\fR\&.
|
||||
The attributes and values may also be specified as JSON keys and values: \fB\fC\-\-set\-attribute='{"attr": value, "attr2", value}'\fR\&.
|
||||
.IP \(bu 2
|
||||
\fB\fC\-pe\fR or \fB\fC\-\-empty\-csv\-columns\-are\-null\fR: Treat empty CSV columns as nulls rather than as empty strings.
|
||||
.IP \(bu 2
|
||||
@@ -541,8 +539,6 @@ The attributes and values may also be specified as JSON keys and values: \fB\fC\
|
||||
\fB\fC\-j\fR \fIfilter\fP or \fB\fC\-\-feature\-filter\fR=\fIfilter\fP: Check features against a per\-layer filter (as defined in the Mapbox GL Style Specification \[la]https://docs.mapbox.com/mapbox-gl-js/style-spec/#other-filter\[ra] or in a Felt filter specification still to be finalized) and only include those that match. Any features in layers that have no filter specified will be passed through. Filters for the layer \fB\fC"*"\fR apply to all layers. The special variable \fB\fC$zoom\fR refers to the current zoom level.
|
||||
.IP \(bu 2
|
||||
\fB\fC\-J\fR \fIfilter\-file\fP or \fB\fC\-\-feature\-filter\-file\fR=\fIfilter\-file\fP: Like \fB\fC\-j\fR, but read the filter from a file.
|
||||
.IP \(bu 2
|
||||
\fB\fC\-\-unidecode\-data\fR \fIfile\fP: Specify transliterations that will be used when evaluating expressions, in the format from \[la]https://metacpan.org/pod/Text::Unidecode\[ra]
|
||||
.RE
|
||||
.PP
|
||||
Example: to find the Natural Earth countries with low \fB\fCscalerank\fR but high \fB\fCLABELRANK\fR:
|
||||
@@ -591,7 +587,7 @@ compensate for the larger marker, or \fB\fC\-Bf\fR\fInumber\fP to allow at most
|
||||
\fB\fC\-\-retain\-points\-multiplier=\fR\fImultiple\fP: Retain the specified multiple of points instead of just the number of points that would ordinarily be retained by the drop rate. These can be thinned out later with the \fB\fC\-m\fR option to \fB\fCtippecanoe\-overzoom\fR\&. The start of each cluster is marked in the feature sequence by the \fB\fCtippecanoe:retain_points_multiplier_first\fR attribute. The \fB\fC\-\-tile\-size\-limit\fR will also be extended at low zoom levels to allow for the multiplied features.
|
||||
.IP \(bu 2
|
||||
\fB\fC\-\-drop\-denser=\fR\fIpercentage\fP: When dropping dots at zoom levels below the base zoom, give the specified \fIpercentage\fP
|
||||
preference to retaining points in sparse areas and dropping points in dense areas. Use \fB\fC\-\-preserve\-point\-density\-threshold\fR instead.
|
||||
preference to retaining points in sparse areas and dropping points in dense areas.
|
||||
.IP \(bu 2
|
||||
\fB\fC\-\-limit\-base\-zoom\-to\-maximum\-zoom\fR or \fB\fC\-Pb\fR: Limit the guessed base zoom not to exceed the maxzoom, even if this would put more than the requested number of features in a base zoom tile.
|
||||
.IP \(bu 2
|
||||
@@ -605,11 +601,7 @@ preference to retaining points in sparse areas and dropping points in dense area
|
||||
.IP \(bu 2
|
||||
\fB\fC\-kg\fR or \fB\fC\-\-cluster\-maxzoom=g\fR: Set \fB\fC\-\-cluster\-maxzoom=\fR to \fB\fCmaxzoom \- 1\fR so that all features are visible at the maximum zoom level.
|
||||
.IP \(bu 2
|
||||
\fB\fC\-\-keep\-point\-cluster\-position\fR: Do not average the location of points as they are clustered.
|
||||
.IP \(bu 2
|
||||
\fB\fC\-\-preserve\-point\-density\-threshold=\fR\fIlevel\fP: At the low zoom levels, do not reduce point density below the specified \fIlevel\fP, even if the specfied drop rate would normally call for it, so that low\-density areas of the map do not appear blank. The unit is the distance between preserved points, as a fraction of the size of a tile. Values of 32 or 64 are probably appropriate for typical marker sizes.
|
||||
.IP \(bu 2
|
||||
\fB\fC\-\-preserve\-multiplier\-density\-threshold=\fR\fIlevel\fP: Preserve a minimum point density, but as \fB\fC\-\-retain\-points\-multiplier\fR features, not primary features.
|
||||
.RE
|
||||
.SS Dropping a fraction of features to keep under tile size limits
|
||||
.RS
|
||||
@@ -629,13 +621,11 @@ preference to retaining points in sparse areas and dropping points in dense area
|
||||
\fB\fC\-pd\fR or \fB\fC\-\-force\-feature\-limit\fR: Dynamically drop some fraction of features from large tiles to keep them under the 500K size limit. It will probably look ugly at the tile boundaries. (This is like \fB\fC\-ad\fR but applies to each tile individually, not to the entire zoom level.) You probably don't want to use this.
|
||||
.IP \(bu 2
|
||||
\fB\fC\-aC\fR or \fB\fC\-\-cluster\-densest\-as\-needed\fR: If a tile is too large, try to reduce its size by increasing the minimum spacing between features, and leaving one placeholder feature from each group. The remaining feature will be given a \fB\fC"clustered": true\fR attribute to indicate that it represents a cluster, a \fB\fC"point_count"\fR attribute to indicate the number of features that were clustered into it, and a \fB\fC"sqrt_point_count"\fR attribute to indicate the relative width of a feature to represent the cluster. If the features being clustered are points, the representative feature will be located at the average of the original points' locations; otherwise, one of the original features will be left as the representative.
|
||||
.IP \(bu 2
|
||||
\fB\fC\-\-distinguish\-duplicates\fR: Treat sets of up to 50 exact duplicate locations as sub\-layers, which will be accumulated or coalesced into other features of their own sub\-layer instead of into their duplicates.
|
||||
.RE
|
||||
.SS Dropping tightly overlapping features
|
||||
.RS
|
||||
.IP \(bu 2
|
||||
\fB\fC\-g\fR \fIgamma\fP or \fB\fC\-\-gamma=\fR\fIgamma\fP: Rate at which especially dense dots are dropped (default 0, for no effect). A gamma of 2 reduces the number of dots less than a pixel apart to the square root of their original number.
|
||||
\fB\fC\-g\fR \fIgamma\fP or \fB\fC\-\-gamma=_gamma\fR_: Rate at which especially dense dots are dropped (default 0, for no effect). A gamma of 2 reduces the number of dots less than a pixel apart to the square root of their original number.
|
||||
.IP \(bu 2
|
||||
\fB\fC\-aG\fR or \fB\fC\-\-increase\-gamma\-as\-needed\fR: If a tile is too large, try to reduce it to under 500K by increasing the \fB\fC\-g\fR gamma. The discovered gamma applies to the entire zoom level. You probably want to use \fB\fC\-\-drop\-densest\-as\-needed\fR instead.
|
||||
.RE
|
||||
|
||||
@@ -278,7 +278,7 @@ bool mvt_tile::decode(const std::string &message, bool &was_compressed) {
|
||||
}
|
||||
}
|
||||
|
||||
layer.features.push_back(std::move(feature));
|
||||
layer.features.push_back(std::make_shared<mvt_feature>(feature));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -407,16 +407,16 @@ std::string mvt_tile::encode() {
|
||||
std::string feature_string;
|
||||
protozero::pbf_writer feature_writer(feature_string);
|
||||
|
||||
feature_writer.add_enum(3, layers[i].features[f].type);
|
||||
feature_writer.add_enum(3, layers[i].features[f]->type);
|
||||
|
||||
std::vector<unsigned> sorted_tags = layers[i].features[f].tags;
|
||||
std::vector<unsigned> sorted_tags = layers[i].features[f]->tags;
|
||||
for (size_t v = 1; v < sorted_tags.size(); v += 2) {
|
||||
sorted_tags[v] = mapping[sorted_tags[v]];
|
||||
}
|
||||
feature_writer.add_packed_uint32(2, std::begin(sorted_tags), std::end(sorted_tags));
|
||||
|
||||
if (layers[i].features[f].has_id) {
|
||||
feature_writer.add_uint64(1, layers[i].features[f].id);
|
||||
if (layers[i].features[f]->has_id) {
|
||||
feature_writer.add_uint64(1, layers[i].features[f]->id);
|
||||
}
|
||||
|
||||
std::vector<uint32_t> geometry;
|
||||
@@ -426,7 +426,7 @@ std::string mvt_tile::encode() {
|
||||
int cmd = -1;
|
||||
int length = 0;
|
||||
|
||||
std::vector<mvt_geometry> &geom = layers[i].features[f].geometry;
|
||||
std::vector<mvt_geometry> &geom = layers[i].features[f]->geometry;
|
||||
|
||||
for (size_t g = 0; g < geom.size(); g++) {
|
||||
int op = geom[g].op;
|
||||
|
||||
@@ -204,7 +204,7 @@ struct std::hash<mvt_value> {
|
||||
struct mvt_layer {
|
||||
int version = 0;
|
||||
std::string name = "";
|
||||
std::vector<mvt_feature> features{};
|
||||
std::vector<std::shared_ptr<mvt_feature>> features{};
|
||||
std::vector<std::string> keys{};
|
||||
std::vector<mvt_value> values{};
|
||||
long long extent = 0;
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#define A_VISVALINGAM ((int) 'v')
|
||||
#define A_DETECT_WRAPAROUND ((int) 'w')
|
||||
#define A_KEEP_POINT_CLUSTER_POSITION ((int) 'a')
|
||||
#define A_DISTINGUISH_DUPLICATES ((int) 'u')
|
||||
|
||||
#define P_TILE_COMPRESSION ((int) 'C')
|
||||
#define P_DUPLICATION ((int) 'D')
|
||||
|
||||
+6
-6
@@ -119,17 +119,17 @@ std::vector<mvt_layer> parse_layers(int fd, int z, unsigned x, unsigned y, std::
|
||||
}
|
||||
|
||||
for (auto const &feature : layer.features) {
|
||||
if (feature.type == mvt_point) {
|
||||
if (feature->type == mvt_point) {
|
||||
ts->second.points++;
|
||||
} else if (feature.type == mvt_linestring) {
|
||||
} else if (feature->type == mvt_linestring) {
|
||||
ts->second.lines++;
|
||||
} else if (feature.type == mvt_polygon) {
|
||||
} else if (feature->type == mvt_polygon) {
|
||||
ts->second.polygons++;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i + 1 < feature.tags.size(); i += 2) {
|
||||
const std::string &key = layer.keys[feature.tags[i]];
|
||||
const mvt_value &val = layer.values[feature.tags[i + 1]];
|
||||
for (size_t i = 0; i + 1 < feature->tags.size(); i += 2) {
|
||||
const std::string &key = layer.keys[feature->tags[i]];
|
||||
const mvt_value &val = layer.values[feature->tags[i + 1]];
|
||||
|
||||
// Nulls can be excluded here because this is the postfilter
|
||||
// and it is nearly time to create the vector representation
|
||||
|
||||
+1
-1
@@ -398,7 +398,7 @@ std::vector<mvt_layer> parse_layers(FILE *fp, int z, unsigned x, unsigned y, int
|
||||
}
|
||||
}
|
||||
|
||||
l->second.features.push_back(feature);
|
||||
l->second.features.push_back(std::make_shared<mvt_feature>(feature));
|
||||
}
|
||||
|
||||
json_free(j);
|
||||
|
||||
@@ -743,7 +743,6 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf, std::
|
||||
prevent[P_DYNAMIC_DROP] ||
|
||||
additional[A_INCREASE_GAMMA_AS_NEEDED] ||
|
||||
additional[A_GENERATE_POLYGON_LABEL_POINTS] ||
|
||||
additional[A_DISTINGUISH_DUPLICATES] ||
|
||||
sst->uses_gamma ||
|
||||
retain_points_multiplier > 1 ||
|
||||
preserve_multiplier_density_threshold > 0 ||
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
{"type":"Feature","properties":{"a":0},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":0},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":0},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":1},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":1},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":1},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":2},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":2},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":2},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":3},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":3},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":3},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":4},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":4},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":4},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":5},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":5},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":5},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":6},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":6},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":6},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":7},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":7},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":7},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":8},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":8},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":8},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":9},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":9},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":9},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":10},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":10},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":10},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":11},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":11},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":11},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":12},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":12},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":12},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":13},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":13},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":13},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":14},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":14},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":14},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":15},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":15},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":15},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":16},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":16},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":16},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":17},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":17},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":17},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":18},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":18},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":18},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":19},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":19},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":19},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":20},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":20},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":20},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":21},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":21},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":21},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":22},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":22},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":22},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":23},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":23},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":23},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":24},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":24},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":24},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":25},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":25},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":25},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":26},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":26},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":26},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":27},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":27},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":27},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":28},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":28},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":28},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":29},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":29},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":29},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":30},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":30},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":30},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":31},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":31},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":31},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":32},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":32},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":32},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":33},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":33},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":33},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":34},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":34},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":34},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":35},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":35},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":35},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":36},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":36},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":36},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":37},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":37},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":37},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":38},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":38},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":38},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":39},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":39},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":39},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":40},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":40},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":40},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":41},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":41},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":41},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":42},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":42},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":42},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":43},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":43},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":43},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":44},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":44},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":44},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":45},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":45},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":45},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":46},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":46},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":46},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":47},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":47},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":47},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":48},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":48},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":48},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":49},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":49},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":49},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":50},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":50},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":50},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":51},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":51},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":51},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":52},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":52},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":52},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":53},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":53},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":53},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":54},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":54},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":54},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":55},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":55},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":55},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":56},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":56},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":56},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":57},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":57},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":57},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":58},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":58},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":58},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":59},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":59},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":59},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
{"type":"Feature","properties":{"a":60},"geometry":{"type":"Point","coordinates":[1,1]}}
|
||||
{"type":"Feature","properties":{"b":60},"geometry":{"type":"Point","coordinates":[2,1]}}
|
||||
{"type":"Feature","properties":{"c":60},"geometry":{"type":"Point","coordinates":[3,1]}}
|
||||
@@ -1,537 +0,0 @@
|
||||
{ "type": "FeatureCollection", "properties": {
|
||||
"antimeridian_adjusted_bounds": "1.000000,1.000000,3.000000,1.000000",
|
||||
"bounds": "1.000000,1.000000,3.000000,1.000000",
|
||||
"center": "3.000000,1.000000,1",
|
||||
"description": "tests/distinguish-duplicates/out/-z1_-b0_--distinguish-duplicates.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"generator_options": "./tippecanoe -q -a@ -f -o tests/distinguish-duplicates/out/-z1_-b0_--distinguish-duplicates.json.check.mbtiles -z1 -b0 --distinguish-duplicates tests/distinguish-duplicates/in.json",
|
||||
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":1,\"fields\":{\"a\":\"Number\",\"b\":\"Number\",\"c\":\"Number\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":183,\"geometry\":\"Point\",\"attributeCount\":3,\"attributes\":[{\"attribute\":\"a\",\"count\":61,\"type\":\"number\",\"values\":[0,1,10,11,12,13,14,15,16,17,18,19,2,20,21,22,23,24,25,26,27,28,29,3,30,31,32,33,34,35,36,37,38,39,4,40,41,42,43,44,45,46,47,48,49,5,50,51,52,53,54,55,56,57,58,59,6,60,7,8,9],\"min\":0,\"max\":60},{\"attribute\":\"b\",\"count\":61,\"type\":\"number\",\"values\":[0,1,10,11,12,13,14,15,16,17,18,19,2,20,21,22,23,24,25,26,27,28,29,3,30,31,32,33,34,35,36,37,38,39,4,40,41,42,43,44,45,46,47,48,49,5,50,51,52,53,54,55,56,57,58,59,6,60,7,8,9],\"min\":0,\"max\":60},{\"attribute\":\"c\",\"count\":61,\"type\":\"number\",\"values\":[0,1,10,11,12,13,14,15,16,17,18,19,2,20,21,22,23,24,25,26,27,28,29,3,30,31,32,33,34,35,36,37,38,39,4,40,41,42,43,44,45,46,47,48,49,5,50,51,52,53,54,55,56,57,58,59,6,60,7,8,9],\"min\":0,\"max\":60}]}]}}",
|
||||
"maxzoom": "1",
|
||||
"minzoom": "0",
|
||||
"name": "tests/distinguish-duplicates/out/-z1_-b0_--distinguish-duplicates.json.check.mbtiles",
|
||||
"strategies": "[{\"dropped_by_rate\":109},{}]",
|
||||
"type": "overlay",
|
||||
"version": "2"
|
||||
}, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "a": 0 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 0 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 1 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 2 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 2 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 3 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 4 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 5 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 6 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 7 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 7 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 8 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 9 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 10 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 11 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 12 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 12 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 13 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 14 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 15 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 16 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 17 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 17 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 18 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 19 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 20 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 21 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 22 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 22 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 23 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 24 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 25 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 26 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 27 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 27 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 28 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 29 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 30 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 31 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 32 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 32 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 33 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 34 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 35 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 36 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 37 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 37 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 38 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 39 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 40 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 41 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 42 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 42 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 43 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 44 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 45 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 46 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 47 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 47 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 48 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 49 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 50 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 52 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 54 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 57 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 59 }, "geometry": { "type": "Point", "coordinates": [ 1.054688, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 51 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 53 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 56 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 58 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 52 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 55 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 57 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 60 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
||||
] }
|
||||
] }
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 1, "x": 1, "y": 0 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "a": 0 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 0 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 0 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 1 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 1 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 1 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 2 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 2 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 2 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 3 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 3 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 3 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 4 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 4 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 4 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 5 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 5 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 5 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 6 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 6 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 6 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 7 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 7 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 7 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 8 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 8 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 8 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 9 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 9 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 9 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 10 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 10 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 10 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 11 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 11 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 11 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 12 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 12 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 12 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 13 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 13 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 13 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 14 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 14 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 14 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 15 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 15 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 15 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 16 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 16 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 16 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 17 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 17 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 17 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 18 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 18 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 18 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 19 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 19 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 19 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 20 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 20 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 20 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 21 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 21 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 21 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 22 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 22 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 22 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 23 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 23 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 23 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 24 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 24 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 24 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 25 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 25 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 25 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 26 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 26 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 26 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 27 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 27 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 27 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 28 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 28 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 28 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 29 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 29 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 29 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 30 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 30 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 30 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 31 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 31 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 31 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 32 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 32 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 32 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 33 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 33 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 33 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 34 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 34 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 34 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 35 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 35 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 35 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 36 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 36 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 36 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 37 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 37 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 37 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 38 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 38 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 38 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 39 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 39 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 39 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 40 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 40 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 40 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 41 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 41 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 41 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 42 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 42 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 42 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 43 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 43 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 43 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 44 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 44 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 44 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 45 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 45 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 45 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 46 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 46 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 46 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 47 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 47 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 47 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 48 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 48 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 48 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 49 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 49 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 49 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 50 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 50 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 50 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 51 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 52 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 53 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 54 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 55 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 56 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 57 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 58 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 59 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "a": 60 }, "geometry": { "type": "Point", "coordinates": [ 1.010742, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 51 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 52 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 53 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 54 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 55 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 56 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 57 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 58 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 59 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "b": 60 }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 51 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 52 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 53 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 54 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 55 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 56 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 57 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 58 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 59 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "c": 60 }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 1.010690 ] } }
|
||||
] }
|
||||
] }
|
||||
] }
|
||||
+6
-6
@@ -243,9 +243,9 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map<st
|
||||
// scaling up is safe while scaling down requires geometry cleaning.
|
||||
|
||||
for (size_t i = 0; i < outlayer.features.size(); i++) {
|
||||
for (size_t j = 0; j < outlayer.features[i].geometry.size(); j++) {
|
||||
outlayer.features[i].geometry[j].x = outlayer.features[i].geometry[j].x * layer.extent / outlayer.extent;
|
||||
outlayer.features[i].geometry[j].y = outlayer.features[i].geometry[j].y * layer.extent / outlayer.extent;
|
||||
for (size_t j = 0; j < outlayer.features[i]->geometry.size(); j++) {
|
||||
outlayer.features[i]->geometry[j].x = outlayer.features[i]->geometry[j].x * layer.extent / outlayer.extent;
|
||||
outlayer.features[i]->geometry[j].y = outlayer.features[i]->geometry[j].y * layer.extent / outlayer.extent;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map<st
|
||||
join_keys.resize(layer.features.size());
|
||||
|
||||
for (size_t f = 0; f < layer.features.size(); f++) {
|
||||
mvt_feature &feat = layer.features[f];
|
||||
mvt_feature &feat = *layer.features[f];
|
||||
join_keys[f].type = mvt_no_such_key;
|
||||
|
||||
for (size_t t = 0; t + 1 < feat.tags.size(); t += 2) {
|
||||
@@ -289,7 +289,7 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map<st
|
||||
bool features_added_to_layer = false;
|
||||
|
||||
for (size_t f = 0; f < layer.features.size(); f++) {
|
||||
mvt_feature &feat = layer.features[f];
|
||||
mvt_feature &feat = *layer.features[f];
|
||||
|
||||
std::set<std::string> exclude_attributes;
|
||||
if (filter != NULL && !evaluate(feat, layer, filter, exclude_attributes, z, unidecode_data)) {
|
||||
@@ -520,7 +520,7 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map<st
|
||||
|
||||
features_added++;
|
||||
features_added_to_layer = true;
|
||||
outlayer.features.push_back(outfeature);
|
||||
outlayer.features.push_back(std::make_shared<mvt_feature>(outfeature));
|
||||
|
||||
if (z < tilestats->second.minzoom) {
|
||||
tilestats->second.minzoom = z;
|
||||
|
||||
@@ -904,7 +904,6 @@ struct write_tile_args {
|
||||
atomic_strategy *strategy = NULL;
|
||||
int zoom = -1;
|
||||
bool compressed;
|
||||
bool first_zoom;
|
||||
node *shared_nodes_map;
|
||||
size_t nodepos;
|
||||
std::string const *shared_nodes_bloom;
|
||||
@@ -1055,106 +1054,42 @@ static bool skip_next_feature(decompressor *geoms, std::atomic<long long> *geomp
|
||||
struct next_feature_state {
|
||||
unsigned long long previndex = 0;
|
||||
unsigned long long prev_not_dropped_index = 0;
|
||||
|
||||
std::vector<FILE *> deferrals;
|
||||
size_t which_deferral = 0;
|
||||
bool doing_deferrals = false;
|
||||
};
|
||||
|
||||
// This function is called repeatedly from write_tile() to retrieve the next feature
|
||||
// from the input stream. If the stream is at an end, it returns a feature with the
|
||||
// geometry type set to -2.
|
||||
static serial_feature next_feature(decompressor *geoms, std::atomic<long long> *geompos_in, int z, unsigned tx, unsigned ty, unsigned *initial_x, unsigned *initial_y, long long *original_features, long long *unclipped_features, int nextzoom, int maxzoom, int minzoom, int max_zoom_increment, size_t pass, std::atomic<long long> *along, long long alongminus, int buffer, std::atomic<bool> *within, compressor **geomfile, std::atomic<long long> *geompos, long long start_geompos[], std::atomic<double> *oprogress, double todo, const char *fname, int child_shards, json_object *filter, const char *global_stringpool, long long *pool_off, std::vector<std::vector<std::string>> *layer_unmaps, bool first_time, bool compressed, bool first_zoom, multiplier_state *multiplier_state, std::shared_ptr<std::string> &tile_stringpool, std::vector<std::string> const &unidecode_data, next_feature_state &next_feature_state, double droprate) {
|
||||
static serial_feature next_feature(decompressor *geoms, std::atomic<long long> *geompos_in, int z, unsigned tx, unsigned ty, unsigned *initial_x, unsigned *initial_y, long long *original_features, long long *unclipped_features, int nextzoom, int maxzoom, int minzoom, int max_zoom_increment, size_t pass, std::atomic<long long> *along, long long alongminus, int buffer, std::atomic<bool> *within, compressor **geomfile, std::atomic<long long> *geompos, long long start_geompos[], std::atomic<double> *oprogress, double todo, const char *fname, int child_shards, json_object *filter, const char *global_stringpool, long long *pool_off, std::vector<std::vector<std::string>> *layer_unmaps, bool first_time, bool compressed, multiplier_state *multiplier_state, std::shared_ptr<std::string> &tile_stringpool, std::vector<std::string> const &unidecode_data, next_feature_state &next_feature_state, double droprate) {
|
||||
double extra_multiplier_zooms = log(retain_points_multiplier) / log(droprate);
|
||||
|
||||
while (1) {
|
||||
serial_feature sf;
|
||||
long long len;
|
||||
|
||||
if (geoms->deserialize_long_long(&len, geompos_in) == 0) {
|
||||
fprintf(stderr, "Unexpected physical EOF in feature stream\n");
|
||||
exit(EXIT_READ);
|
||||
}
|
||||
if (len <= 0) {
|
||||
if (compressed) {
|
||||
geoms->end(geompos_in);
|
||||
}
|
||||
|
||||
sf.t = -2;
|
||||
return sf;
|
||||
}
|
||||
|
||||
std::string s;
|
||||
|
||||
if (next_feature_state.doing_deferrals) {
|
||||
if (next_feature_state.which_deferral >= next_feature_state.deferrals.size()) {
|
||||
// done with direct deserialization, done with deferred deserialization
|
||||
for (auto const fp : next_feature_state.deferrals) {
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
sf.t = -2;
|
||||
return sf;
|
||||
}
|
||||
|
||||
if (fread(&len, sizeof(len), 1, next_feature_state.deferrals[next_feature_state.which_deferral]) != 1) {
|
||||
next_feature_state.which_deferral++;
|
||||
continue;
|
||||
}
|
||||
|
||||
s.resize(len);
|
||||
if (fread((void *) s.c_str(), 1, len, next_feature_state.deferrals[next_feature_state.which_deferral]) != (size_t) len) {
|
||||
fprintf(stderr, "short read in deferred deserialization: %s\n", strerror(errno));
|
||||
exit(EXIT_READ);
|
||||
}
|
||||
} else {
|
||||
if (geoms->deserialize_long_long(&len, geompos_in) == 0) {
|
||||
fprintf(stderr, "Unexpected physical EOF in feature stream\n");
|
||||
exit(EXIT_READ);
|
||||
}
|
||||
if (len <= 0) {
|
||||
if (compressed) {
|
||||
geoms->end(geompos_in);
|
||||
}
|
||||
|
||||
next_feature_state.doing_deferrals = true;
|
||||
next_feature_state.which_deferral = 0;
|
||||
|
||||
for (auto const fp : next_feature_state.deferrals) {
|
||||
rewind(fp);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
s.resize(len);
|
||||
size_t n = geoms->fread((void *) s.c_str(), sizeof(char), s.size(), geompos_in);
|
||||
if (n != s.size()) {
|
||||
fprintf(stderr, "Short read (%zu for %zu) from geometry\n", n, s.size());
|
||||
exit(EXIT_READ);
|
||||
}
|
||||
s.resize(len);
|
||||
size_t n = geoms->fread((void *) s.c_str(), sizeof(char), s.size(), geompos_in);
|
||||
if (n != s.size()) {
|
||||
fprintf(stderr, "Short read (%zu for %zu) from geometry\n", n, s.size());
|
||||
exit(EXIT_READ);
|
||||
}
|
||||
|
||||
sf = deserialize_feature(s, z, tx, ty, initial_x, initial_y);
|
||||
sf.stringpool = global_stringpool + pool_off[sf.segment];
|
||||
|
||||
if (!next_feature_state.doing_deferrals && first_zoom && additional[A_DISTINGUISH_DUPLICATES] && sf.index == next_feature_state.previndex) {
|
||||
if (next_feature_state.which_deferral >= next_feature_state.deferrals.size()) {
|
||||
std::string tmpname = std::string(tmpdir) + std::string("/deferralXXXXXXXXXX");
|
||||
int fd = mkstemp((char *) tmpname.c_str());
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "Can't create temporary file %zu for feature deferral: %s\n", next_feature_state.which_deferral, strerror(errno));
|
||||
exit(EXIT_OPEN);
|
||||
}
|
||||
FILE *fp = fdopen(fd, "wb+");
|
||||
if (fp == NULL) {
|
||||
fprintf(stderr, "Can't reopen temporary file for feature deferral: %s\n", strerror(errno));
|
||||
exit(EXIT_OPEN);
|
||||
}
|
||||
next_feature_state.deferrals.resize(next_feature_state.which_deferral + 1);
|
||||
next_feature_state.deferrals[next_feature_state.which_deferral] = fp;
|
||||
}
|
||||
|
||||
fwrite(&len, sizeof(len), 1, next_feature_state.deferrals[next_feature_state.which_deferral]);
|
||||
fwrite(s.c_str(), 1, len, next_feature_state.deferrals[next_feature_state.which_deferral]);
|
||||
|
||||
// limit the maximum depth of deferral,
|
||||
// because even at z0 we will run out of file descriptors
|
||||
// (and tile space) if there are large numbers of duplicates
|
||||
if (next_feature_state.which_deferral < 50) {
|
||||
next_feature_state.which_deferral++;
|
||||
}
|
||||
continue;
|
||||
} else {
|
||||
next_feature_state.which_deferral = 0;
|
||||
}
|
||||
|
||||
// with fractional zoom level, so we can target a specific number
|
||||
// of features to keep with retain-points-multiplier, not just the
|
||||
// powers of the drop rate
|
||||
@@ -1376,7 +1311,6 @@ struct run_prefilter_args {
|
||||
std::vector<std::string> const *unidecode_data;
|
||||
bool first_time = false;
|
||||
bool compressed = false;
|
||||
bool first_zoom = false;
|
||||
double droprate = 1;
|
||||
};
|
||||
|
||||
@@ -1388,7 +1322,7 @@ void *run_prefilter(void *v) {
|
||||
next_feature_state next_feature_state;
|
||||
|
||||
while (1) {
|
||||
serial_feature sf = next_feature(rpa->geoms, rpa->geompos_in, rpa->z, rpa->tx, rpa->ty, rpa->initial_x, rpa->initial_y, rpa->original_features, rpa->unclipped_features, rpa->nextzoom, rpa->maxzoom, rpa->minzoom, rpa->max_zoom_increment, rpa->pass, rpa->along, rpa->alongminus, rpa->buffer, rpa->within, rpa->geomfile, rpa->geompos, rpa->start_geompos, rpa->oprogress, rpa->todo, rpa->fname, rpa->child_shards, rpa->filter, rpa->global_stringpool, rpa->pool_off, rpa->layer_unmaps, rpa->first_time, rpa->compressed, rpa->first_zoom, &multiplier_state, tile_stringpool, *(rpa->unidecode_data), next_feature_state, rpa->droprate);
|
||||
serial_feature sf = next_feature(rpa->geoms, rpa->geompos_in, rpa->z, rpa->tx, rpa->ty, rpa->initial_x, rpa->initial_y, rpa->original_features, rpa->unclipped_features, rpa->nextzoom, rpa->maxzoom, rpa->minzoom, rpa->max_zoom_increment, rpa->pass, rpa->along, rpa->alongminus, rpa->buffer, rpa->within, rpa->geomfile, rpa->geompos, rpa->start_geompos, rpa->oprogress, rpa->todo, rpa->fname, rpa->child_shards, rpa->filter, rpa->global_stringpool, rpa->pool_off, rpa->layer_unmaps, rpa->first_time, rpa->compressed, &multiplier_state, tile_stringpool, *(rpa->unidecode_data), next_feature_state, rpa->droprate);
|
||||
if (sf.t < 0) {
|
||||
break;
|
||||
}
|
||||
@@ -1420,7 +1354,7 @@ void *run_prefilter(void *v) {
|
||||
}
|
||||
|
||||
decode_meta(sf, tmp_layer, tmp_feature);
|
||||
tmp_layer.features.push_back(tmp_feature);
|
||||
tmp_layer.features.push_back(std::make_shared<mvt_feature>(tmp_feature));
|
||||
|
||||
layer_to_geojson(tmp_layer, 0, 0, 0, false, true, false, true, sf.index, sf.seq, sf.extent, true, state, 0, std::set<std::string>());
|
||||
}
|
||||
@@ -1684,7 +1618,7 @@ void skip_tile(decompressor *geoms, std::atomic<long long> *geompos_in, bool com
|
||||
}
|
||||
}
|
||||
|
||||
long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, char *global_stringpool, int z, const unsigned tx, const unsigned ty, const int detail, int min_detail, sqlite3 *outdb, const char *outdir, int buffer, const char *fname, compressor **geomfile, std::atomic<long long> *geompos, int minzoom, int maxzoom, double todo, std::atomic<long long> *along, long long alongminus, double gamma, int child_shards, long long *pool_off, unsigned *initial_x, unsigned *initial_y, std::atomic<int> *running, double simplification, std::vector<std::map<std::string, layermap_entry>> *layermaps, std::vector<std::vector<std::string>> *layer_unmaps, size_t tiling_seg, size_t pass, unsigned long long mingap, long long minextent, unsigned long long mindrop_sequence, const char *prefilter, const char *postfilter, json_object *filter, write_tile_args *arg, atomic_strategy *strategy_out, bool compressed_input, bool first_zoom, node *shared_nodes_map, size_t nodepos, std::string const &shared_nodes_bloom, std::vector<std::string> const &unidecode_data, long long estimated_complexity, std::set<zxy> &skip_children_out) {
|
||||
long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, char *global_stringpool, int z, const unsigned tx, const unsigned ty, const int detail, int min_detail, sqlite3 *outdb, const char *outdir, int buffer, const char *fname, compressor **geomfile, std::atomic<long long> *geompos, int minzoom, int maxzoom, double todo, std::atomic<long long> *along, long long alongminus, double gamma, int child_shards, long long *pool_off, unsigned *initial_x, unsigned *initial_y, std::atomic<int> *running, double simplification, std::vector<std::map<std::string, layermap_entry>> *layermaps, std::vector<std::vector<std::string>> *layer_unmaps, size_t tiling_seg, size_t pass, unsigned long long mingap, long long minextent, unsigned long long mindrop_sequence, const char *prefilter, const char *postfilter, json_object *filter, write_tile_args *arg, atomic_strategy *strategy_out, bool compressed_input, node *shared_nodes_map, size_t nodepos, std::string const &shared_nodes_bloom, std::vector<std::string> const &unidecode_data, long long estimated_complexity, std::set<zxy> &skip_children_out) {
|
||||
double merge_fraction = 1;
|
||||
double mingap_fraction = 1;
|
||||
double minextent_fraction = 1;
|
||||
@@ -1863,7 +1797,6 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
rpa.unidecode_data = &unidecode_data;
|
||||
rpa.first_time = first_time;
|
||||
rpa.compressed = compressed_input;
|
||||
rpa.first_zoom = first_zoom;
|
||||
rpa.droprate = arg->droprate;
|
||||
|
||||
// this does need to be a real thread, so we can pipe both to and from it
|
||||
@@ -1896,7 +1829,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
ssize_t which_serial_feature = -1;
|
||||
|
||||
if (prefilter == NULL) {
|
||||
sf = next_feature(geoms, geompos_in, z, tx, ty, initial_x, initial_y, &original_features, &unclipped_features, nextzoom, maxzoom, minzoom, max_zoom_increment, pass, along, alongminus, buffer, within, geomfile, geompos, start_geompos, &oprogress, todo, fname, child_shards, filter, global_stringpool, pool_off, layer_unmaps, first_time, compressed_input, first_zoom, &multiplier_state, tile_stringpool, unidecode_data, next_feature_state, arg->droprate);
|
||||
sf = next_feature(geoms, geompos_in, z, tx, ty, initial_x, initial_y, &original_features, &unclipped_features, nextzoom, maxzoom, minzoom, max_zoom_increment, pass, along, alongminus, buffer, within, geomfile, geompos, start_geompos, &oprogress, todo, fname, child_shards, filter, global_stringpool, pool_off, layer_unmaps, first_time, compressed_input, &multiplier_state, tile_stringpool, unidecode_data, next_feature_state, arg->droprate);
|
||||
} else {
|
||||
sf = parse_feature(prefilter_jp, z, tx, ty, layermaps, tiling_seg, layer_unmaps, postfilter != NULL, key_pool);
|
||||
}
|
||||
@@ -2654,7 +2587,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
add_tilestats(layer.name, z, layermaps, tiling_seg, layer_unmaps, "tippecanoe_feature_density", sv);
|
||||
}
|
||||
|
||||
layer.features.push_back(std::move(feature));
|
||||
layer.features.push_back(std::make_shared<mvt_feature>(feature));
|
||||
layer_features[x] = std::make_shared<serial_feature>();
|
||||
}
|
||||
|
||||
@@ -3084,7 +3017,7 @@ exit(EXIT_IMPOSSIBLE);
|
||||
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->first_zoom, 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);
|
||||
}
|
||||
|
||||
if (pthread_mutex_lock(&var_lock) != 0) {
|
||||
@@ -3150,7 +3083,7 @@ exit(EXIT_IMPOSSIBLE);
|
||||
return err_or_null;
|
||||
}
|
||||
|
||||
int traverse_zooms(int *geomfd, off_t *geom_size, char *global_stringpool, std::atomic<unsigned> *midx, std::atomic<unsigned> *midy, int &maxzoom, int minzoom, sqlite3 *outdb, const char *outdir, int buffer, const char *fname, double gamma, int full_detail, int low_detail, int min_detail, long long *pool_off, unsigned *initial_x, unsigned *initial_y, double simplification, double maxzoom_simplification, std::vector<std::map<std::string, layermap_entry>> &layermaps, const char *prefilter, const char *postfilter, std::unordered_map<std::string, attribute_op> const *attribute_accum, json_object *filter, std::vector<strategy> &strategies, int iz, node *shared_nodes_map, size_t nodepos, std::string const &shared_nodes_bloom, int basezoom, double droprate, std::vector<std::string> const &unidecode_data) {
|
||||
int traverse_zooms(int *geomfd, off_t *geom_size, char *global_stringpool, std::atomic<unsigned> *midx, std::atomic<unsigned> *midy, int &maxzoom, int minzoom, sqlite3 *outdb, const char *outdir, int buffer, const char *fname, const char *tmpdir, double gamma, int full_detail, int low_detail, int min_detail, long long *pool_off, unsigned *initial_x, unsigned *initial_y, double simplification, double maxzoom_simplification, std::vector<std::map<std::string, layermap_entry>> &layermaps, const char *prefilter, const char *postfilter, std::unordered_map<std::string, attribute_op> const *attribute_accum, json_object *filter, std::vector<strategy> &strategies, int iz, node *shared_nodes_map, size_t nodepos, std::string const &shared_nodes_bloom, int basezoom, double droprate, std::vector<std::string> const &unidecode_data) {
|
||||
last_progress = 0;
|
||||
|
||||
// The existing layermaps are one table per input thread.
|
||||
@@ -3342,7 +3275,6 @@ int traverse_zooms(int *geomfd, off_t *geom_size, char *global_stringpool, std::
|
||||
args[thread].strategy = &strategy;
|
||||
args[thread].zoom = z;
|
||||
args[thread].compressed = (z != iz);
|
||||
args[thread].first_zoom = (z == iz);
|
||||
args[thread].shared_nodes_map = shared_nodes_map;
|
||||
args[thread].nodepos = nodepos;
|
||||
args[thread].shared_nodes_bloom = &shared_nodes_bloom;
|
||||
|
||||
@@ -62,7 +62,7 @@ struct strategy {
|
||||
|
||||
// long long write_tile(char **geom, char *stringpool, unsigned *file_bbox, int z, unsigned x, unsigned y, int detail, int min_detail, int basezoom, sqlite3 *outdb, const char *outdir, double droprate, int buffer, const char *fname, FILE **geomfile, int file_minzoom, int file_maxzoom, double todo, char *geomstart, long long along, double gamma, int nlayers, std::atomic<strategy> *strategy);
|
||||
|
||||
int traverse_zooms(int *geomfd, off_t *geom_size, char *stringpool, std::atomic<unsigned> *midx, std::atomic<unsigned> *midy, int &maxzoom, int minzoom, sqlite3 *outdb, const char *outdir, int buffer, const char *fname, double gamma, int full_detail, int low_detail, int min_detail, long long *pool_off, unsigned *initial_x, unsigned *initial_y, double simplification, double maxzoom_simplification, std::vector<std::map<std::string, layermap_entry> > &layermap, const char *prefilter, const char *postfilter, std::unordered_map<std::string, attribute_op> const *attribute_accum, struct json_object *filter, std::vector<strategy> &strategies, int iz, struct node *shared_nodes_map, size_t nodepos, std::string const &shared_nodes_bloom, int basezoom, double droprate, std::vector<std::string> const &unidecode_data);
|
||||
int traverse_zooms(int *geomfd, off_t *geom_size, char *stringpool, std::atomic<unsigned> *midx, std::atomic<unsigned> *midy, int &maxzoom, int minzoom, sqlite3 *outdb, const char *outdir, int buffer, const char *fname, const char *tmpdir, double gamma, int full_detail, int low_detail, int min_detail, long long *pool_off, unsigned *initial_x, unsigned *initial_y, double simplification, double maxzoom_simplification, std::vector<std::map<std::string, layermap_entry> > &layermap, const char *prefilter, const char *postfilter, std::unordered_map<std::string, attribute_op> const *attribute_accum, struct json_object *filter, std::vector<strategy> &strategies, int iz, struct node *shared_nodes_map, size_t nodepos, std::string const &shared_nodes_bloom, int basezoom, double droprate, std::vector<std::string> const &unidecode_data);
|
||||
|
||||
int manage_gap(unsigned long long index, unsigned long long *previndex, double scale, double gamma, double *gap);
|
||||
|
||||
|
||||
+1
-1
@@ -270,7 +270,7 @@ void write_coords(json_writer &state, lonlat const &ll, double scale) {
|
||||
|
||||
void layer_to_geojson(mvt_layer const &layer, unsigned z, unsigned x, unsigned y, bool comma, bool name, bool zoom, bool write_dropped, unsigned long long index, long long sequence, long long extent, bool complain, json_writer &state, double scale, std::set<std::string> const &include_attr) {
|
||||
for (size_t f = 0; f < layer.features.size(); f++) {
|
||||
mvt_feature const &feat = layer.features[f];
|
||||
mvt_feature const &feat = *layer.features[f];
|
||||
|
||||
state.json_write_hash();
|
||||
state.json_write_string("type");
|
||||
|
||||
Reference in New Issue
Block a user