options

package
v0.0.0-...-5cad063 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectOptions

type DirectOptions struct {
	Do func(segment gpx.GPXTrackSegment) ([]gpx.GPXTrackSegment, error)
}

func DouglasPeucker

func DouglasPeucker(maxDistance unit.Length) DirectOptions

Polyline simplification based on Ramer-Douglas-Peucker. Points are simplified when for the provided maxDistance.

func MaxDuration

func MaxDuration(maxDuration time.Duration) DirectOptions

MaxDuration removes segments with a longer duration than the provided maxDuration

func MinDistance

func MinDistance(minDistance unit.Length) DirectOptions

MinDistance removes segments with a shorter distance than the provided minDistance

func MinDuration

func MinDuration(minDuration time.Duration) DirectOptions

MinDuration removes segments with a shorter duration than the provided minDuration

func MinPoints

func MinPoints(minPoints int) DirectOptions

MinPoints removes segments with less points than the provided minPoints

func MinRadius

func MinRadius(minRadius unit.Length) DirectOptions

MinRadius removes segments, if all their points lie within a given minRadius from the starting point

func RemoveStops

func RemoveStops() DirectOptions

RemoveStops removes points that are assumed to have no relevant movement. See PauseSplit for a function that splits segments, if a pause is detected.

type FilterOptions

type FilterOptions TransformOptions

FilterOptions hold a function that returns true iff a point should be included in the filter result

func TrimLeft

func TrimLeft(maxRadius unit.Length) FilterOptions

TrimLeft cuts all points that are reached from the first recorded point within the provided max radius

func TrimRight

func TrimRight(maxRadius unit.Length) FilterOptions

TrimRight cuts all points that are reached backwards from the last recorded point within the provided max radius

type SplitOptions

type SplitOptions TransformOptions

func DistanceSplit

func DistanceSplit(maxDist unit.Length) SplitOptions

A distance-based splitter that splits whenever two consecutive points have a distance larger than maxDist.

func PauseSplit

func PauseSplit(radius unit.Length, minDuration time.Duration) SplitOptions

PauseSplit splits when previous points lie within the provided radius (from the currently viewed point) for at least minDuration. It waits with splitting until the next point (from the currently viewed point) would lie outside the radius. Different to RemoveStops, this function can be configured to not affect shorter pauses.

func TimeSplit

func TimeSplit(maxStep time.Duration) SplitOptions

A time-based splitter that splits whenever two consecutive points have a time difference larger than maxStep.

type TransformOptions

type TransformOptions struct {
	/*
		do must return true whenever a transformation should be performed at the provided index of a given track segment.
	*/
	Do func(segment gpx.GPXTrackSegment, index int) (bool, error)
}

TransformOptions is passed to transformation functions. It holds a function that decides whether a given transformation should be performed.

func NewTransformOptions

func NewTransformOptions(do func(gpx.GPXTrackSegment, int) (bool, error)) TransformOptions

NewTransformOptions returns a new TransformOptions object that holds the provided do function.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL