func (s LineString) EndPoint() Point {
	if s.IsEmpty() {
		return NewEmptyPoint(s.CoordinatesType())
	}
	end := s.seq.Length() - 1
	c := s.seq.Get(end)
	return newUncheckedPoint(c)
}
EndPoint gives the last point of the LineString. If the LineString is empty
then it returns the empty Point.
package geom
import (
	"database/sql/driver"
	"fmt"
	"math"
	"unsafe"
	"github.com/peterstace/simplefeatures/rtree"
)
type LineString struct {
	seq Sequence
}
func NewLineString(seq Sequence, opts ...ConstructorOption) (LineString, error) {
	n := seq.Length()
	ctorOpts := newOptionSet(opts)
	if ctorOpts.skipValidations || n == 0 {
		return LineString{seq}, nil
	}
	if !hasAtLeast2DistinctPointsInSeq(seq) {
		if ctorOpts.omitInvalid {
			return LineString{}, nil
		}
		return LineString{}, validationError{
			"non-empty linestring contains only one distinct XY value"}
	}
	if err := seq.validate(); err != nil {
		if ctorOpts.omitInvalid {
			return LineString{}, nil
		}
		return LineString{}, validationError{err.Error()}
	}
	return LineString{seq}, nil
}
func hasAtLeast2DistinctPointsInSeq(seq Sequence) bool {
	n := seq.Length()
	if n == 0 {
		return false
	}
	first := seq.GetXY(0)
	for i := 1; i < n; i++ {
		if seq.GetXY(i) != first {
			return true
		}
	}
	return false
}
func (s LineString) Type() GeometryType {
	return TypeLineString
}
func (s LineString) AsGeometry() Geometry {
	return Geometry{TypeLineString, unsafe.Pointer(&s)}
}
func (s LineString) StartPoint() Point {
	if s.IsEmpty() {
		return NewEmptyPoint(s.CoordinatesType())
	}
	c := s.seq.Get(0)
	return newUncheckedPoint(c)
}