From fcc611adc4b822640483fe3f4156e6b537d8a641 Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Tue, 17 Dec 2024 15:22:34 -0800 Subject: [PATCH] Observe attribute exclusion when joining from sql queries --- tile-join.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tile-join.cpp b/tile-join.cpp index 78c2573f..ce4e436a 100644 --- a/tile-join.cpp +++ b/tile-join.cpp @@ -279,14 +279,19 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map 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>(kv.first, std::pair(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>(kv.first, std::pair(kv.second, mvt_value_to_serial_val(kv.second)))); + key_order.push_back(kv.first); + } } } }