mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 18:05:42 +02:00
Fix output of features added to the bin after its closure
This commit is contained in:
@@ -1611,24 +1611,6 @@ mvt_tile assign_to_bins(mvt_tile const &features, std::vector<mvt_layer> const &
|
|||||||
} else /* EXIT */ {
|
} else /* EXIT */ {
|
||||||
auto const &found = active.find({e.layer, e.feature});
|
auto const &found = active.find({e.layer, e.feature});
|
||||||
if (found != active.end()) {
|
if (found != active.end()) {
|
||||||
if (outfeatures[found->outfeature].size() > 1) {
|
|
||||||
feature_out(outfeatures[found->outfeature], outlayer,
|
|
||||||
keep, exclude, exclude_prefix, attribute_accum,
|
|
||||||
tile_stringpool, accumulate_numeric);
|
|
||||||
mvt_feature &nfeature = outlayer.features.back();
|
|
||||||
mvt_value val;
|
|
||||||
val.type = mvt_uint;
|
|
||||||
val.numeric_value.uint_value = outfeatures[found->outfeature].size() - 1;
|
|
||||||
|
|
||||||
std::string attrname;
|
|
||||||
if (accumulate_numeric.size() == 0) {
|
|
||||||
attrname = "tippecanoe:count";
|
|
||||||
} else {
|
|
||||||
attrname = accumulate_numeric + ":count";
|
|
||||||
}
|
|
||||||
outlayer.tag(nfeature, attrname, val);
|
|
||||||
}
|
|
||||||
|
|
||||||
active.erase(found);
|
active.erase(found);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "event mismatch: can't happen\n");
|
fprintf(stderr, "event mismatch: can't happen\n");
|
||||||
@@ -1637,6 +1619,26 @@ mvt_tile assign_to_bins(mvt_tile const &features, std::vector<mvt_layer> const &
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (size_t i = 0; i < outfeatures.size(); i++) {
|
||||||
|
if (outfeatures[i].size() > 1) {
|
||||||
|
feature_out(outfeatures[i], outlayer,
|
||||||
|
keep, exclude, exclude_prefix, attribute_accum,
|
||||||
|
tile_stringpool, accumulate_numeric);
|
||||||
|
mvt_feature &nfeature = outlayer.features.back();
|
||||||
|
mvt_value val;
|
||||||
|
val.type = mvt_uint;
|
||||||
|
val.numeric_value.uint_value = outfeatures[i].size() - 1;
|
||||||
|
|
||||||
|
std::string attrname;
|
||||||
|
if (accumulate_numeric.size() == 0) {
|
||||||
|
attrname = "tippecanoe:count";
|
||||||
|
} else {
|
||||||
|
attrname = accumulate_numeric + ":count";
|
||||||
|
}
|
||||||
|
outlayer.tag(nfeature, attrname, val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mvt_tile ret;
|
mvt_tile ret;
|
||||||
ret.layers.push_back(outlayer);
|
ret.layers.push_back(outlayer);
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user