-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
tree: implement casts between box2d and geometry #52965
Conversation
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.
Reviewed 2 of 2 files at r1.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @sumeerbhola)
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.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @otan)
pkg/sql/logictest/testdata/logic_test/geospatial_bbox, line 152 at r1 (raw file):
NULL POINT (-1 -1) LINESTRING (-1 -2, 4 6)
I tried this in Postgres after writing my other comment and got
POINT(-1 -1)
POLYGON((-1 -2,-1 6,4 6,4 -2,-1 -2))
pkg/sql/sem/tree/casts.go, line 817 at r1 (raw file):
} else { g, err = geo.NewGeometryFromGeomT( geom.NewLineStringFlat(geom.XY, []float64{d.LoX, d.LoY, d.HiX, d.HiY}),
surprising that Box2D turns into a LineString and not a Polygon.
pkg/sql/logictest/testdata/logic_test/geospatial_bbox, line 152 at r1 (raw file): Previously, sumeerbhola wrote…
My mistake, every time I tried I go LineStrings but looks like it was because I did vertical / horizontal lines. good catch |
Release note (sql change): Implement the ability to cast between box2d and geometry types.
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.
Reviewed 4 of 4 files at r2.
Reviewable status:complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @otan and @sumeerbhola)
pkg/geo/bbox.go, line 204 at r2 (raw file):
b.HiX, b.HiY, b.HiX, b.LoY, b.LoX, b.LoY,
should we orient this CCW to start with, since we'll need to change the orientation later in code.
pkg/geo/bbox.go, line 204 at r2 (raw file): Previously, sumeerbhola wrote…
this is how PostGIS explicitly specified they'd do it :( |
bors r=rytaft,sumeerbhola |
Build succeeded: |
Release note (sql change): Implement the ability to cast between box2d
and geometry types.