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 PostGIS operators in boolean expressions (close #1051) #1372
Conversation
TODO:- Add Tests
Review app for commit 95fb110 deployed to Heroku: https://hge-ci-pull-1372.herokuapp.com |
- PostGIS equivalent | ||
* - ``_st_contains`` | ||
- ``ST_Contains`` | ||
* - ``_st_contains_in`` |
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.
_st_contains_in
to _st_contained_in
.
stDWithinOpInpVal = | ||
InpValInfo (Just stDWithinDesc) "_st_d_within" $ G.toGT stDWithinInpTy | ||
stDWithinDesc = | ||
"is the column within in the given distance from given geometry value" |
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.
is the column within a distance from a geometry value
geomOps = | ||
[ | ||
( "_st_contains" | ||
, "does the column contain given geometry value" |
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.
"does the column contain the given geometry value"
) | ||
, | ||
( "_st_contains_in" | ||
, "is the column contained in given geometry value" |
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.
in the*
, "is the column contained in given geometry value" | ||
) | ||
, ( "_st_crosses" | ||
, "does the column crosses given geometry value" |
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.
the given
, "does the column crosses given geometry value" | ||
) | ||
, ( "_st_disjoint" | ||
, "does the column don't spatially intersect the given geometry value" |
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.
"the opposite of _st_intersects, it is often more efficient to use _not: {_st_intersects: value} over this operator"
, ( "_st_touches" | ||
, "does the column have atleast one point in common with given geometry value" | ||
) | ||
, ( "_st_within" |
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.
Same as _contained_in
?
, "does the column spatially intersect the given geometry value" | ||
) | ||
, ( "_st_overlaps" | ||
, "does the column overlaps given geometry value" |
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.
"does the column 'spatially overlap' (intersect but not completely contain) the given geometry value"
server/src-lib/Hasura/SQL/DML.hs
Outdated
@@ -460,6 +460,7 @@ data BoolExp | |||
| BENotNull !SQLExp | |||
| BEExists !Select | |||
| BEIN !SQLExp ![SQLExp] | |||
| BEFunc !T.Text ![SQLExp] |
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.
Why not have BEExp !SQLExp
so that any SQLExp of type boolean can be used? Avoids having to define SEFnApp
like constructor for BoolExp
, "does the column have atleast one point in common with the given geometry value" | ||
) | ||
, ( "_st_within" | ||
, "does the column completely inside given geometry value" |
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.
"is the column contained in the given geometry value"
Review app for commit c6e755f deployed to Heroku: https://hge-ci-pull-1372.herokuapp.com |
Review app https://hge-ci-pull-1372.herokuapp.com is deleted |
Description
What component does this PR affect?
Requires changes from other components? If yes, please mark the components:
Related Issue
close #1051
Solution and Design
Support postgis functions (which returns bool) in boolean expressions mentioned here
Type
Checklist: