mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 09:55:41 +02:00
Add a flag to exclude all attributes from the tile side of the join
This commit is contained in:
+9
-3
@@ -55,6 +55,7 @@ int maxzoom = 32;
|
|||||||
int minzoom = 0;
|
int minzoom = 0;
|
||||||
std::map<std::string, std::string> renames;
|
std::map<std::string, std::string> renames;
|
||||||
bool exclude_all = false;
|
bool exclude_all = false;
|
||||||
|
bool exclude_all_tile_attributes = false;
|
||||||
std::vector<std::string> unidecode_data;
|
std::vector<std::string> unidecode_data;
|
||||||
std::string join_tile_column;
|
std::string join_tile_column;
|
||||||
std::string join_table_column;
|
std::string join_table_column;
|
||||||
@@ -274,9 +275,11 @@ void append_tile(std::string message, int z, unsigned x, unsigned y, std::map<st
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (include.count(key) || (!exclude_all && exclude.count(key) == 0 && exclude_attributes.count(key) == 0)) {
|
if (!exclude_all_tile_attributes) {
|
||||||
attributes.insert(std::pair<std::string, std::pair<mvt_value, serial_val>>(key, std::pair<mvt_value, serial_val>(val, sv)));
|
if (include.count(key) || (!exclude_all && exclude.count(key) == 0 && exclude_attributes.count(key) == 0)) {
|
||||||
key_order.push_back(key);
|
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()) {
|
||||||
@@ -1367,6 +1370,7 @@ int main(int argc, char **argv) {
|
|||||||
{"exclude", required_argument, 0, 'x'},
|
{"exclude", required_argument, 0, 'x'},
|
||||||
{"exclude-all", no_argument, 0, 'X'},
|
{"exclude-all", no_argument, 0, 'X'},
|
||||||
{"include", required_argument, 0, 'y'},
|
{"include", required_argument, 0, 'y'},
|
||||||
|
{"exclude-all-tile-attributes", no_argument, 0, '~'},
|
||||||
{"layer", required_argument, 0, 'l'},
|
{"layer", required_argument, 0, 'l'},
|
||||||
{"exclude-layer", required_argument, 0, 'L'},
|
{"exclude-layer", required_argument, 0, 'L'},
|
||||||
{"quiet", no_argument, 0, 'q'},
|
{"quiet", no_argument, 0, 'q'},
|
||||||
@@ -1581,6 +1585,8 @@ int main(int argc, char **argv) {
|
|||||||
join_tile_column = optarg;
|
join_tile_column = optarg;
|
||||||
} else if (strcmp(opt, "use-attribute-for-id") == 0) {
|
} else if (strcmp(opt, "use-attribute-for-id") == 0) {
|
||||||
attribute_for_id = optarg;
|
attribute_for_id = optarg;
|
||||||
|
} else if (strcmp(opt, "exclude-all-tile-attributes") == 0) {
|
||||||
|
exclude_all_tile_attributes = true;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "%s: Unrecognized option --%s\n", argv[0], opt);
|
fprintf(stderr, "%s: Unrecognized option --%s\n", argv[0], opt);
|
||||||
exit(EXIT_ARGS);
|
exit(EXIT_ARGS);
|
||||||
|
|||||||
Reference in New Issue
Block a user