spreader

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeSpreaders

func MakeSpreaders(fc *geojson.FeatureCollection, prop string, qt *quadtree.Quadtree) <-chan *Spreader

MakeSpreaders returns a chan of Spreader structs to efficiently process all features

Types

type Spreader

type Spreader struct {
	Feature        *geojson.Feature
	AggregateValue float64
	SpreadFeatures []*geojson.Feature
}

Spreader manages spreading a Feature into SpreadFeatures based on the AggregateValue

func NewSpreader

func NewSpreader(feat *geojson.Feature, features []*geojson.Feature, prop string) (*Spreader, error)

NewSpreader creates a Spreader, returning nil if the property value cannot be parsed

func (*Spreader) Spread

func (s *Spreader) Spread() []orb.Point

Spread returns a slice of points distributed throughout spread features

func (*Spreader) TotalSpreadValue

func (s *Spreader) TotalSpreadValue() float64

TotalSpreadValue returns the amount to use for spreading points inside a feature (currently area)

Jump to

Keyboard shortcuts

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