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

builtins: implement ST_MakeEnvelope(float xmin, float ymin, float xmax, float ymax, integer srid=unknown) #80357

Closed
fredbi opened this issue Apr 22, 2022 · 1 comment · Fixed by #80408
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) good first issue O-community Originated from the community

Comments

@fredbi
Copy link
Contributor

fredbi commented Apr 22, 2022

Is your feature request related to a problem? Please describe.
Our app makes extensive use of geometry bounds (e.g. to filter geo-located things).

We use the ST_MakeEnvelope function to build geometries suitable for geospatial indexes out.

ST_MakeEnvelope(float xmin, float ymin, float xmax, float ymax, integer srid=unknown) -> geometry

But this is not supported by cockroachDB as v22.1.x.

Describe the solution you'd like
Have support for ST_MakeEnvelope(loat xmin, float ymin, float xmax, float ymax, integer srid=unknown) -> geometry

Describe alternatives you've considered
As of v22.1.x, we only have the following alternative:

  • either build a geometry in the client code from the bounds then pass it as a geometry arg to the query
  • or use the following hack: ST_SetSRID(ST_Envelope(ST_Makebox2d(ST_Makepoint(?,?), ST_Makepoint(?,?))), 4326)

Additional context
N/A


You'll need to implement both variants to make this work>

ST_MakeEnvelope(float xmin, float ymin, float xmax, float ymax)
ST_MakeEnvelope(float xmin, float ymin, float xmax, float ymax, integer srid=unknown)

See #48814 for example PR

Jira issue: CRDB-15756

@fredbi fredbi added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Apr 22, 2022
@blathers-crl
Copy link

blathers-crl bot commented Apr 22, 2022

Hello, I am Blathers. I am here to help you get the issue triaged.

I was unable to automatically find someone to ping.

If we have not gotten back to your issue within a few business days, you can try the following:

  • Join our community slack channel and ask on #cockroachdb.
  • Try find someone from here if you know they worked closely on the area and CC them.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@blathers-crl blathers-crl bot added O-community Originated from the community X-blathers-untriaged blathers was unable to find an owner labels Apr 22, 2022
@otan otan changed the title geospatial functions: postgis compatibility - implement ST_MakeEnvelope builtins: implement ST_MakeEnvelope(float xmin, float ymin, float xmax, float ymax, integer srid=unknown) Apr 22, 2022
@rimadeodhar rimadeodhar removed the X-blathers-untriaged blathers was unable to find an owner label Apr 22, 2022
fredbi added a commit to fredbi/cockroach that referenced this issue Apr 22, 2022
* fixes cockroachdb#80357

Release note (sql change): added builtin st_makeenvelope

Signed-off-by: Frédéric BIDON <[email protected]>
fredbi added a commit to fredbi/cockroach that referenced this issue Apr 28, 2022
* fixes cockroachdb#80357

Release note (sql change): added builtin st_makeenvelope

Signed-off-by: Frédéric BIDON <[email protected]>
otan pushed a commit to fredbi/cockroach that referenced this issue Apr 28, 2022
* fixes cockroachdb#80357

Release note (sql change): added builtin st_makeenvelope

Signed-off-by: Frédéric BIDON <[email protected]>
@craig craig bot closed this as completed in 41e2600 Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) good first issue O-community Originated from the community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants