Skip to content

Commit

Permalink
Observe attribute exclusion when joining from sql queries
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed Dec 17, 2024
1 parent 03daaef commit fcc611a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tile-join.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,19 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map<st
}

if (f < joined.size()) {
if (joined[f].size() > 0) {
matched = true;
}

for (auto const &kv : joined[f]) {
if (kv.first == attribute_for_id) {
outfeature.has_id = true;
outfeature.id = mvt_value_to_long_long(kv.second);
} else if (kv.second.type != mvt_null) {
attributes.insert(std::pair<std::string, std::pair<mvt_value, serial_val>>(kv.first, std::pair<mvt_value, serial_val>(kv.second, mvt_value_to_serial_val(kv.second))));
key_order.push_back(kv.first);
matched = true;
} else if (include.count(kv.first) || (!exclude_all && exclude.count(kv.first) == 0 && exclude_attributes.count(kv.first) == 0)) {
if (kv.second.type != mvt_null) {
attributes.insert(std::pair<std::string, std::pair<mvt_value, serial_val>>(kv.first, std::pair<mvt_value, serial_val>(kv.second, mvt_value_to_serial_val(kv.second))));
key_order.push_back(kv.first);
}
}
}
}
Expand Down

0 comments on commit fcc611a

Please sign in to comment.