Skip to content

Commit

Permalink
Remove ConstructorOption from AsPoint helper
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstace committed Sep 5, 2023
1 parent 90155e5 commit 86faacd
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions geom/xy.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@ func (w XY) validate() error {
}

// AsPoint is a convenience function to convert this XY value into a Point
// geometry.
func (w XY) AsPoint(opts ...ConstructorOption) (Point, error) {
// geometry. If an invalid Point would be created, then an error is returned.
func (w XY) AsPoint() (Point, error) {
coords := Coordinates{XY: w, Type: DimXY}
return NewPoint(coords, opts...)
return NewPoint(coords)
}

// AsPointWithoutValidation is a convenience function to convert this XY value into a Point
// geometry. The validity of the Point result is not validated.
func (w XY) AsPointWithoutValidation() Point {
coords := Coordinates{XY: w, Type: DimXY}
return NewPointWithoutValidation(coords)
}

// asUncheckedPoint is a convenience function to convert this XY value into a
Expand Down

0 comments on commit 86faacd

Please sign in to comment.