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: remove pointer usage for Geometry/Geography #53446

Merged
merged 2 commits into from
Aug 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/cmd/geoviz/geoviz.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func s2PointToLatLng(fromPoint s2.Point) LatLng {
}

// AddGeography adds a given Geography to an image.
func (img *Image) AddGeography(g *geo.Geography, title string, color string) {
func (img *Image) AddGeography(g geo.Geography, title string, color string) {
regions, err := g.AsS2(geo.EmptyBehaviorOmit)
if err != nil {
panic(err)
Expand Down
11 changes: 6 additions & 5 deletions pkg/geo/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ package geo
import (
"fmt"

"github.com/cockroachdb/cockroach/pkg/geo/geopb"
"github.com/cockroachdb/errors"
)

// NewMismatchingSRIDsError returns the error message for SRIDs of GeospatialTypes
// a and b being a mismatch.
func NewMismatchingSRIDsError(a GeospatialType, b GeospatialType) error {
func NewMismatchingSRIDsError(a geopb.SpatialObject, b geopb.SpatialObject) error {
return errors.Newf(
"operation on mixed SRIDs forbidden: (%s, %d) != (%s, %d)",
a.ShapeType(),
a.SRID(),
b.ShapeType(),
b.SRID(),
a.ShapeType,
a.SRID,
b.ShapeType,
b.SRID,
)
}

Expand Down
Loading