Documentation
¶
Index ¶
- Variables
- func Buffer(g geom.Geometry, radius float64) (geom.Geometry, error)
- func Contains(a, b geom.Geometry) (bool, error)
- func CoveredBy(a, b geom.Geometry) (bool, error)
- func Covers(a, b geom.Geometry) (bool, error)
- func Crosses(a, b geom.Geometry) (bool, error)
- func Disjoint(g1, g2 geom.Geometry) (bool, error)
- func Equals(g1, g2 geom.Geometry) (bool, error)
- func Intersection(a, b geom.Geometry) (geom.Geometry, error)
- func Intersects(a, b geom.Geometry) (bool, error)
- func Overlaps(a, b geom.Geometry) (bool, error)
- func Simplify(g geom.Geometry, tolerance float64) (geom.Geometry, error)
- func Touches(g1, g2 geom.Geometry) (bool, error)
- func Union(a, b geom.Geometry) (geom.Geometry, error)
- func Within(a, b geom.Geometry) (bool, error)
Constants ¶
This section is empty.
Variables ¶
var ErrGeometryCollectionNotSupported = errors.New("GeometryCollection not supported")
ErrGeometryCollectionNotSupported indicates that a GeometryCollection was passed to a function that does not support GeometryCollections.
Functions ¶
func Buffer ¶
Buffer returns a geometry that contains all points within the given radius of the input geometry.
func Contains ¶
Contains returns true if and only if geometry A contains geometry B. See the global Contains function for details. Formally, the following two conditions must hold:
1. No points of B lies on the exterior of geometry A. That is, B must only be in the exterior or boundary of A.
2 .At least one point of the interior of B lies on the interior of A. That is, they can't *only* intersect at their boundaries.
func CoveredBy ¶
CoveredBy returns true if and only if geometry A is covered by geometry B. Formally, the following two conditions must hold:
1. No points of A lies on the exterior of geometry B. That is, A must only be in the exterior or boundary of B.
2. At least one point of A lies on B (either its interior or boundary).
func Covers ¶
Covers returns true if and only if geometry A covers geometry B. Formally, the following two conditions must hold:
1. No points of B lies on the exterior of geometry A. That is, B must only be in the exterior or boundary of A.
2. At least one point of B lies on A (either its interior or boundary).
func Crosses ¶
Crosses returns true if and only if geometry A and B cross each other. Formally, the following conditions must hold:
1. The geometries must have some but not all interior points in common.
2. The dimensionality of the intersection must be less than the maximum dimension of the input geometries.
3. The intersection must not equal either of the input geometries.
func Equals ¶
Equals returns true if and only if the input geometries are spatially equal, i.e. they represent exactly the same set of points.
func Intersection ¶
Intersection returns a geometry that is the intersection of the input geometries. Formally, the returned geometry will contain a particular point X if and only if X is present in both geometries.
func Intersects ¶
Intersects returns true if and only if the geometries share at least one point in common.
func Overlaps ¶
Overlaps returns true if and only if geometry A and B overlap with each other. Formally, the following conditions must hold:
1. The geometries must have the same dimension.
2. The geometries must have some but not all points in common.
3. The intersection of the geometries must have the same dimension as the geometries themselves.
func Simplify ¶ added in v0.12.0
Simplify creates a simplified version of a geometry using the Douglas-Peucker algorithm. Topological invariants may not be maintained, e.g. polygons can collapse into linestrings, and holes in polygons may be lost.
func Touches ¶
Touches returns true if and only if the geometries have at least 1 point in common, but their interiors don't intersect.
func Union ¶
Union returns a geometry that that is the union of the input geometries. Formally, the returned geometry will contain a particular point X if and only if X is present in either geometry (or both).
func Within ¶
Within returns true if and only if geometry A is completely within geometry B. Formally, the following two conditions must hold:
1. No points of A lies on the exterior of geometry B. That is, A must only be in the exterior or boundary of B.
2.At least one point of the interior of A lies on the interior of B. That is, they can't *only* intersect at their boundaries.
Types ¶
This section is empty.