-
Notifications
You must be signed in to change notification settings - Fork 81
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
JSON filter expressions #283
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tim, why does the pull request say that the changed file(s) are under extensions/filter/languages/jfe ...? All this stuff should be under the extensions/cql directory. Having all this preliminary work, all related to the same topic, spread across multiple directories will -- in my opinion -- really confuse the work of of the SWG. Feel free to reorgnize the files under extensions/cql though (expect the standard) directory.
Will do @pvretano I thought the extension was going to be called "filter" and that one of the supported languages would be CQL. I'll move it back under |
Thanks @tschaub . My feeling is that CQL -- although started in OAPIF -- will end up in OGC API - Common at which point that SWG will organize as they see fit. For now it probably best to keep everything CQL related in one place. |
b056ed5
to
68e1148
Compare
7ad50a8
to
06657c0
Compare
Co-Authored-By: Even Rouault <even.rouault@spatialys.com>
Co-Authored-By: Even Rouault <even.rouault@spatialys.com>
06657c0
to
3d20056
Compare
3d20056
to
45ce9c7
Compare
Here is a proposed syntax for the JSON encoded filter expressions. Please see the readme for a starting point.
I've included valid and invalid fixtures for tests against the schema (run the tests with
python test.py
). Thedoc.py
script extracts title, description, and examples for expressions in the schema. I've pasted this output in the readme linked above.As mentioned in the sprint presentations, I was shooting for feature parity with CQL (which I hope I have demonstrated is straightforward - if there are missing operators, they can be added). I was also hoping to encourage some level of interoperability with expressions in the Mapbox Style Spec. If OGC is considering a general purpose "filter" extension, and will later potentially be reconsidering some sort of "style" extension, I think it makes sense to aim for interoperability with the Mapbox Style Spec where possible. The JSON filter expressions I've proposed here would fit nicely with a JSON encoding for styles that is interoperable with Mapbox.
The readme links to these as well, but here are few brave implementors:
National Land Survey of Finland OGC API – Features implementation at https://beta-paikkatieto.maanmittauslaitos.fi/maastotiedot/features/v1/ with experimental support for
filter-lang=json-filter-expr
. E.g.https://beta-paikkatieto.maanmittauslaitos.fi/maastotiedot/features/v1/collections/tieviiva/items?limit=100&filter-lang=json-filter-expr&filter=["==",["get","kohdeluokka"],12316]
Experimental support in GDAL (using
filter-lang=json-filter-expr
) - OAPIF: implement https://github.com/tschaub/ogcapi-features/blob/json-array-expression/extensions/cql/jfe/readme.md OSGeo/gdal#1999Generic Golang parser for JSON (Filter) Expressions - https://github.com/tschaub/jiffy
Support for JSON Filter Expression parsing in pygeofilter - https://github.com/geopython/pygeofilter