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

geo/geogfn: implement ST_AsGeoJSON({geography,int4,int4}) #48381

Closed
otan opened this issue May 4, 2020 · 0 comments · Fixed by #49888
Closed

geo/geogfn: implement ST_AsGeoJSON({geography,int4,int4}) #48381

otan opened this issue May 4, 2020 · 0 comments · Fixed by #49888
Assignees
Labels
A-geography-builtins Builtins which have geography as args. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Comments

@otan
Copy link
Contributor

otan commented May 4, 2020

Implement ST_AsGeoJSON on arguments {geography,int4,int4}, which should adopt PostGIS behaviour.

Observers: Please react to this issue if you need this functionality.

For Geography builtins, please do the following:

  • Ideally add a relevant helper function in pkg/geo/geogfn (parse and output related functions can go in pkg/geo). Add exhaustive unit tests here - you can run through example test cases and make sure that PostGIS and CRDB return the same result within a degree of accuracy (1cm for geography).
  • Create a new builtin that references this function in pkg/sql/sem/builtins/geo_builtins.go. Note that we currently do not support optional arguments, so we define functions that have optional arguments once without the optional argument (using the default value in the optional position), and once with the optional argument.
  • Modify the tests in pkg/sql/logictest/testdata/logic_test/geospatial to call this functionality at least once. You can call make testbaselogic FILES='geospatial' TESTFLAGS='-rewrite' to regenerate the output. Tests here should just ensure the builtin is linked end to end (your exhaustive unit tests go the above mentioned packages!).
  • Ensure the documentation is regenerated by calling make buildshort. You can also play with it by calling ./cockroach demo --empty afterwards.
  • Submit your PR - make sure to follow the guidelines from creating your first PR.

You can follow #48529 for an example PR.

🤖 This issue was synced with a spreadsheet by gsheets-to-github-issues by otan on 2020-06-30T05:28:55Z. Changes to titles, body and labels may be overwritten.

@otan otan added A-geospatial-builtins C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) labels May 4, 2020
@otan otan changed the title geo/geogfn: implement st_asgeojson({geography,int4,int4}) geo/geogfn: implement ST_AsGeoJSON({geography,int4,int4}) May 4, 2020
@otan otan added A-geography-builtins Builtins which have geography as args. and removed A-geospatial-builtins labels May 4, 2020
@otan otan self-assigned this May 29, 2020
@craig craig bot closed this as completed in 31d7475 Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-geography-builtins Builtins which have geography as args. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant