Adding the joined attribute should be per-feature, not per-attribute

This commit is contained in:
Erica Fischer
2025-01-07 13:27:35 -08:00
parent b0326b6541
commit 3d22a41171
+16 -16
View File
@@ -305,22 +305,6 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map<st
std::map<std::string, std::pair<mvt_value, serial_val>> attributes;
std::vector<std::string> key_order;
for (size_t t = 0; t + 1 < feat.tags.size(); t += 2) {
const std::string &key = layer.keys[feat.tags[t]];
mvt_value &val = layer.values[feat.tags[t + 1]];
serial_val sv = mvt_value_to_serial_val(val);
if (sv.type == mvt_null) {
continue;
}
if (!exclude_all_tile_attributes) {
if (include.count(key) || (!exclude_all && exclude.count(key) == 0 && exclude_attributes.count(key) == 0)) {
attributes.insert(std::pair<std::string, std::pair<mvt_value, serial_val>>(key, std::pair<mvt_value, serial_val>(val, sv)));
key_order.push_back(key);
}
}
if (f < joined.size()) {
if (joined[f].size() > 0) {
matched = true;
@@ -341,6 +325,22 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map<st
}
}
for (size_t t = 0; t + 1 < feat.tags.size(); t += 2) {
const std::string &key = layer.keys[feat.tags[t]];
mvt_value &val = layer.values[feat.tags[t + 1]];
serial_val sv = mvt_value_to_serial_val(val);
if (sv.type == mvt_null) {
continue;
}
if (!exclude_all_tile_attributes) {
if (include.count(key) || (!exclude_all && exclude.count(key) == 0 && exclude_attributes.count(key) == 0)) {
attributes.insert(std::pair<std::string, std::pair<mvt_value, serial_val>>(key, std::pair<mvt_value, serial_val>(val, sv)));
key_order.push_back(key);
}
}
if (header.size() > 0 && key == header[0]) {
std::map<std::string, std::vector<std::string>>::iterator ii = mapping.find(sv.s);