Versions in this module Expand all Collapse all v0 v0.0.1 Oct 21, 2024 Changes in this version + func BboxToCorners(box *BoundingBox) (*Point, *Point) + func Bearing(point1, point2 *Point) float64 + func BearingToAngle(bearing float64) float64 + func ConvertArea(area float64, originalUnit Unit, finalUnit Unit) (float64, error) + func ConvertDistance(distance float64, originalUnit Unit, finalUnit Unit) float64 + func DecodeFeatureCollection(gj []byte) (*geojson.FeatureCollection, error) + func DegreeToRads(degree float64) float64 + func DegreesToRads(first float64, second float64) (float64, float64) + func Distance(point1 *Point, point2 *Point, unit Unit) float64 + func DistanceToDegrees(distance float64, unit Unit) float64 + func DistanceToRads(distance float64, unit Unit) float64 + func DoesBboxOverlap(b1 *BoundingBox, b2 *BoundingBox) (bool, error) + func EncodePolyline(coordinates []*Point, dim int) string + func Inside(point *Point, polygon PolygonI) bool + func IsPointOnLine(point Point, lineString *LineString, ignoreEnds bool) bool + func LineDiffPercentage(firstLine *LineString, secondLine *LineString) float64 + func RadsToDegree(rad float64) float64 + func RadsToDistance(radians float64, unit Unit) float64 + type Boundary int + const BoundaryBoth + const BoundaryEnd + const BoundaryNone + const BoundaryStart + type BoundingBox struct + East float64 + North float64 + South float64 + West float64 + func Bbox(shapes ...Geometry) *BoundingBox + func Expand(distance float64, unit Unit, geometries ...Geometry) *BoundingBox + func Extent(geometries ...Geometry) *BoundingBox + func NewBBox(w float64, s float64, e float64, n float64) *BoundingBox + func NewInfiniteBBox() *BoundingBox + type Geometry interface + GetPoints func() []*Point + type LineString struct + Points []*Point + func DecodeLineStringFromFeatureJSON(gj []byte) (*LineString, error) + func LineDiff(firstLine *LineString, secondLine *LineString) []*LineString + func NewLineString(points []*Point) *LineString + func (p *LineString) GetPoints() []*Point + type MultiLineString struct + LineStrings []*LineString + func NewMultiLineString(lineStrings []*LineString) *MultiLineString + func (p *MultiLineString) GetPoints() []*Point + type MultiPoint struct + Points []*Point + func NewMultiPoint(points []*Point) *MultiPoint + func (p *MultiPoint) GetPoints() []*Point + type MultiPolygon struct + Polygons []*Polygon + func NewMultiPolygon(polygons []*Polygon) *MultiPolygon + func (p *MultiPolygon) GetPoints() []*Point + func (p *MultiPolygon) GetPolygons() []*Polygon + type Point struct + Lat float64 + Lng float64 + func Along(lineString *LineString, distance float64, unit Unit) *Point + func Center(shapes ...Geometry) *Point + func DecodePolyline(line string, dim int) ([]*Point, error) + func Destination(start *Point, distance float64, bearing float64, unit Unit) *Point + func Nearest(reference *Point, points []*Point) *Point + func NewPoint(lat float64, lon float64) *Point + func PointOnLine(point *Point, lineString *LineString, unit Unit) (*Point, float64, int, error) + func TriangularProjection(point *Point, previousPoint *Point, lineString *LineString, unit Unit) (*Point, float64, int, error) + func Within(points []*Point, polygons []PolygonI) []*Point + func (p *Point) GetPoints() []*Point + type Polygon struct + LineStrings []*LineString + func NewPolygon(lineStrings []*LineString) *Polygon + func (p *Polygon) GetPoints() []*Point + func (p *Polygon) GetPolygons() []*Polygon + type PolygonI interface + GetPolygons func() []*Polygon + type Unit int + const Centimeters + const Degrees + const Feet + const Inches + const Kilometers + const Meters + const Miles + const NauticalMiles + const Radians + const Yards