-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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/geomfn: implement ST_MakePolygon({geometry,_geometry}) #50979
Conversation
Thank you for contributing to CockroachDB. Please ensure you have followed the guidelines for creating a PR. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. I have added a few people who may be able to assist in reviewing: 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
0e4f278
to
8987ff0
Compare
Thank you for updating your pull request. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
8987ff0
to
749162f
Compare
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.
Thanks for submitting this! Just a couple of small nits.
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
1 similar comment
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
cdeda5b
to
f0d5b80
Compare
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.
Please also refactor your commit message to:
geo/geomfn: implement ST_MakePolygon({geometry,_geometry})
Closes #49305
Release note (sql change): Implement ST_MakePolygon functionality
for Geometry types.
Note title the important thing that the title is the first line of the commit message.
Thanks!
return nil, errors.Newf("mixed SRIDs are not allowed") | ||
} | ||
coords[i+1] = interiorRing.Coords() | ||
} |
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.
one more minor detail: can you also add a test to make sure linestrings are closed with at least four points, e.g.
otan=# select st_makepolygon('LINESTRING(0 0, 1 0)');
ERROR: lwpoly_from_lwlines: shell must have at least 4 points
otan=# select st_makepolygon('LINESTRING(0 0, 1 0, 1 1, 0.1 0.1)');
ERROR: lwpoly_from_lwlines: shell must be closed
(same for interior loops)
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.
Added a check for number of points and closure. Thanks! Not sure if this is only Postgis behavior or geom
should implement this check as well. At the moment, geom
doesn't check for this.
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.
Probably, but we'll make do with this for now :)
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.
Filed #51074.
Closes cockroachdb#49305 Release note (sql change): Implement ST_MakePolygon functionality for Geometry types.
f0d5b80
to
f9a494f
Compare
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.
Thanks!
bors r+ |
Build succeeded |
@hiepd Thank you for contributing to CockroachDB this year. As a token of our appreciation, we would like to send you a gift. Please DM me on our community Slack @amruta so I can send you a link. (If you don’t want a gift, we also have a charitable contribution choice.) All orders need to be in by December 13, so please contact me as soon as possible :) |
Closes #49305
Release note (sql change): Implement ST_MakePolygon functionality for geometry operator
NOTES
Since Geometry from geo package does not support 3D, the following are ignored for now: