-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add intersection decision operator(s) #764
Comments
Why not create a query to a server to get the relevant line and show them? |
@HarelM What do you mean? The map data is all in Protomaps format. We don't query a server for specific data we just pull down tiles. |
Ahh, interesting. |
There's no need to implement them all unless there is demand and it can be done performantly. It just seems strange there would be a "overlaps completely" operator and no simple "overlaps" operator.
If you're asking whether I can just query the source layers for trails, run them through an intersection function outside MapLibre, and then filter them manually based on their ID or something… I guess so, but this seems like re-implementing |
Design Proposal: Add intersection decision operator(s)
Motivation
Over at osmus/OpenTrailMap we're adding the ability to filter trail data to a specific park. In MapLibre we can filter POIs easily with the
within
operator. However, we also want to filter trails.within
works for lines, but it will exclude lines that are not strictly contained, so we would lose any that cross the border of the park.Proposed Change
Adding one or more spatial relationship operators dealing with intersection would fulfill the need, namely
intersects
(the boundary and interior of the feature intersects the boundary or interior of the other).API Modifications
Add one or more decision operators.
Migration Plan and Compatibility
The feature would be purely additive and does not impact current users.
Rejected Alternatives
We could buffer the bounding feature a bit before applying
within
, but we'd risk losing very long lines, and we might include cruft we don't want. We could theoretically preprocess trails to split them at park boundaries when rendering tiles, but that seems like overkill. We could not filter lines at all, but that sort of defeats the purpose of focusing on a specific park and looks messy. In the below example, POIs are filtered to the dark green area while trails are not.The text was updated successfully, but these errors were encountered: