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/geomfn: implement ST_Buffer #49722

Merged
merged 1 commit into from
Jun 2, 2020
Merged

Conversation

otan
Copy link
Contributor

@otan otan commented May 29, 2020

Implemented ST_Buffer. Had to write our own parsing logic to make it
compatible with C.

Also ran clang-format and fixed up a few bad infos.

Resolves #48890
Resolves #48891
Resolves #48802
Resolves #48803
Resolves #48804

Release note (sql change): Implement ST_Buffer for geometry and string
variants.

@otan otan requested review from sumeerbhola and a team May 29, 2020 22:05
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@otan otan force-pushed the st_buffer branch 4 times, most recently from 23580a6 to 0cd25d6 Compare May 30, 2020 03:49
Copy link
Collaborator

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 9 of 9 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @otan)


pkg/geo/geomfn/buffer.go, line 50 at r1 (raw file):

// the BufferParams form.
// The string must be of the same format as specified by https://postgis.net/docs/ST_Buffer.html.
// Returns the BufferParams, as well as the modified distance.

does PostGIS support all these parameters for geography too?


pkg/sql/sem/builtins/geo_builtins.go, line 327 at r1 (raw file):

var stBufferWithParamsInfoBuilder = infoBuilder{
	info: `Returns a Geometry that represents all points whose distance is less than or equal to the given distance.

... to the given distance from the given geometry.


pkg/sql/sem/builtins/geo_builtins.go, line 339 at r1 (raw file):

var stBufferWithQuadSegInfoBuilder = infoBuilder{
	info: `Returns a Geometry that represents all points whose distance is less than or equal to the given distance.

ditto


pkg/sql/sem/builtins/geo_builtins.go, line 2015 at r1 (raw file):

				{"geometry_str", types.String},
				// This should be float, but for this to work equivalently to the psql type system,
				// we have to make a decimal definition.

is this the first time in CRDB that we are having to do this types.{Float,Decimal} dance? And are there any thoughts on how we could get rid of this duplication in the future?

Copy link
Contributor Author

@otan otan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @sumeerbhola)


pkg/geo/geomfn/buffer.go, line 50 at r1 (raw file):

Previously, sumeerbhola wrote…

does PostGIS support all these parameters for geography too?

Yep! But it has a hack to do it...coming soon!


pkg/sql/sem/builtins/geo_builtins.go, line 327 at r1 (raw file):

Previously, sumeerbhola wrote…

... to the given distance from the given geometry.

Done.


pkg/sql/sem/builtins/geo_builtins.go, line 339 at r1 (raw file):

Previously, sumeerbhola wrote…

ditto

Done.


pkg/sql/sem/builtins/geo_builtins.go, line 2015 at r1 (raw file):

Previously, sumeerbhola wrote…

is this the first time in CRDB that we are having to do this types.{Float,Decimal} dance? And are there any thoughts on how we could get rid of this duplication in the future?

there's been others. the work on implicit casts will resolve this, but that is kinda "off the table"for now...

@otan
Copy link
Contributor Author

otan commented Jun 2, 2020

bors r=summerbhola

@craig
Copy link
Contributor

craig bot commented Jun 2, 2020

Merge conflict (retrying...)

@craig
Copy link
Contributor

craig bot commented Jun 2, 2020

Merge conflict

Implemented ST_Buffer. Had to write our own parsing logic to make it
compatible with C.

Also ran clang-format and fixed up a few bad infos.

Release note (sql change): Implement ST_Buffer for geometry and string
variants.
@otan
Copy link
Contributor Author

otan commented Jun 2, 2020

bors r=summerbhola

@craig
Copy link
Contributor

craig bot commented Jun 2, 2020

Build succeeded

@craig craig bot merged commit e80ccc5 into cockroachdb:master Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants