Files
renovate-sh-app[bot]GitHubrenovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>
6a21dc7e6d fix(deps): update module github.com/parquet-go/parquet-go to v0.27.0 (#6243)
| datasource | package                          | from    | to      |
| ---------- | -------------------------------- | ------- | ------- |
| go         | github.com/parquet-go/parquet-go | v0.26.4 | v0.27.0 |

Signed-off-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>
Co-authored-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>
2026-01-16 23:38:26 +00:00

61 lines
1.4 KiB
Go

package geom
// A LinearRing is a linear ring.
type LinearRing struct {
geom1
}
// NewLinearRing returns a new LinearRing with no coordinates.
func NewLinearRing(layout Layout) *LinearRing {
return NewLinearRingFlat(layout, nil)
}
// NewLinearRingFlat returns a new LinearRing with the given flat coordinates.
func NewLinearRingFlat(layout Layout, flatCoords []float64) *LinearRing {
g := new(LinearRing)
g.layout = layout
g.stride = layout.Stride()
g.flatCoords = flatCoords
return g
}
// Area returns the area.
func (g *LinearRing) Area() float64 {
return doubleArea1(g.flatCoords, 0, len(g.flatCoords), g.stride) / 2
}
// Clone returns a deep copy.
func (g *LinearRing) Clone() *LinearRing {
return deriveCloneLinearRing(g)
}
// Length returns the length of the perimeter.
func (g *LinearRing) Length() float64 {
return length1(g.flatCoords, 0, len(g.flatCoords), g.stride)
}
// MustSetCoords sets the coordinates and panics if there is any error.
func (g *LinearRing) MustSetCoords(coords []Coord) *LinearRing {
Must(g.SetCoords(coords))
return g
}
// SetCoords sets the coordinates.
func (g *LinearRing) SetCoords(coords []Coord) (*LinearRing, error) {
if err := g.setCoords(coords); err != nil {
return nil, err
}
return g, nil
}
// SetSRID sets the SRID of g.
func (g *LinearRing) SetSRID(srid int) *LinearRing {
g.srid = srid
return g
}
// Swap swaps the values of g and g2.
func (g *LinearRing) Swap(g2 *LinearRing) {
*g, *g2 = *g2, *g
}