From 65fc99c9d127c14e4eed7eff1a682ea0c7012c26 Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Fri, 20 Sep 2024 13:23:02 -0700 Subject: [PATCH] For debugging, make an attribute list of source feature IDs --- clip.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/clip.cpp b/clip.cpp index c1bf81f1..1c421e6e 100644 --- a/clip.cpp +++ b/clip.cpp @@ -1267,6 +1267,8 @@ static void feature_out(std::vector const &features, mvt_layer &ou std::unordered_map const &attribute_accum, std::shared_ptr const &tile_stringpool, std::string const &accumulate_numeric) { + std::string outfids = ""; + // Add geometry to output feature mvt_feature outfeature; @@ -1321,6 +1323,10 @@ static void feature_out(std::vector const &features, mvt_layer &ou // features that will not for (size_t i = 1; i < features.size(); i++) { + if (features[i].has_id) { + outfids += std::to_string(features[i].id) + ","; + } + std::set keys; for (size_t j = 0; j + 1 < features[i].tags.size(); j += 2) { @@ -1366,6 +1372,12 @@ static void feature_out(std::vector const &features, mvt_layer &ou } } + if (outfids.size() > 0) { + mvt_value v; + v.set_string_value(outfids); + outlayer.tag(outfeature, "source_fids", v); + } + outlayer.features.push_back(std::move(outfeature)); } }