mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Simplify the filter format, and actually run the filter.
This commit is contained in:
+1
-13
@@ -174,19 +174,7 @@ bool eval(std::map<std::string, mvt_value> const &feature, json_object *f) {
|
||||
}
|
||||
|
||||
bool evaluate(std::map<std::string, mvt_value> const &feature, std::string const &layer, json_object *filter) {
|
||||
json_object *layers = json_hash_get(filter, "layers");
|
||||
|
||||
if (layers == NULL) {
|
||||
fprintf(stderr, "Filter: no \"layers\" key at top level\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (layers->type != JSON_HASH) {
|
||||
fprintf(stderr, "Filter: \"layers\" is not a hash\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
json_object *f = json_hash_get(layers, layer.c_str());
|
||||
json_object *f = json_hash_get(filter, layer.c_str());
|
||||
|
||||
if (f != NULL) {
|
||||
return eval(feature, f);
|
||||
|
||||
Reference in New Issue
Block a user