geos

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func Buffer(g geom.Geometry, radius float64) (geom.Geometry, error)

Buffer returns a geometry that contains all points within the given radius of the input geometry.

func Contains

func Contains(a, b geom.Geometry) (bool, error)

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

func CoveredBy(a, b geom.Geometry) (bool, error)

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

func Covers(a, b geom.Geometry) (bool, error)

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

func Crosses(a, b geom.Geometry) (bool, error)

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 Disjoint

func Disjoint(g1, g2 geom.Geometry) (bool, error)

Disjoint returns true if and only if the input geometries have no points in common.

func Equals

func Equals(g1, g2 geom.Geometry) (bool, error)

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

func Intersection(a, b geom.Geometry) (geom.Geometry, error)

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

func Intersects(a, b geom.Geometry) (bool, error)

Intersects returns true if and only if the geometries share at least one point in common.

func Overlaps

func Overlaps(a, b geom.Geometry) (bool, error)

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

func Simplify(g geom.Geometry, tolerance float64) (geom.Geometry, error)

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

func Touches(g1, g2 geom.Geometry) (bool, error)

Touches returns true if and only if the geometries have at least 1 point in common, but their interiors don't intersect.

func Union

func Union(a, b geom.Geometry) (geom.Geometry, error)

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

func Within(a, b geom.Geometry) (bool, error)

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.

Jump to

Keyboard shortcuts

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