diff --git a/tile-join.cpp b/tile-join.cpp index facfda01..f687e386 100644 --- a/tile-join.cpp +++ b/tile-join.cpp @@ -55,6 +55,8 @@ int minzoom = 0; std::map renames; bool exclude_all = false; std::vector unidecode_data; +std::string join_tile_column; +std::string join_table_column; bool want_overzoom = false; int buffer = 5; @@ -144,9 +146,9 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map exclude_attributes; + mvt_feature &feat = layer.features[f]; + std::set exclude_attributes; if (filter != NULL && !evaluate(feat, layer, filter, exclude_attributes, z, unidecode_data)) { continue; } @@ -163,7 +165,7 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map key_order; for (size_t t = 0; t + 1 < feat.tags.size(); t += 2) { - const char *key = layer.keys[feat.tags[t]].c_str(); + 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); @@ -171,12 +173,15 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map>(key, std::pair(val, sv))); key_order.push_back(key); } - if (header.size() > 0 && strcmp(key, header[0].c_str()) == 0) { + if (key == join_tile_column) { + } + + if (header.size() > 0 && key == header[0]) { std::map>::iterator ii = mapping.find(sv.s); if (ii != mapping.end()) { @@ -1203,8 +1208,6 @@ int main(int argc, char **argv) { json_object *filter = NULL; std::string join_sqlite_fname; - std::string join_tile_column; - std::string join_table_column; struct tileset_reader *readers = NULL;