mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-06 10:25:41 +02:00
Adding the joined attribute should be per-feature, not per-attribute
This commit is contained in:
+16
-16
@@ -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::map<std::string, std::pair<mvt_value, serial_val>> attributes;
|
||||||
std::vector<std::string> key_order;
|
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 (f < joined.size()) {
|
||||||
if (joined[f].size() > 0) {
|
if (joined[f].size() > 0) {
|
||||||
matched = true;
|
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]) {
|
if (header.size() > 0 && key == header[0]) {
|
||||||
std::map<std::string, std::vector<std::string>>::iterator ii = mapping.find(sv.s);
|
std::map<std::string, std::vector<std::string>>::iterator ii = mapping.find(sv.s);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user