Documentation ¶
Index ¶
- Constants
- Variables
- func BitToleranceFor(tol float64) int64
- func CollectionerEqual(col1, col2 geom.Collectioner) bool
- func Extent(extent1, extent2 [4]float64) bool
- func FindMinIdx(ln Lesser) (min int)
- func FindMinPointIdx(ln [][2]float64) (min int)
- func Float(f1, f2 float64) bool
- func Float64(f1, f2, tolerance float64, bitTolerance int64) bool
- func Float64Slice(f1, f2 []float64, tolerance float64, bitTolerance int64) bool
- func FloatSlice(f1, f2 []float64) bool
- func GeomExtent(extent1, extent2 geom.Extenter) bool
- func GeomPointEqual(p1, p2 geom.Point) bool
- func GeometryEqual(g1, g2 geom.Geometry) bool
- func IsEmptyGeo(geo geom.Geometry) (isEmpty bool)
- func IsEmptyLines(lns [][][2]float64) bool
- func IsEmptyPoint(pt [2]float64) bool
- func IsEmptyPoints(pts [][2]float64) bool
- func LineStringEqual(v1, v2 [][2]float64) bool
- func LineStringerEqual(geo1, geo2 geom.LineStringer) bool
- func MultiLineEqual(ml1, ml2 [][][2]float64) bool
- func MultiLineStringerEqual(geo1, geo2 geom.MultiLineStringer) bool
- func MultiPointEqual(p1, p2 [][2]float64) bool
- func MultiPointerEqual(geo1, geo2 geom.MultiPointer) bool
- func MultiPolygonerEqual(geo1, geo2 geom.MultiPolygoner) bool
- func PointEqual(p1, p2 [2]float64) bool
- func PointLess(p1, p2 [2]float64) bool
- func PointerEqual(geo1, geo2 geom.Pointer) bool
- func PointerLess(p1, p2 geom.Pointer) bool
- func PolygonEqual(ply1, ply2 [][][2]float64) bool
- func PolygonerEqual(geo1, geo2 geom.Polygoner) bool
- func RotateToIdx(idx int, ln [][2]float64)
- func RotateToLeftMostPoint(ln [][2]float64)
- func Tolerances() (float64, int64)
- func XYLessPoint(pt1, pt2 [2]float64) bool
- type ByXY
- type Compare
- func (cmp Compare) CollectionerEqual(col1, col2 geom.Collectioner) bool
- func (cmp Compare) Extent(extent1, extent2 [4]float64) bool
- func (cmp Compare) Float(f1, f2 float64) bool
- func (cmp Compare) FloatSlice(f1, f2 []float64) bool
- func (cmp Compare) GeomExtent(extent1, extent2 geom.Extenter) bool
- func (cmp Compare) GeomPointEqual(p1, p2 geom.Point) bool
- func (cmp Compare) GeometryEqual(g1, g2 geom.Geometry) bool
- func (Compare) IsEmptyGeo(geo geom.Geometry) bool
- func (Compare) IsEmptyLines(lns [][][2]float64) bool
- func (Compare) IsEmptyPoint(pt [2]float64) bool
- func (Compare) IsEmptyPoints(pts [][2]float64) bool
- func (cmp Compare) LineEqual(ln1, ln2 geom.Line) bool
- func (cmp Compare) LineStringEqual(v1, v2 [][2]float64) bool
- func (cmp Compare) LineStringerEqual(geo1, geo2 geom.LineStringer) bool
- func (cmp Compare) MultiLineEqual(ml1, ml2 [][][2]float64) bool
- func (cmp Compare) MultiLineStringerEqual(geo1, geo2 geom.MultiLineStringer) bool
- func (cmp Compare) MultiPointEqual(p1, p2 [][2]float64) bool
- func (cmp Compare) MultiPointerEqual(geo1, geo2 geom.MultiPointer) bool
- func (cmp Compare) MultiPolygonerEqual(geo1, geo2 geom.MultiPolygoner) bool
- func (cmp Compare) PointEqual(p1, p2 [2]float64) bool
- func (cmp Compare) PointLess(p1, p2 [2]float64) bool
- func (cmp Compare) PointerEqual(geo1, geo2 geom.Pointer) bool
- func (cmp Compare) PointerLess(p1, p2 geom.Pointer) bool
- func (cmp Compare) PolygonEqual(ply1, ply2 [][][2]float64) bool
- func (cmp Compare) PolygonerEqual(geo1, geo2 geom.Polygoner) bool
- func (cmp Compare) Tolerances() (float64, int64)
- type Lesser
- type PointByXY
Constants ¶
const HiPrecision = 0.000000001
HiPrecision is a high precision for comparator
Variables ¶
var ( NilPoint = (*geom.Point)(nil) NilMultiPoint = (*geom.MultiPoint)(nil) NilLineString = (*geom.LineString)(nil) NilMultiLineString = (*geom.MultiLineString)(nil) NilPoly = (*geom.Polygon)(nil) NilMultiPoly = (*geom.MultiPolygon)(nil) NilCollection = (*geom.Collection)(nil) )
var BitTolerance = DefaultCompare().BitTolerance
BitTolerance is only here for compability reasons
var HiCMP = New(HiPrecision)
HiCMP is a high precision comparator
var Tolerance = DefaultCompare().Tolerance
Tolerance is only here for compability reasons
Functions ¶
func BitToleranceFor ¶
BitToleranceFor returns the BitToleranceFor the given tolerance
func CollectionerEqual ¶
func CollectionerEqual(col1, col2 geom.Collectioner) bool
CollectionerEqual will check if the two collections are equal based on length then if each geometry inside is equal. Therefor order matters.
func FindMinIdx ¶
FindMinIdx given a slice will return the min index accourding to the Less function.
func FindMinPointIdx ¶
FindMinPointIdx given a slice of points, it will return the index to the smallest point according to XYLessPoint
func Float ¶
Float compares two floats to see if they are within 0.00001 from each other. This is the best way to compare floats.
func Float64Slice ¶
Float64Slice compares two sets of float64 slices within the given tolerance.
func FloatSlice ¶
FloatSlice compare two sets of float slices.
func GeomExtent ¶
GeomExtent will check to see if geom.BoundingBox's are the same.
func GeomPointEqual ¶
GeomPointEqual returns weather both points have the same value for x,y.
func GeometryEqual ¶
GeometryEqual checks if the two geometries are of the same type and then calls the type method to check if they are equal
func IsEmptyGeo ¶
func IsEmptyLines ¶
func IsEmptyPoint ¶
func IsEmptyPoints ¶
func LineStringEqual ¶
LineStringEqual 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
LineStringerEqual 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 ¶
MultiLineEqual will return if the two multilines are equal.
func MultiLineStringerEqual ¶
func MultiLineStringerEqual(geo1, geo2 geom.MultiLineStringer) bool
MultiLineStringerEqual will check to see if the 2 MultiLineStrings pass to it are equal. This is done by converting them to lineStrings and using MultiLineEqual
func MultiPointEqual ¶
MultiPointEqual will check to see see if the given slices are the same.
func MultiPointerEqual ¶
func MultiPointerEqual(geo1, geo2 geom.MultiPointer) bool
MultiPointerEqual will check to see if the provided multipoints have the same points.
func MultiPolygonerEqual ¶
func MultiPolygonerEqual(geo1, geo2 geom.MultiPolygoner) bool
MultiPolygonerEqual 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 ¶
PointEqual returns weather both points have the same value for x,y.
func PointLess ¶
PointLess returns weather p1 is < p2 by first comparing the X values, and if they are the same the Y values.
func PointerEqual ¶
PointerEqual will check to see if the x and y of both points are the same.
func PointerLess ¶
PointerLess returns weather p1 is < p2 by first comparing the X values, and if they are the same the Y values.
func PolygonEqual ¶
PolygonEqual will return weather the two polygons are the same.
func PolygonerEqual ¶
PolygonerEqual will check to see if the Polygoners are the same, by checking if the linearRings are equal.
func RotateToIdx ¶
RotateToIdx modifies the ln to be rotated by idx
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 Tolerances ¶
Tolerances returns the default tolerance values
func XYLessPoint ¶
XYLessPoint compares the x then y points to see if pt1 is less than pt2
Types ¶
type Compare ¶
type Compare struct { // Tolerance is the epsilon value used in comparing floats with zero Tolerance float64 // BitTolerance is the epsilon value for comparing float bit-patterns. BitTolerance int64 }
Compare holds the tolerances for the comparison functions
func DefaultCompare ¶
func DefaultCompare() Compare
DefaultCompare returns the current default compare
func New ¶
New returns a new Compare object for the tolerance level, with a computed BitTolerance value
func NewForNumPrecision ¶
NewForNumPrecision will return a comparator with the given number of precision digits
func SetDefault ¶
SetDefault will set the default for the package.
func (Compare) CollectionerEqual ¶
func (cmp Compare) CollectionerEqual(col1, col2 geom.Collectioner) bool
CollectionerEqual will check if the two collections are equal based on length then if each geometry inside is equal. Therefore order matters.
func (Compare) Float ¶
Float compares two floats to see if they are within the cmp tolerance of each other
func (Compare) FloatSlice ¶
FloatSlice compares two sets of float64 slices within the given tolerance.
func (Compare) GeomExtent ¶
GeomExtent will check to see if geom.BoundingBox's are the same.
func (Compare) GeomPointEqual ¶
GeomPointEqual returns weather both points have the same value for x,y.
func (Compare) GeometryEqual ¶
GeometryEqual checks if the two geometries are of the same type and then calls the type method to check if they are equal
func (Compare) IsEmptyLines ¶
func (Compare) IsEmptyPoints ¶
func (Compare) LineEqual ¶
LineEqual will check to see if the two lines passed to it are equal: 1. start points are equal 2. end points are equal
func (Compare) LineStringEqual ¶
LineStringEqual given two LineStrings it will check to see if the line strings have the same points in the same order.
func (Compare) LineStringerEqual ¶
func (cmp Compare) LineStringerEqual(geo1, geo2 geom.LineStringer) bool
LineStringerEqual will check to see if the two linestrings passed to it are equal: 1. lengths of both the same 2. 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 (Compare) MultiLineEqual ¶
MultiLineEqual will return if the two multilines are equal.
func (Compare) MultiLineStringerEqual ¶
func (cmp Compare) MultiLineStringerEqual(geo1, geo2 geom.MultiLineStringer) bool
MultiLineStringerEqual will check to see if the 2 MultiLineStrings pass to it are equal. This is done by converting them to lineStrings and using MultiLineEqual
func (Compare) MultiPointEqual ¶
MultiPointEqual will check to see see if the given slices are the same.
func (Compare) MultiPointerEqual ¶
func (cmp Compare) MultiPointerEqual(geo1, geo2 geom.MultiPointer) bool
MultiPointerEqual will check to see if the provided multipoints have the same points.
func (Compare) MultiPolygonerEqual ¶
func (cmp Compare) MultiPolygonerEqual(geo1, geo2 geom.MultiPolygoner) bool
MultiPolygonerEqual will check to see if the given multipolygoners are the same, by check each of the constitute polygons to see if they match.
func (Compare) PointEqual ¶
PointEqual returns weather both points have the same value for x,y.
func (Compare) PointLess ¶
PointLess returns weather p1 is < p2 by first comparing the X values, and if they are the same the Y values.
func (Compare) PointerEqual ¶
PointerEqual will check to see if the x and y of both points are the same.
func (Compare) PointerLess ¶
PointerLess returns weather p1 is < p2 by first comparing the X values, and if they are the same the Y values.
func (Compare) PolygonEqual ¶
PolygonEqual will return weather the two polygons are the same.
func (Compare) PolygonerEqual ¶
PolygonerEqual will check to see if the Polygoners are the same, by checking if the linearRings are equal.
func (Compare) Tolerances ¶
Tolerances returns the tolerances of the comparator