cmp

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2018 License: MIT, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const TOLERANCE = 0.000001

Variables

This section is empty.

Functions

func BoundingBox

func BoundingBox(bbox1, bbox2 [2][2]float64) bool

BoundingBox will check to see if the BoundingBox's are the same.

func CollectionerEqual

func CollectionerEqual(col1, col2 geom.Collectioner) bool

func FindMinIdx

func FindMinIdx(ln Lesser) (min int)

FindMinIdx given a slice will return the min index accourding to the Less function.

func FindMinPointIdx

func FindMinPointIdx(ln [][2]float64) (min int)

FindMinPointIdx given a slice of points, it will return the index to the smallest point according to XYLessPoint

func Float

func Float(f1, f2 float64) bool

Float compares two floats to see if they are within 0.00001 from each other. This is the best way to compare floats.

func Float64

func Float64(f1, f2, tolerance float64) bool

Float64 compares two floats to see if they are within the given tolerance.

func GeometryEqual

func GeometryEqual(g1, g2 geom.Geometry) bool

func LineStringEqual

func LineStringEqual(v1, v2 [][2]float64) bool

LineString given two LineStrings it will check to see if the line strings have the same points in the same order.

func LineStringerEqual

func LineStringerEqual(geo1, geo2 geom.LineStringer) bool

LineString will check to see if the two linestrings passed to it are equal, if there lengths are both the same, and the sequence of points are in the same order. The points don't have to be in the same index point in both line strings.

func MultiLineEqual

func MultiLineEqual(ml1, ml2 [][][2]float64) bool

MultiLineEqual will return if the two multilines are equal.

func MultiLineStringerEqual

func MultiLineStringerEqual(geo1, geo2 geom.MultiLineStringer) bool

func MultiPointEqual

func MultiPointEqual(p1, p2 [][2]float64) bool

MultiPoint will check to see see if the given slices are the same.

func MultiPointerEqual

func MultiPointerEqual(geo1, geo2 geom.MultiPointer) bool

MultiPoint will check to see if the provided multipoints have the same points.

func MultiPolygonerEqual

func MultiPolygonerEqual(geo1, geo2 geom.MultiPolygoner) bool

MultiPolygoner will check to see if the given multipolygoners are the same, by check each of the constitute polygons to see if they match.

func PointEqual

func PointEqual(p1, p2 [2]float64) bool

func PointLess

func PointLess(p1, p2 [2]float64) bool

func PointerEqual

func PointerEqual(geo1, geo2 geom.Pointer) bool

Point will check to see if the x and y of both points are the same.

func PolygonEqual

func PolygonEqual(ply1, ply2 [][][2]float64) bool

Polygon will return weather the two polygons are the same.

func PolygonerEqual

func PolygonerEqual(geo1, geo2 geom.Polygoner) bool

func RotateToLeftMostPoint

func RotateToLeftMostPoint(ln [][2]float64)

RotateToLeftMostPoint will rotate the points in the linestring so that the smallest point (as defined by XYLessPoint) is the first point in the linestring.

func XYLessPoint

func XYLessPoint(pt1, pt2 [2]float64) bool

XYLessPoint

Types

type ByXY

type ByXY [][2]float64

func (ByXY) Len

func (xy ByXY) Len() int

func (ByXY) Less

func (xy ByXY) Less(i, j int) bool

func (ByXY) Swap

func (xy ByXY) Swap(i, j int)

type Lesser

type Lesser interface {
	// Is the number of elements in an Element
	Len() int

	// Less reports whether the element with
	// index i should sort before the element with index j.
	Less(i, j int) bool
}

Jump to

Keyboard shortcuts

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