This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
Add more predicate operator to mbgl filter translations - #6405
Merged
Merged
Conversation
boundsj
force-pushed
the
boundsj-more-pred-to-filter-translations
branch
2 times, most recently
from
September 20, 2016 23:35
8e8bd4d to
78b43be
Compare
Adds several new translations to prevent data loss.
boundsj
force-pushed
the
boundsj-more-pred-to-filter-translations
branch
from
September 21, 2016 00:00
78b43be to
e1d5504
Compare
1ec5
suggested changes
Sep 21, 2016
1ec5
left a comment
Contributor
There was a problem hiding this comment.
Pretty sure == nil and != nil are flipped, but looks good otherwise.
| } | ||
| else | ||
| { | ||
| auto filter = mbgl::style::NotHasFilter(); |
Contributor
There was a problem hiding this comment.
Shouldn’t %K != nil be an mbgl::style::HasFilter?
| } | ||
| else | ||
| { | ||
| auto filter = mbgl::style::HasFilter(); |
Contributor
There was a problem hiding this comment.
Shouldn’t %K == nil be an mbgl::style::NotHasFilter?
| [NSException raise:@"Unsupported filter type" | ||
| format:@"Cannot convert mbgl::style::HasFilter to NSPredicate"]; | ||
| return nil; | ||
| return [NSPredicate predicateWithFormat:@"%K == nil", @(filter.key.c_str())]; |
Contributor
There was a problem hiding this comment.
Shouldn’t this be %K != nil?
| [NSException raise:@"Unsupported filter type" | ||
| format:@"Cannot convert mbgl::style::NotHasFilter to NSPredicate"]; | ||
| return nil; | ||
| return [NSPredicate predicateWithFormat:@"%K != nil", @(filter.key.c_str())]; |
| { | ||
| // core does not have a "contains" filter but we can achieve the equivilant by creating a set of greater than or equal / less than or equal | ||
| // filters for the lower and upper bounds (inclusive) | ||
| NSPredicate *expectedPredicate = [NSCompoundPredicate andPredicateWithSubpredicates:@[[NSPredicate predicateWithFormat:@"%K >= 2", @"stroke-width"], |
Contributor
There was a problem hiding this comment.
This could be expressed more succinctly as %K >= 2 AND %K <= 3
Contributor
Author
oops, will fix |
1ec5
approved these changes
Sep 21, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6244
cc @1ec5 @frederoni