mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-06 10:25:41 +02:00
Avoid crash if the first bin gets clipped away
This commit is contained in:
@@ -1299,7 +1299,8 @@ static void handle_closepath_from_mvt(drawvec &geom) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void feature_out(std::vector<tile_feature> const &features, mvt_layer &outlayer,
|
// returns true if a feature was output; false if it was clipped away
|
||||||
|
static bool feature_out(std::vector<tile_feature> const &features, mvt_layer &outlayer,
|
||||||
std::set<std::string> const &keep,
|
std::set<std::string> const &keep,
|
||||||
std::set<std::string> const &exclude,
|
std::set<std::string> const &exclude,
|
||||||
std::vector<std::string> const &exclude_prefix,
|
std::vector<std::string> const &exclude_prefix,
|
||||||
@@ -1427,7 +1428,10 @@ static void feature_out(std::vector<tile_feature> const &features, mvt_layer &ou
|
|||||||
}
|
}
|
||||||
|
|
||||||
outlayer.features.push_back(std::move(outfeature));
|
outlayer.features.push_back(std::move(outfeature));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct preservecmp {
|
static struct preservecmp {
|
||||||
@@ -1719,9 +1723,9 @@ mvt_tile assign_to_bins(mvt_tile &features,
|
|||||||
|
|
||||||
for (size_t i = 0; i < outfeatures.size(); i++) {
|
for (size_t i = 0; i < outfeatures.size(); i++) {
|
||||||
if (outfeatures[i].size() > 1) {
|
if (outfeatures[i].size() > 1) {
|
||||||
feature_out(outfeatures[i], outlayer,
|
if (feature_out(outfeatures[i], outlayer,
|
||||||
keep, exclude, exclude_prefix, attribute_accum,
|
keep, exclude, exclude_prefix, attribute_accum,
|
||||||
accumulate_numeric, key_pool, buffer);
|
accumulate_numeric, key_pool, buffer)) {
|
||||||
mvt_feature &nfeature = outlayer.features.back();
|
mvt_feature &nfeature = outlayer.features.back();
|
||||||
mvt_value val;
|
mvt_value val;
|
||||||
val.type = mvt_uint;
|
val.type = mvt_uint;
|
||||||
@@ -1736,6 +1740,7 @@ mvt_tile assign_to_bins(mvt_tile &features,
|
|||||||
outlayer.tag(nfeature, attrname, val);
|
outlayer.tag(nfeature, attrname, val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mvt_tile ret;
|
mvt_tile ret;
|
||||||
ret.layers.push_back(outlayer);
|
ret.layers.push_back(outlayer);
|
||||||
|
|||||||
Reference in New Issue
Block a user