measure

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: LGPL-2.1 Imports: 6 Imported by: 0

Documentation

Overview

Package measure Define spatial measurement function.

Index

Constants

View Source
const (

	// R radius of earth.
	R = 6371000.0 //6378137.0
	// E is eccentricity.
	E = 0.006694379990141317
)

Variables

This section is empty.

Functions

func Area

func Area(ring matrix.LineMatrix) float64

Area returns the area of a Ring geometry.

func AreaDirection

func AreaDirection(ring matrix.LineMatrix) float64

AreaDirection returns the area (direction) of a Ring geometry.

func AreaOfMultiPolygon

func AreaOfMultiPolygon(mp matrix.MultiPolygonMatrix) float64

AreaOfMultiPolygon returns the area of a MultiPolygon geometry

func AreaOfPolygon

func AreaOfPolygon(polygon matrix.PolygonMatrix) float64

AreaOfPolygon returns the area of a Polygon geometry

func ClosestPoint

func ClosestPoint(p, a, b matrix.Matrix) matrix.Matrix

ClosestPoint Computes the closest point on this line segment to another point.

func IsCCW

func IsCCW(ring matrix.LineMatrix) bool

IsCCW * Tests if a ring is oriented counter-clockwise

func MercatorFctor added in v1.1.0

func MercatorFctor(lat float64) (float64, float64)

MercatorFctor scale factor the meridians as a function of latitude

func OfLine

func OfLine(pts matrix.LineMatrix) float64

OfLine Computes the length of a linestring specified by a sequence of points.

func PlanarDistance

func PlanarDistance(fromSteric, toSteric matrix.Steric) float64

PlanarDistance returns Distance of form to.

func Project

func Project(p, a, b matrix.Matrix) matrix.Matrix

Project Compute the projection of a point onto the line determined

func ProjectionFactor

func ProjectionFactor(p, a, b matrix.Matrix) float64

ProjectionFactor Computes the Projection Factor for the projection of the point p

func SpheroidDistance

func SpheroidDistance(fromSteric, toSteric matrix.Steric) float64

SpheroidDistance Calculate distance, return unit: meter

Types

type Distance

type Distance func(from, to matrix.Steric) float64

Distance is a func of measure distance.

type DistanceToPoint

type DistanceToPoint struct {
}

DistanceToPoint Computes the Euclidean distance (L2 metric) from a point to a point. Also computes two points on the geometry which are separated by the distance found.

type HausdorffDistance

type HausdorffDistance struct {
	// contains filtered or unexported fields
}

HausdorffDistance An algorithm for computing a distance metric which is an approximation to the Hausdorff Distance

func (*HausdorffDistance) Distance

func (h *HausdorffDistance) Distance(g0, g1 matrix.Steric) float64

Distance ...

func (*HausdorffDistance) DistanceDensifyFrac

func (h *HausdorffDistance) DistanceDensifyFrac(g0, g1 matrix.Steric, densifyFrac float64) (float64, error)

DistanceDensifyFrac ...

func (*HausdorffDistance) OrientedDistance added in v1.0.1

func (h *HausdorffDistance) OrientedDistance() float64

OrientedDistance ...

type MaxDensifiedByFractionDistanceFilter

type MaxDensifiedByFractionDistanceFilter struct {
	MaxPtDist, MinPtDist *PointPairDistance
	// contains filtered or unexported fields
}

MaxDensifiedByFractionDistanceFilter ...

func (*MaxDensifiedByFractionDistanceFilter) Clear added in v1.0.2

Clear clear Matrixes.

func (*MaxDensifiedByFractionDistanceFilter) Filter added in v1.0.2

Filter Performs an operation with the provided .

func (*MaxDensifiedByFractionDistanceFilter) FilterMatrixes added in v1.0.2

func (m *MaxDensifiedByFractionDistanceFilter) FilterMatrixes(pts []matrix.Matrix)

FilterMatrixes Performs an operation with the provided .

func (*MaxDensifiedByFractionDistanceFilter) IsChanged added in v1.0.2

IsChanged Returns the true when need change.

func (*MaxDensifiedByFractionDistanceFilter) Matrixes added in v1.0.2

Matrixes Returns the gathered Matrixes.

type MaxPointDistanceFilter

type MaxPointDistanceFilter struct {
	MaxPtDist, MinPtDist *PointPairDistance
	// contains filtered or unexported fields
}

MaxPointDistanceFilter ...

func (*MaxPointDistanceFilter) Clear added in v1.0.2

func (m *MaxPointDistanceFilter) Clear()

Clear clear Matrixes.

func (*MaxPointDistanceFilter) Filter added in v1.0.2

func (m *MaxPointDistanceFilter) Filter(pt matrix.Matrix)

Filter Performs an operation with the provided .

func (*MaxPointDistanceFilter) FilterMatrixes added in v1.0.2

func (m *MaxPointDistanceFilter) FilterMatrixes(pts []matrix.Matrix)

FilterMatrixes Performs an operation with the provided .

func (*MaxPointDistanceFilter) IsChanged added in v1.0.2

func (m *MaxPointDistanceFilter) IsChanged() bool

IsChanged Returns the true when need change.

func (*MaxPointDistanceFilter) Matrixes added in v1.0.2

func (m *MaxPointDistanceFilter) Matrixes() []matrix.Matrix

Matrixes Returns the gathered Matrixes.

type PointPairDistance

type PointPairDistance struct {
	Pt       [2]matrix.Matrix
	Distance float64
	IsNil    bool
}

PointPairDistance Contains a pair of points and the distance between them. Provides methods to update with a new point pair with either maximum or minimum distance.

func (*PointPairDistance) ToString

func (p *PointPairDistance) ToString() string

ToString ...

Jump to

Keyboard shortcuts

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