Skip to content
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

Merged
merged 9 commits into from Jan 17, 2019

Conversation

rakeshkky
Copy link
Member

Description

What component does this PR affect?

  • Server
  • Console
  • CLI
  • Docs
  • Community Content
  • Build System

Requires changes from other components? If yes, please mark the components:

  • Server
  • Console
  • CLI
  • Docs
  • Community Content
  • Build System

Related Issue

close #1051

Solution and Design

Support postgis functions (which returns bool) in boolean expressions mentioned here

Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Docs update
  • Community content

Checklist:

  • I have read the contributing guide and my code conforms to the guidelines.
  • This change requires a change in the documentation.
  • I have updated the documentation accordingly.
  • I have added required tests.

@rakeshkky rakeshkky added s/ok-to-merge Status: This pull request can be merged to master c/server Related to server c/docs Related to docs labels Jan 14, 2019
@rakeshkky rakeshkky self-assigned this Jan 14, 2019
@rakeshkky rakeshkky requested a review from 0x777 January 14, 2019 10:51
@hasura-bot
Copy link
Contributor

Review app for commit 95fb110 deployed to Heroku: https://hge-ci-pull-1372.herokuapp.com
Docker image for server: hasura/graphql-engine:pull1372-95fb110

- PostGIS equivalent
* - ``_st_contains``
- ``ST_Contains``
* - ``_st_contains_in``
Copy link
Member

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"
Copy link
Member

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"
Copy link
Member

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"
Copy link
Member

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"
Copy link
Member

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"
Copy link
Member

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"
Copy link
Member

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"
Copy link
Member

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"

@@ -460,6 +460,7 @@ data BoolExp
| BENotNull !SQLExp
| BEExists !Select
| BEIN !SQLExp ![SQLExp]
| BEFunc !T.Text ![SQLExp]
Copy link
Member

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"
Copy link
Member

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"

@hasura-bot
Copy link
Contributor

Review app for commit c6e755f deployed to Heroku: https://hge-ci-pull-1372.herokuapp.com
Docker image for server: hasura/graphql-engine:pull1372-c6e755f

@0x777 0x777 merged commit 7ff1c88 into hasura:master Jan 17, 2019
@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-1372.herokuapp.com is deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/docs Related to docs c/server Related to server s/ok-to-merge Status: This pull request can be merged to master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PostGIS topology operator
3 participants