Skip to content

Commit

Permalink
For debugging, make an attribute list of source feature IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed Sep 20, 2024
1 parent 469b49d commit 65fc99c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,8 @@ static void feature_out(std::vector<tile_feature> const &features, mvt_layer &ou
std::unordered_map<std::string, attribute_op> const &attribute_accum,
std::shared_ptr<std::string> const &tile_stringpool,
std::string const &accumulate_numeric) {
std::string outfids = "";

// Add geometry to output feature

mvt_feature outfeature;
Expand Down Expand Up @@ -1321,6 +1323,10 @@ static void feature_out(std::vector<tile_feature> 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<std::string> keys;

for (size_t j = 0; j + 1 < features[i].tags.size(); j += 2) {
Expand Down Expand Up @@ -1366,6 +1372,12 @@ static void feature_out(std::vector<tile_feature> 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));
}
}
Expand Down

0 comments on commit 65fc99c

Please sign in to comment.