# README
Packages
package geom
Geometry interfaces to help drive interoperability within the Go geospatial community. This package focuses on 2D geometries.
package encoding
Encoding package describes a few interfaces and common errors for various sub packages implementing different encoders.
Dependencies
Dependencies are managed through go mod
with the execption of one package:
- https://github.com/dhconnelly/rtreego BSD 3 License We are keeping this internal, so that we can build an rtree implementation that uses geom types as it's base, but is build ontop of this.
# Functions
ApplyToPoints applys the given function to each point in the geometry and any sub geometries, return a new transformed geometry.
CircleFromPoints returns the circle from by the given points, or an error if the points are colinear.
Clone returns a deep clone of the Geometry.
ExtractLines extracts all linear components from a geometry (line segements).
GetCoordinates return a list of points that make up a geometry.
IsColinear returns weather the a,b,c are colinear to each other.
IsNil is a helper function to check it the given interface is nil, or the value store in it is nil.
NewExtent returns an Extent for the provided points; in following format [4]float64{ MinX, MinY, MaxX, MaxY }.
NewExtentFromGeometry tries to create an extent based on the geometry.
NewExtentFromPoints returns an Extent for the provided points; in following format [4]float64{ MinX, MinY, MaxX, MaxY }.
NewTriangleContaining returns a triangle that is large enough to contain the given points.
NewTriangleFromPolygon takes the first three points from the outer ring of a polygon to create a triangle.
RoundToPrec will round the given value to the precision value.
# Constants
PrecisionLevelBigFloat is the precision of big floats, rounding if over.
# Variables
EmptyPoint describes an empty 2D point object.
ErrInvalidLinearRing is thrown when a LinearRing is malformed.
ErrInvalidLinearRingM is thrown when a LinearRingM is malformed.
ErrInvalidLinearRingMS is thrown when a LinearRingMS is malformed.
ErrInvalidLinearRingS is thrown when a LinearRingS is malformed.
ErrInvalidLinearRingZ is thrown when a LinearRingZ is malformed.
ErrInvalidLinearRingZM is thrown when a LinearRingZM is malformed.
ErrInvalidLinearRingZMS is thrown when a LinearRingZMS is malformed.
ErrInvalidLinearRingZS is thrown when a LinearRingZS is malformed.
ErrInvalidLineString is thrown when a LineString is malformed.
ErrInvalidLineStringM is thrown when a LineStringM is malformed.
ErrInvalidLineStringMS is thrown when a LineStringMS is malformed.
ErrInvalidLineStringS is thrown when a LineStringS is malformed.
ErrInvalidLineStringZ is thrown when a LineStringZ is malformed.
ErrInvalidLineStringZM is thrown when a LineStringZM is malformed.
ErrInvalidLineStringZMS is thrown when a LineStringZMS is malformed.
ErrInvalidLineStringZS is thrown when a LineStringZS is malformed.
ErrInvalidPolygon is thrown when a Polygon is malformed.
ErrInvalidPolygonM is thrown when a Polygon is malformed.
ErrInvalidPolygonMS is thrown when a Polygon is malformed.
ErrInvalidPolygonS is thrown when a Polygon is malformed.
ErrInvalidPolygonZ is thrown when a Polygon is malformed.
ErrInvalidPolygonZM is thrown when a Polygon is malformed.
ErrInvalidPolygonZMS is thrown when a Polygon is malformed.
ErrInvalidPolygonZS is thrown when a Polygon is malformed.
ErrNilCollection is thrown when a collection is nil but shouldn't be.
ErrNilLineString is thrown when a LineString is nil but shouldn't be.
ErrNilLineStringM is thrown when a LineStringM is nil but shouldn't be.
ErrNilLineStringMS is thrown when a LineStringS is nil but shouldn't be.
ErrNilLineStringS is thrown when a LineStringS is nil but shouldn't be.
ErrNilLineStringZ is thrown when a LineStringZ is nil but shouldn't be.
ErrNilLineStringZM is thrown when a LineStringZM is nil but shouldn't be.
ErrNilLineStringZMS is thrown when a LineStringZMS is nil but shouldn't be.
ErrNilLineStringZS is thrown when a LineStringS is nil but shouldn't be.
ErrNilMultiLineString is thrown when MultiLineString is nil but shouldn't be.
ErrNilMultiLineStringM is thrown when MultiLineStringM is nil but shouldn't be.
ErrNilMultiLineStringMS is thrown when MultiLineStringMS is nil but shouldn't be.
ErrNilMultiLineStringS is thrown when MultiLineStringS is nil but shouldn't be.
ErrNilMultiLineStringZ is thrown when MultiLineStringZ is nil but shouldn't be.
ErrNilMultiLineStringZM is thrown when MultiLineStringZM is nil but shouldn't be.
ErrNilMultiLineStringZMS is thrown when MultiLineStringZMS is nil but shouldn't be.
ErrNilMultiLineStringZS is thrown when MultiLineStringZS is nil but shouldn't be.
ErrNilMultiPoint is thrown when a MultiPoint is nil but shouldn't be.
ErrNilMultiPointM is thrown when a MultiPointM is nil but shouldn't be.
ErrNilMultiPointMS is thrown when a MultiPointMS is nil but shouldn't be.
ErrNilMultiPointS is thrown when a MultiPointS is nil but shouldn't be.
ErrNilMultiPointZ is thrown when a MultiPointZ is nil but shouldn't be.
ErrNilMultiPointZM is thrown when a MultiPointZM is nil but shouldn't be.
ErrNilMultiPointZMS is thrown when a MultiPointZMS is nil but shouldn't be.
ErrNilMultiPointZS is thrown when a MultiPointZS is nil but shouldn't be.
ErrNilMultiPolygon is thrown when a MultiPolygon is nul but shouldn't be.
ErrNilPoint is thrown when a point is null but shouldn't be.
ErrNilPointM is thrown when a point is null but shouldn't be.
ErrNilPointMS is thrown when a point is null but shouldn't be.
ErrNilPointS is thrown when a point is null but shouldn't be.
ErrNilPointZ is thrown when a point is null but shouldn't be.
ErrNilPointZM is thrown when a point is null but shouldn't be.
ErrNilPointZMS is thrown when a point is null but shouldn't be.
ErrNilPointZS is thrown when a point is null but shouldn't be.
ErrNilPolygon is thrown when a polygon is nil but shouldn't be.
ErrNilPolygonM is thrown when a polygonz is nil but shouldn't be.
ErrNilPolygonMS is thrown when a polygonz is nil but shouldn't be.
ErrNilPolygonS is thrown when a polygonz is nil but shouldn't be.
ErrNilPolygonZ is thrown when a polygonz is nil but shouldn't be.
ErrNilPolygonZM is thrown when a polygonz is nil but shouldn't be.
ErrNilPolygonZMS is thrown when a polygonz is nil but shouldn't be.
ErrNilPolygonZS is thrown when a polygonz is nil but shouldn't be.
ErrPointsAreCoLinear is thrown when points are colinear but that is unexpected.
# Structs
Circle is a point (float tuple) and a radius.
ErrUnknownGeometry represents an objects that is not a known geom geometry.
LineStringMS is a basic line type which is made up of two or more points that don't interacted.
LineString is a basic line type which is made up of two or more points that don't interacted.
LineStringZMS is a basic line type which is made up of two or more points that don't interacted.
LineStringZS is a basic line type which is made up of two or more points that don't interacted.
MultiLineStringMS is a geometry with multiple LineStringSs.
MultiLineStringS is a geometry with multiple LineStringSs.
MultiLineStringZMS is a geometry with multiple LineStringSs.
MultiLineStringZS is a geometry with multiple LineStringSs.
MultiPointMS is a geometry with multiple, referenced 2+1D points.
MultiPointS is a geometry with multiple, referenced 2D points.
MultiPointZMS is a geometry with multiple, referenced 3+1D points.
MultiPointZS is a geometry with multiple, referenced 3D points.
Point describes a simple 3D point with SRID.
Point describes a simple 2D point with SRID.
Point describes a simple 3D+1D point with SRID.
Point describes a simple 3D point with SRID.
PolygonMS is a geometry consisting of multiple closed LineStringMSs.
PolygonS is a geometry consisting of multiple closed LineStringSs.
PolygonZMS is a geometry consisting of multiple closed LineStringZMSs.
PolygonZS is a geometry consisting of multiple closed LineStringZSs.
# Interfaces
Collectioner is a collections of different geometries.
CollectionSetter is a mutable Collectioner.
Extenter represents an interface that returns a boundbox.
Geometry is an object with a spatial reference.
LineStringer is a line of two or more points.
LineStringMer is a line of two or more M points.
LineStringMSer is a line of two or more M points + SRID.
LineStringMSetter is a mutable LineStringMer.
LineStringMSSetter is a mutable LineStringMSer.
LineStringSer is a line of two or more points + SRID.
LineStringSetter is a mutable LineStringer.
LineStringSSetter is a mutable LineStringSer.
LineStringZer is a line of two or more Z points.
LineStringZMer is a line of two or more ZM points.
LineStringZMSer is a line of two or more ZM points + SRID.
LineStringZMSetter is a mutable LineStringZMer.
LineStringZMSSetter is a mutable LineStringZMSer.
LineStringZSer is a line of two or more Z points + SRID.
LineStringZSetter is a mutable LineStringZer.
LineStringZSSetter is a mutable LineStringZSer.
MinMaxer is a wrapper for an Extent that gets min/max of the extent.
MultiLineStringer is a geometry with multiple LineStrings.
MultiLineMStringer is a geometry with multiple LineMStrings.
MultiLineMSStringer is a geometry with multiple LineMSStrings.
MultiLineStringMSetter is a mutable MultiLineStringMer.
MultiLineStringMSSetter is a mutable MultiLineMSStringer.
MultiLineSStringer is a geometry with multiple LineSStrings.
MultiLineStringSetter is a mutable MultiLineStringer.
MultiLineStringSSetter is a mutable MultiLineSStringer.
MultiLineZStringer is a geometry with multiple LineZStrings.
MultiLineZMStringer is a geometry with multiple LineZMStrings.
MultiLineZMSStringer is a geometry with multiple LineZMSStrings.
MultiLineStringZMSetter is a mutable MultiLineZMStringer.
MultiLineStringZMSSetter is a mutable MultiLineZMSStringer.
MultiLineZSStringer is a geometry with multiple LineZSStrings.
MultiLineStringZSetter is a mutable MultiLineStringZer.
MultiLineStringZSSetter is a mutable MultiLineZSStringer.
MultiPointer is a geometry with multiple points.
MultiPointMer is a geometry with multiple 2+1D points.
MultiPointMSer is a MultiPointM + SRID.
MultiPointMSetter is a mutable MultiPointer.
MultiPointMSSetter is a mutable MultiPointMSer.
MultiPointSer is a MultiPoint + SRID.
MultiPointSetter is a mutable MultiPointer.
MultiPointSSetter is a mutable MultiPointSer.
MultiPointZer is a geometry with multiple 3D points.
MultiPointZMer is a geometry with multiple 3+1D points.
MultiPointZMSer is a MultiPointZM + SRID.
MultiPointZMSetter is a mutable MultiPointer.
MultiPointZMSSetter is a mutable MultiPointZMSer.
MultiPointZSer is a MultiPointZ + SRID.
MultiPointZSetter is a mutable MultiPointer.
MultiPointZSSetter is a mutable MultiPointZSer.
MultiPolygoner is a geometry of multiple polygons.
MultiPolygonSetter is a mutable MultiPolygoner.
Pointer is a point with two dimensions.
PointMer is a 2D+1D point.
PointMSer is a 2D+1D point + SRID.
PointMSetter is a mutable PointMer.
PointMSSetter is a mutable PointMer.
PointSer is a 2D point + SRID.
PointSetter is a mutable Pointer.
PointSSetter is a mutable PointSer.
PointZer is a 3D point.
PointZMer is a 3D+1D point.
PointZMSer is a 3D+1D point + SRID.
PointZMSetter is a mutable PointZMer.
PointZMSSetter is a mutable PointZMer.
PointZSer is a 3D point + SRID.
PointZSetter is a mutable PointZer.
PointZSSetter is a mutable PointZSer.
Polygoner is a geometry consisting of multiple Linear Rings.
PolygonSetter is a mutable Polygoner.
# Type aliases
ClockwiseFunc returns weather the set of points should be considered clockwise or counterclockwise.
Collection is a collection of one or more geometries.
Extent represents the minx, miny, maxx and maxy A nil extent represents the whole universe.
Line has exactly two points - we define here also the extended Z, M and ZM versions which refer respectively to PointZ, PointM and PointZM geometries.
LineString is a basic line type which is made up of two or more points that don't interacted.
LineString is a basic line type which is made up of two or more points that don't interacted.
LineString is a basic line type which is made up of two or more points that don't interacted.
LineString is a basic line type which is made up of two or more points that don't interacted.
MultiLineString is a geometry with multiple LineStrings.
MultiLineStringM is a geometry with multiple LineStringMs.
MultiLineStringZ is a geometry with multiple LineStringZs.
MultiLineStringZM is a geometry with multiple LineStringZMs.
MultiPoint is a geometry with multiple points.
MultiPointM is a geometry with multiple 2+1D points.
MultiPointZ is a geometry with multiple 3D points.
MultiPointZM is a geometry with multiple 3+1D points.
MultiPolygon is a geometry of multiple polygons.
Point describes a simple 2D point.
Point describes a simple 2D+1D point.
Point describes a simple 3D point.
Point describes a simple 3D+1D point.
Polygon is a geometry consisting of multiple closed LineStrings.
PolygonM is a geometry consisting of multiple closed LineStringMs.
PolygonZ is a geometry consisting of multiple closed LineStringZs.
PolygonZM is a geometry consisting of multiple closed LineStringZMs.
Triangle is a array representation of a geometry triangle.