-
Notifications
You must be signed in to change notification settings - Fork 18
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
support geo.{intersects, distance, length} #50
Conversation
updated query parsing for geo.* functions, and added django backend implementation. -add GEOGRAPHY token and Geography AST node -account for identifier namespace in various places -add django implementation using django.contrib.gis -use '__' for namespace separator in backend function names -fix geo.distance number of args
this allows for syntax like: OData.CSC.Intersects(area=geography'SRID=4326;Point(1 2)') -add NamedParam ast Node (with name, param attrs) -add '=' literal -add list_named_parameters grammar (similar to list_expr) -only check args for functions with namespace () or ('geo',) -in django_q visitor, passed NamedParams as keyword args externally, we can now use the following to support above query: class AstToDjangoQVisitorCSC(AstToDjangoQVisitor): def djangofunc_odata__csc__intersects(self, area): return super().djangofunc_geo__intersects(ast.Identifier('footprint'), area)
Hey, thanks for this, it's looking great! 👍 Two things I'd like to add (or see added) are:
I'd happily work on those. It would be a good opportunity for me to learn some Geo/GIS stuff! |
Just for traceability mentioning that this implements #48 |
thanks for adding checks and tests! :) I somehow missed the tests, sorry. something else I forgot was to improve the argument names and typing for djangofunc_geo__*. I will do this shortly. |
would crash with argument mismatch.
Hey, great work so far! I finally found some time to work a bit on this again. Still ironing out some minor issues. E.g. certain Python versions fail to find the GDAL libraries, while others work fine. |
Any news on this? I had a look at the failed test and it looked like a linting error (which should probably be easy to resolve). |
Hey, sorry about the wait! I've been experimenting with some end-to-end integration tests using a local Spatialite database on this branch: https://github.com/gorilla-co/odata-query/tree/tests/geo-integration-tests That's turning out to be a bit of a pain, some versions of Python seem to have issues finding/using the geo libraries. Afterwards I'd still have to get that set up in the Github actions workflows. Sorry again, and thanks for your patience 🙏 |
Bingo, we now have E2E integration tests using a Spatialite database running in Github Actions. Adding some colleagues as reviewers for a quick final checkoff and then I'll merge. Thanks again for this! |
updated query parsing for geo.* functions, and added django backend implementation.
-add GEOGRAPHY token and Geography AST node
-account for identifier namespace in various places
-add django implementation using django.contrib.gis
-use '__' for namespace separator in backend function names
-fix geo.distance number of args