Documentation
¶
Overview ¶
Package space A representation of a linear vector geometry. include point line ring polygon multipoint multiline multrpolygon collection bound.
Index ¶
- Constants
- func Distance(from, to Geometry, f measure.Distance) (float64, error)
- type Bound
- func (b Bound) Area() (float64, error)
- func (b Bound) Bottom() float64
- func (b Bound) Bound() Bound
- func (b Bound) Boundary() (Geometry, error)
- func (b Bound) Buffer(width float64, quadsegs int) Geometry
- func (b Bound) BufferInMeter(width float64, quadsegs int) Geometry
- func (b Bound) Centroid() Point
- func (b Bound) Contains(point Point) bool
- func (b Bound) ContainsBound(bound Bound) bool
- func (b Bound) ConvexHull() Geometry
- func (b Bound) CoordinateSystem() int
- func (b Bound) Dimensions() int
- func (b Bound) Distance(g Geometry) (float64, error)
- func (b Bound) Envelope() Geometry
- func (b Bound) Equals(g Geometry) bool
- func (b Bound) EqualsBound(c Bound) bool
- func (b Bound) EqualsExact(g Geometry, tolerance float64) bool
- func (b Bound) Extend(point Point) Bound
- func (b Bound) Filter(f matrix.Filter) Geometry
- func (b Bound) GeoJSONType() string
- func (b Bound) Geom() Geometry
- func (b Bound) IntersectsBound(other Bound) bool
- func (b Bound) IsClosed() bool
- func (b Bound) IsCollection() bool
- func (b Bound) IsCorrect() bool
- func (b Bound) IsEmpty() bool
- func (b Bound) IsRing() bool
- func (b Bound) IsSimple() bool
- func (b Bound) IsValid() bool
- func (b Bound) Left() float64
- func (b Bound) LeftTop() Point
- func (b Bound) Length() float64
- func (b Bound) Nums() int
- func (b Bound) PointOnSurface() Geometry
- func (b Bound) Right() float64
- func (b Bound) RightBottom() Point
- func (b Bound) Simplify(tolerance float64) Geometry
- func (b Bound) SimplifyP(tolerance float64) Geometry
- func (b Bound) SpheroidDistance(g Geometry) (float64, error)
- func (b Bound) ToMatrix() matrix.Steric
- func (b Bound) ToPolygon() Polygon
- func (b Bound) ToRing() Ring
- func (b Bound) Top() float64
- func (b Bound) Union(other Bound) Bound
- func (b Bound) UniquePoints() MultiPoint
- type Circle
- func (c *Circle) Area() (float64, error)
- func (c *Circle) Bound() Bound
- func (c *Circle) Buffer(width float64, quadsegs int) Geometry
- func (c *Circle) Centroid() Point
- func (c *Circle) Envelope() Geometry
- func (c *Circle) Equals(g Geometry) bool
- func (c *Circle) EqualsCircle(circle *Circle) bool
- func (c *Circle) EqualsExact(g Geometry, tolerance float64) bool
- func (c *Circle) GeoJSONType() string
- func (c *Circle) Geom() Geometry
- func (c *Circle) IsClosed() bool
- func (c *Circle) IsRing() bool
- func (c *Circle) IsSimple() bool
- func (c *Circle) IsValid() bool
- func (c *Circle) Length() float64
- type Collection
- func (c Collection) Area() (float64, error)
- func (c Collection) Bound() Bound
- func (c Collection) Boundary() (Geometry, error)
- func (c Collection) Buffer(width float64, quadsegs int) Geometry
- func (c Collection) BufferInMeter(width float64, quadsegs int) Geometry
- func (c Collection) Centroid() Point
- func (c Collection) ConvexHull() Geometry
- func (c Collection) CoordinateSystem() int
- func (c Collection) Dimensions() int
- func (c Collection) Distance(g Geometry) (float64, error)
- func (c Collection) Envelope() Geometry
- func (c Collection) Equals(g Geometry) bool
- func (c Collection) EqualsCollection(collection Collection) bool
- func (c Collection) EqualsExact(g Geometry, tolerance float64) bool
- func (c Collection) Filter(f matrix.Filter) Geometry
- func (c Collection) GeoJSONType() string
- func (c Collection) Geom() Geometry
- func (c Collection) IsClosed() bool
- func (c Collection) IsCollection() bool
- func (c Collection) IsCorrect() bool
- func (c Collection) IsEmpty() bool
- func (c Collection) IsRing() bool
- func (c Collection) IsSimple() bool
- func (c Collection) IsValid() bool
- func (c Collection) Length() float64
- func (c Collection) Nums() int
- func (c Collection) PointOnSurface() Geometry
- func (c Collection) Simplify(tolerance float64) Geometry
- func (c Collection) SimplifyP(tolerance float64) Geometry
- func (c Collection) SpheroidDistance(g Geometry) (float64, error)
- func (c Collection) ToMatrix() matrix.Steric
- func (c Collection) UniquePoints() MultiPoint
- type Coordinate
- type Geometry
- type GeometryValid
- type Line
- type LineString
- func (ls LineString) Area() (float64, error)
- func (ls LineString) Bound() Bound
- func (ls LineString) Boundary() (Geometry, error)
- func (ls LineString) Buffer(width float64, quadsegs int) Geometry
- func (ls LineString) BufferInMeter(width float64, quadsegs int) Geometry
- func (ls LineString) Centroid() Point
- func (ls LineString) ConvexHull() Geometry
- func (ls LineString) CoordinateSystem() int
- func (ls LineString) Dimensions() int
- func (ls LineString) Distance(g Geometry) (float64, error)
- func (ls LineString) Envelope() Geometry
- func (ls LineString) Equals(g Geometry) bool
- func (ls LineString) EqualsExact(g Geometry, tolerance float64) bool
- func (ls LineString) EqualsLineString(lineString LineString) bool
- func (ls LineString) Filter(f matrix.Filter) Geometry
- func (ls LineString) GeoJSONType() string
- func (ls LineString) Geom() Geometry
- func (ls LineString) IsClosed() bool
- func (ls LineString) IsCollection() bool
- func (ls LineString) IsCorrect() bool
- func (ls LineString) IsEmpty() bool
- func (ls LineString) IsRing() bool
- func (ls LineString) IsSimple() bool
- func (ls LineString) IsValid() bool
- func (ls LineString) Length() float64
- func (ls LineString) Nums() int
- func (ls LineString) PointOnSurface() Geometry
- func (ls LineString) Simplify(tolerance float64) Geometry
- func (ls LineString) SimplifyP(tolerance float64) Geometry
- func (ls LineString) SpheroidDistance(g Geometry) (float64, error)
- func (ls LineString) ToLineArray() (lines []Line)
- func (ls LineString) ToMatrix() matrix.Steric
- func (ls LineString) ToPointArray() (la []Point)
- func (ls LineString) UniquePoints() MultiPoint
- type MultiLineString
- func (mls MultiLineString) Area() (float64, error)
- func (mls MultiLineString) Bound() Bound
- func (mls MultiLineString) Boundary() (Geometry, error)
- func (mls MultiLineString) Buffer(width float64, quadsegs int) Geometry
- func (mls MultiLineString) BufferInMeter(width float64, quadsegs int) Geometry
- func (mls MultiLineString) Centroid() Point
- func (mls MultiLineString) ConvexHull() Geometry
- func (mls MultiLineString) CoordinateSystem() int
- func (mls MultiLineString) Dimensions() int
- func (mls MultiLineString) Distance(g Geometry) (float64, error)
- func (mls MultiLineString) Envelope() Geometry
- func (mls MultiLineString) Equals(g Geometry) bool
- func (mls MultiLineString) EqualsExact(g Geometry, tolerance float64) bool
- func (mls MultiLineString) EqualsMultiLineString(multiLineString MultiLineString) bool
- func (mls MultiLineString) Filter(f matrix.Filter) Geometry
- func (mls MultiLineString) GeoJSONType() string
- func (mls MultiLineString) Geom() Geometry
- func (mls MultiLineString) IsClosed() bool
- func (mls MultiLineString) IsCollection() bool
- func (mls MultiLineString) IsCorrect() bool
- func (mls MultiLineString) IsEmpty() bool
- func (mls MultiLineString) IsRing() bool
- func (mls MultiLineString) IsSimple() bool
- func (mls MultiLineString) IsValid() bool
- func (mls MultiLineString) Length() float64
- func (mls MultiLineString) Nums() int
- func (mls MultiLineString) PointOnSurface() Geometry
- func (mls MultiLineString) Simplify(tolerance float64) Geometry
- func (mls MultiLineString) SimplifyP(tolerance float64) Geometry
- func (mls MultiLineString) SpheroidDistance(g Geometry) (float64, error)
- func (mls MultiLineString) ToMatrix() matrix.Steric
- func (mls MultiLineString) UniquePoints() MultiPoint
- type MultiPoint
- func (mp MultiPoint) Area() (float64, error)
- func (mp MultiPoint) Bound() Bound
- func (mp MultiPoint) Boundary() (Geometry, error)
- func (mp MultiPoint) Buffer(width float64, quadsegs int) Geometry
- func (mp MultiPoint) BufferInMeter(width float64, quadsegs int) Geometry
- func (mp MultiPoint) Centroid() Point
- func (mp MultiPoint) ConvexHull() Geometry
- func (mp MultiPoint) CoordinateSystem() int
- func (mp MultiPoint) Dimensions() int
- func (mp MultiPoint) Distance(g Geometry) (float64, error)
- func (mp MultiPoint) Envelope() Geometry
- func (mp MultiPoint) Equals(g Geometry) bool
- func (mp MultiPoint) EqualsExact(g Geometry, tolerance float64) bool
- func (mp MultiPoint) EqualsMultiPoint(multiPoint MultiPoint) bool
- func (mp MultiPoint) Filter(f matrix.Filter) Geometry
- func (mp MultiPoint) GeoJSONType() string
- func (mp MultiPoint) Geom() Geometry
- func (mp MultiPoint) IsClosed() bool
- func (mp MultiPoint) IsCollection() bool
- func (mp MultiPoint) IsCorrect() bool
- func (mp MultiPoint) IsEmpty() bool
- func (mp MultiPoint) IsRing() bool
- func (mp MultiPoint) IsSimple() bool
- func (mp MultiPoint) IsValid() bool
- func (mp MultiPoint) Length() float64
- func (mp MultiPoint) Nums() int
- func (mp MultiPoint) PointOnSurface() Geometry
- func (mp MultiPoint) Simplify(tolerance float64) Geometry
- func (mp MultiPoint) SimplifyP(tolerance float64) Geometry
- func (mp MultiPoint) SpheroidDistance(g Geometry) (float64, error)
- func (mp MultiPoint) ToMatrix() matrix.Steric
- func (mp MultiPoint) ToPointArray() (pa []Point)
- func (mp MultiPoint) UniquePoints() MultiPoint
- type MultiPolygon
- func (mp MultiPolygon) Area() (float64, error)
- func (mp MultiPolygon) Bound() Bound
- func (mp MultiPolygon) Boundary() (Geometry, error)
- func (mp MultiPolygon) Buffer(width float64, quadsegs int) Geometry
- func (mp MultiPolygon) BufferInMeter(width float64, quadsegs int) Geometry
- func (mp MultiPolygon) Centroid() Point
- func (mp MultiPolygon) ConvexHull() Geometry
- func (mp MultiPolygon) CoordinateSystem() int
- func (mp MultiPolygon) Dimensions() int
- func (mp MultiPolygon) Distance(g Geometry) (float64, error)
- func (mp MultiPolygon) Envelope() Geometry
- func (mp MultiPolygon) Equals(g Geometry) bool
- func (mp MultiPolygon) EqualsExact(g Geometry, tolerance float64) bool
- func (mp MultiPolygon) EqualsMultiPolygon(multiPolygon MultiPolygon) bool
- func (mp MultiPolygon) Filter(f matrix.Filter) Geometry
- func (mp MultiPolygon) GeoJSONType() string
- func (mp MultiPolygon) Geom() Geometry
- func (mp MultiPolygon) IsClosed() bool
- func (mp MultiPolygon) IsCollection() bool
- func (mp MultiPolygon) IsCorrect() bool
- func (mp MultiPolygon) IsEmpty() bool
- func (mp MultiPolygon) IsRing() bool
- func (mp MultiPolygon) IsSimple() bool
- func (mp MultiPolygon) IsValid() bool
- func (mp MultiPolygon) Length() float64
- func (mp MultiPolygon) Nums() int
- func (mp MultiPolygon) PointOnSurface() Geometry
- func (mp MultiPolygon) Simplify(tolerance float64) Geometry
- func (mp MultiPolygon) SimplifyP(tolerance float64) Geometry
- func (mp MultiPolygon) SpheroidDistance(g Geometry) (float64, error)
- func (mp MultiPolygon) ToMatrix() matrix.Steric
- func (mp MultiPolygon) UniquePoints() MultiPoint
- type Point
- func (p Point) Area() (float64, error)
- func (p Point) Bound() Bound
- func (p Point) Boundary() (Geometry, error)
- func (p Point) Buffer(width float64, quadsegs int) Geometry
- func (p Point) BufferInMeter(width float64, quadsegs int) Geometry
- func (p Point) Centroid() Point
- func (p Point) ConvexHull() Geometry
- func (p Point) CoordinateSystem() int
- func (p Point) Dimensions() int
- func (p Point) Distance(g Geometry) (float64, error)
- func (p Point) Envelope() Geometry
- func (p Point) Equals(g Geometry) bool
- func (p Point) EqualsExact(g Geometry, tolerance float64) bool
- func (p Point) EqualsPoint(point Point) bool
- func (p Point) Filter(f matrix.Filter) Geometry
- func (p Point) Generate(r *rand.Rand, _ int) reflect.Value
- func (p Point) GeoJSONType() string
- func (p Point) Geom() Geometry
- func (p Point) IsClosed() bool
- func (p Point) IsCollection() bool
- func (p Point) IsCorrect() bool
- func (p Point) IsEmpty() bool
- func (p Point) IsRing() bool
- func (p Point) IsSimple() bool
- func (p Point) IsValid() bool
- func (p Point) Lat() float64
- func (p Point) Length() float64
- func (p Point) Lon() float64
- func (p Point) Nums() int
- func (p Point) PointOnSurface() Geometry
- func (p Point) Simplify(tolerance float64) Geometry
- func (p Point) SimplifyP(tolerance float64) Geometry
- func (p Point) SpheroidDistance(g Geometry) (float64, error)
- func (p Point) ToMatrix() matrix.Steric
- func (p Point) UniquePoints() MultiPoint
- func (p Point) X() float64
- func (p Point) Y() float64
- type Polygon
- func (p Polygon) Area() (float64, error)
- func (p Polygon) Bound() Bound
- func (p Polygon) Boundary() (Geometry, error)
- func (p Polygon) Buffer(width float64, quadsegs int) Geometry
- func (p Polygon) BufferInMeter(width float64, quadsegs int) Geometry
- func (p Polygon) Centroid() Point
- func (p Polygon) ConvexHull() Geometry
- func (p Polygon) CoordinateSystem() int
- func (p Polygon) Dimensions() int
- func (p Polygon) Distance(g Geometry) (float64, error)
- func (p Polygon) Envelope() Geometry
- func (p Polygon) Equals(g Geometry) bool
- func (p Polygon) EqualsExact(g Geometry, tolerance float64) bool
- func (p Polygon) EqualsPolygon(polygon Polygon) bool
- func (p Polygon) Filter(f matrix.Filter) Geometry
- func (p Polygon) GeoJSONType() string
- func (p Polygon) Geom() Geometry
- func (p Polygon) Holes() []Ring
- func (p Polygon) IsClosed() bool
- func (p Polygon) IsCollection() bool
- func (p Polygon) IsCorrect() bool
- func (p Polygon) IsEmpty() bool
- func (p Polygon) IsRectangle() bool
- func (p Polygon) IsRing() bool
- func (p Polygon) IsSimple() bool
- func (p Polygon) IsValid() bool
- func (p Polygon) Length() float64
- func (p Polygon) Nums() int
- func (p Polygon) PointOnSurface() Geometry
- func (p Polygon) Shell() Ring
- func (p Polygon) Simplify(tolerance float64) Geometry
- func (p Polygon) SimplifyP(tolerance float64) Geometry
- func (p Polygon) SpheroidDistance(g Geometry) (float64, error)
- func (p Polygon) ToMatrix() matrix.Steric
- func (p Polygon) ToRingArray() (r []Ring)
- func (p Polygon) UniquePoints() MultiPoint
- type Ring
- func (r Ring) Area() (float64, error)
- func (r Ring) Bound() Bound
- func (r Ring) Boundary() (Geometry, error)
- func (r Ring) Buffer(width float64, quadsegs int) Geometry
- func (r Ring) BufferInMeter(width float64, quadsegs int) Geometry
- func (r Ring) Centroid() Point
- func (r Ring) ConvexHull() Geometry
- func (r Ring) CoordinateSystem() int
- func (r Ring) Dimensions() int
- func (r Ring) Distance(g Geometry) (float64, error)
- func (r Ring) Envelope() Geometry
- func (r Ring) Equals(g Geometry) bool
- func (r Ring) EqualsExact(g Geometry, tolerance float64) bool
- func (r Ring) EqualsRing(ring Ring) bool
- func (r Ring) Filter(f matrix.Filter) Geometry
- func (r Ring) GeoJSONType() string
- func (r Ring) Geom() Geometry
- func (r Ring) IsClosed() bool
- func (r Ring) IsCollection() bool
- func (r Ring) IsCorrect() bool
- func (r Ring) IsEmpty() bool
- func (r Ring) IsRing() bool
- func (r Ring) IsSimple() bool
- func (r Ring) IsValid() bool
- func (r Ring) Length() float64
- func (r Ring) Nums() int
- func (r Ring) PointOnSurface() Geometry
- func (r Ring) Simplify(tolerance float64) Geometry
- func (r Ring) SimplifyP(tolerance float64) Geometry
- func (r Ring) SpheroidDistance(g Geometry) (float64, error)
- func (r Ring) ToMatrix() matrix.Steric
- func (r Ring) UniquePoints() MultiPoint
Constants ¶
const ( BJ54 = iota + 1000000 XA80 CGCS2000 // WGS84 World Geodetic System一1984 Coordinate System WGS84 = 4326 // PseudoMercator WGS 84 / Pseudo-Mercator PseudoMercator = 3857 //GCJ02 Guojia cehui ju 02 ,unit degree GCJ02 = 104326 //GCJ02Web Guojia cehui ju 02 Mercator, unit m GCJ02Web = 103857 // BD09 Guojia cehui ju 02+BD ,unit degree BD09 = 114326 // BD09Web Guojia cehui ju 02+BD, unit m BD09Web = 113857 )
const Coordinate System
const ( TypePoint = "Point" TypeMultiPoint = "MultiPoint" TypeLineString = "LineString" TypeMultiLineString = "MultiLineString" TypePolygon = "Polygon" TypeMultiPolygon = "MultiPolygon" TypeCollection = "GeometryCollection" TypeBound = "Bound" TypeCircle = "Polygon" )
const geomtype
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bound ¶
type Bound struct {
Min, Max Point
}
A Bound represents a closed box or rectangle. To create a bound with two points you can do something like: MultiPoint{p1, p2}.Bound()
func (Bound) Boundary ¶
Boundary returns the closure of the combinatorial boundary of this space.Geometry.
func (Bound) Buffer ¶
Buffer Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (Bound) BufferInMeter ¶ added in v1.0.2
BufferInMeter Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (Bound) Contains ¶
Contains determines if the point is within the bound. Points on the boundary are considered within.
func (Bound) ContainsBound ¶
ContainsBound determines if the bound is within the bound.
func (Bound) ConvexHull ¶
ConvexHull computes the convex hull of a geometry. The convex hull is the smallest convex geometry that encloses all geometries in the input. In the general case the convex hull is a Polygon. The convex hull of two or more collinear points is a two-point LineString. The convex hull of one or more identical points is a Point.
func (Bound) CoordinateSystem ¶ added in v1.0.1
CoordinateSystem return Coordinate System.
func (Bound) Dimensions ¶
Dimensions returns 2 because a Bound is a 2d object.
func (Bound) Envelope ¶
Envelope returns the minimum bounding box for the supplied geometry, as a geometry. The polygon is defined by the corner points of the bounding box ((MINX, MINY), (MINX, MAXY), (MAXX, MAXY), (MAXX, MINY), (MINX, MINY)).
func (Bound) EqualsBound ¶
EqualsBound returns if two bounds are equal.
func (Bound) EqualsExact ¶
EqualsExact Returns true if the two Geometries are exactly equal, up to a specified distance tolerance. Two Geometries are exactly equal within a distance tolerance
func (Bound) GeoJSONType ¶
GeoJSONType returns the GeoJSON type for the object.
func (Bound) IntersectsBound ¶
IntersectsBound Tests if the region defined by other intersects the region of this Envelope.
func (Bound) IsClosed ¶
IsClosed Returns TRUE if the LINESTRING's start and end points are coincident. For Polyhedral Surfaces, reports if the surface is areal (open) or IsC (closed).
func (Bound) IsCollection ¶
IsCollection returns true if the Geometry is collection.
func (Bound) IsEmpty ¶
IsEmpty returns true if it contains zero area or if it's in some malformed negative state where the left point is larger than the right. This can be caused by padding too much negative.
func (Bound) IsSimple ¶
IsSimple returns true if this space.Geometry has no anomalous geometric points, such as self intersection or self tangency.
func (Bound) PointOnSurface ¶
PointOnSurface Returns a POINT guaranteed to intersect a surface.
func (Bound) RightBottom ¶
RightBottom return the lower right point of the bound.
func (Bound) Simplify ¶
Simplify returns a "simplified" version of the given geometry using the Douglas-Peucker algorithm, May not preserve topology
func (Bound) SimplifyP ¶
SimplifyP returns a geometry simplified by amount given by tolerance. Unlike Simplify, SimplifyP guarantees it will preserve topology.
func (Bound) SpheroidDistance ¶
SpheroidDistance returns spheroid distance Between the two Geometry.
func (Bound) UniquePoints ¶
func (b Bound) UniquePoints() MultiPoint
UniquePoints return all distinct vertices of input geometry as a MultiPoint.
type Circle ¶ added in v1.0.2
Circle describes a circle Valid
func CreateCircle ¶ added in v1.0.2
CreateCircle Returns valid circle.
func CreateCircleWithSegments ¶ added in v1.0.2
CreateCircleWithSegments Returns valid circle.
func (*Circle) Bound ¶ added in v1.0.2
Bound returns a rect around the circle. Uses rectangular coordinates.
func (*Circle) Buffer ¶ added in v1.0.2
Buffer sReturns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (*Circle) Envelope ¶ added in v1.0.2
Envelope returns the minimum bounding box for the supplied geometry, as a geometry. The polygon is defined by the corner points of the bounding box ((MINX, MINY), (MINX, MAXY), (MAXX, MAXY), (MAXX, MINY), (MINX, MINY)).
func (*Circle) Equals ¶ added in v1.0.2
Equals checks if the Circle represents the same Geometry or vector.
func (*Circle) EqualsCircle ¶ added in v1.0.2
EqualsCircle compares two circles.
func (*Circle) EqualsExact ¶ added in v1.0.2
EqualsExact Returns true if the two Geometries are exactly equal, up to a specified distance tolerance. Two Geometries are exactly equal within a distance tolerance
func (*Circle) GeoJSONType ¶ added in v1.0.2
GeoJSONType returns the GeoJSON type for the circle.
func (*Circle) IsClosed ¶ added in v1.0.2
IsClosed Returns TRUE if the LINESTRING's start and end points are coincident. For Polyhedral Surfaces, reports if the surface is areal (open) or IsC (closed).
func (*Circle) IsRing ¶ added in v1.0.2
IsRing returns true if the lineal geometry has the circle property.
func (*Circle) IsSimple ¶ added in v1.0.2
IsSimple returns true if this space.Geometry has no anomalous geometric points, such as self intersection or self tangency.
type Collection ¶
type Collection []Geometry
A Collection is a collection of geometries that is also a Geometry.
func (Collection) Area ¶
func (c Collection) Area() (float64, error)
Area returns the area of a Collection geometry.
func (Collection) Bound ¶
func (c Collection) Bound() Bound
Bound returns the bounding box of all the Geometries combined.
func (Collection) Boundary ¶
func (c Collection) Boundary() (Geometry, error)
Boundary returns the closure of the combinatorial boundary of this space.Geometry.
func (Collection) Buffer ¶
func (c Collection) Buffer(width float64, quadsegs int) Geometry
Buffer Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (Collection) BufferInMeter ¶ added in v1.0.2
func (c Collection) BufferInMeter(width float64, quadsegs int) Geometry
BufferInMeter Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (Collection) Centroid ¶
func (c Collection) Centroid() Point
Centroid Computes the centroid point of a geometry.
func (Collection) ConvexHull ¶
func (c Collection) ConvexHull() Geometry
ConvexHull computes the convex hull of a geometry. The convex hull is the smallest convex geometry that encloses all geometries in the input. In the general case the convex hull is a Polygon. The convex hull of two or more collinear points is a two-point LineString. The convex hull of one or more identical points is a Point.
func (Collection) CoordinateSystem ¶ added in v1.0.1
func (c Collection) CoordinateSystem() int
CoordinateSystem return Coordinate System.
func (Collection) Dimensions ¶
func (c Collection) Dimensions() int
Dimensions returns the max of the dimensions of the collection.
func (Collection) Distance ¶
func (c Collection) Distance(g Geometry) (float64, error)
Distance returns distance Between the two Geometry.
func (Collection) Envelope ¶
func (c Collection) Envelope() Geometry
Envelope returns the minimum bounding box for the supplied geometry, as a geometry. The polygon is defined by the corner points of the bounding box ((MINX, MINY), (MINX, MAXY), (MAXX, MAXY), (MAXX, MINY), (MINX, MINY)).
func (Collection) Equals ¶
func (c Collection) Equals(g Geometry) bool
Equals checks if the Collection represents the same Geometry or vector.
func (Collection) EqualsCollection ¶
func (c Collection) EqualsCollection(collection Collection) bool
EqualsCollection compares two collections. Returns true if lengths are the same and all the sub geometries are the same and in the same order.
func (Collection) EqualsExact ¶
func (c Collection) EqualsExact(g Geometry, tolerance float64) bool
EqualsExact Returns true if the two Geometries are exactly equal, up to a specified distance tolerance. Two Geometries are exactly equal within a distance tolerance
func (Collection) Filter ¶ added in v1.0.2
func (c Collection) Filter(f matrix.Filter) Geometry
Filter Performs an operation with the provided .
func (Collection) GeoJSONType ¶
func (c Collection) GeoJSONType() string
GeoJSONType returns the geometry collection type.
func (Collection) Geom ¶ added in v1.1.0
func (c Collection) Geom() Geometry
Geom return Geometry without Coordinate System.
func (Collection) IsClosed ¶
func (c Collection) IsClosed() bool
IsClosed Returns TRUE if the LINESTRING's start and end points are coincident. For Polyhedral Surfaces, reports if the surface is areal (open) or IsC (closed).
func (Collection) IsCollection ¶
func (c Collection) IsCollection() bool
IsCollection returns true if the Geometry is collection.
func (Collection) IsCorrect ¶ added in v1.1.2
func (c Collection) IsCorrect() bool
IsCorrect returns true if the geometry struct is Correct.
func (Collection) IsEmpty ¶
func (c Collection) IsEmpty() bool
IsEmpty returns true if the Geometry is empty.
func (Collection) IsRing ¶
func (c Collection) IsRing() bool
IsRing returns true if the lineal geometry has the ring property.
func (Collection) IsSimple ¶
func (c Collection) IsSimple() bool
IsSimple returns true if this space.Geometry has no anomalous geometric points, such as self intersection or self tangency.
func (Collection) IsValid ¶
func (c Collection) IsValid() bool
IsValid returns true if the geometry is valid.
func (Collection) Length ¶
func (c Collection) Length() float64
Length Returns the length of this Collection
func (Collection) PointOnSurface ¶
func (c Collection) PointOnSurface() Geometry
PointOnSurface Returns a POINT guaranteed to intersect a surface.
func (Collection) Simplify ¶
func (c Collection) Simplify(tolerance float64) Geometry
Simplify returns a "simplified" version of the given geometry using the Douglas-Peucker algorithm, May not preserve topology
func (Collection) SimplifyP ¶
func (c Collection) SimplifyP(tolerance float64) Geometry
SimplifyP returns a geometry simplified by amount given by tolerance. Unlike Simplify, SimplifyP guarantees it will preserve topology.
func (Collection) SpheroidDistance ¶
func (c Collection) SpheroidDistance(g Geometry) (float64, error)
SpheroidDistance returns spheroid distance Between the two Geometry.
func (Collection) ToMatrix ¶
func (c Collection) ToMatrix() matrix.Steric
ToMatrix returns the Steric of a geometry.
func (Collection) UniquePoints ¶
func (c Collection) UniquePoints() MultiPoint
UniquePoints return all distinct vertices of input geometry as a MultiPoint.
type Geometry ¶
type Geometry interface { // CoordinateSystem return Coordinate System. CoordinateSystem() int // Geom return Geometry without Coordinate System. Geom() Geometry GeoJSONType() string // e.g. 0d, 1d, 2d Dimensions() int Bound() Bound // Num of geometries Nums() int // IsCollection returns true if the Geometry is collection. IsCollection() bool // ToMatrix returns the Steric of a geometry. ToMatrix() matrix.Steric // Area returns the area of a polygonal geometry. Area() (float64, error) // Boundary returns the closure of the combinatorial boundary of this space.Geometry. Boundary() (Geometry, error) // Buffer Returns a geometry that represents all points whose distance // from this space.Geometry is less than or equal to distance. Buffer(width float64, quadsegs int) Geometry // BufferInMeter Returns a geometry that represents all points whose distance // from this space.Geometry is less than or equal to distance. BufferInMeter(width float64, quadsegs int) Geometry // Centroid Computes the centroid point of a geometry. Centroid() Point // ConvexHull computes the convex hull of a geometry. The convex hull is the smallest convex geometry // that encloses all geometries in the input. // In the general case the convex hull is a Polygon. // The convex hull of two or more collinear points is a two-point LineString. // The convex hull of one or more identical points is a Point. ConvexHull() Geometry // Distance returns distance Between the two Geometry. Distance(g Geometry) (float64, error) // Envelope returns the minimum bounding box for the supplied geometry, as a geometry. // The polygon is defined by the corner points of the bounding box // ((MINX, MINY), (MINX, MAXY), (MAXX, MAXY), (MAXX, MINY), (MINX, MINY)). Envelope() Geometry // Equals returns true if the Geometry represents the same Geometry or vector. Equals(g Geometry) bool // EqualsExact Returns true if the two Geometries are exactly equal, // up to a specified distance tolerance. // Two Geometries are exactly equal within a distance tolerance EqualsExact(g Geometry, tolerance float64) bool // IsClosed Returns TRUE if the LINESTRING's start and end points are coincident. // For Polyhedral Surfaces, reports if the surface is areal (open) or IsC (closed). IsClosed() bool // IsEmpty returns true if the Geometry is empty. IsEmpty() bool // IsRing returns true if the lineal geometry has the ring property. IsRing() bool // IsSimple returns true if this space.Geometry has no anomalous geometric points, // such as self intersection or self tangency. IsSimple() bool // IsValid returns true if the geometry is valid. IsValid() bool // IsCorrect returns true if the geometry struct is Correct. IsCorrect() bool // Length Returns the length of this geometry Length() float64 // PointOnSurface Returns a POINT guaranteed to intersect a surface. PointOnSurface() Geometry // UniquePoints return all distinct vertices of input geometry as a MultiPoint. UniquePoints() MultiPoint // Simplify returns a "simplified" version of the given geometry using the Douglas-Peucker algorithm, // May not preserve topology Simplify(tolerance float64) Geometry // SimplifyP returns a geometry simplified by amount given by tolerance. // Unlike Simplify, SimplifyP guarantees it will preserve topology. SimplifyP(tolerance float64) Geometry // SpheroidDistance returns spheroid distance Between the two Geometry. SpheroidDistance(g Geometry) (float64, error) // Filter Performs an operation with the provided . Filter(f matrix.Filter) Geometry }
Geometry is the interface implemented by other spatial objects
func BufferInMeter ¶ added in v1.0.2
BufferInMeter ...
func TransGeometry ¶
TransGeometry trans steric to geometry.
type GeometryValid ¶ added in v1.0.1
type GeometryValid struct { Geometry // contains filtered or unexported fields }
GeometryValid describes a geographic Element Valid
func CreateElementValid ¶
func CreateElementValid(geom Geometry) (*GeometryValid, error)
CreateElementValid Returns valid geom element. returns nil if geom is invalid.
func CreateElementValidWithCoordSys ¶
func CreateElementValidWithCoordSys(geom Geometry, coordSys int) (*GeometryValid, error)
CreateElementValidWithCoordSys Returns valid geom element. returns nil if geom is invalid.
func (*GeometryValid) CoordinateSystem ¶ added in v1.0.1
func (g *GeometryValid) CoordinateSystem() int
CoordinateSystem return Coordinate System.
func (*GeometryValid) Geom ¶ added in v1.1.0
func (g *GeometryValid) Geom() Geometry
Geom return Geometry without Coordinate System.
func (*GeometryValid) IsProjection ¶ added in v1.0.2
func (g *GeometryValid) IsProjection() bool
IsProjection returns true if the coordinateSystem is projection.
type LineString ¶
type LineString matrix.LineMatrix
LineString represents a set of points to be thought of as a polyline.
func (LineString) Area ¶
func (ls LineString) Area() (float64, error)
Area returns the area of a polygonal geometry. The area of a LineString is 0.
func (LineString) Bound ¶
func (ls LineString) Bound() Bound
Bound returns a rect around the line string. Uses rectangular coordinates.
func (LineString) Boundary ¶
func (ls LineString) Boundary() (Geometry, error)
Boundary returns the closure of the combinatorial boundary of this space.Geometry. The boundary of a lineal geometry is always a zero-dimensional geometry (which may be empty).
func (LineString) Buffer ¶
func (ls LineString) Buffer(width float64, quadsegs int) Geometry
Buffer Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (LineString) BufferInMeter ¶ added in v1.0.2
func (ls LineString) BufferInMeter(width float64, quadsegs int) Geometry
BufferInMeter Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (LineString) Centroid ¶
func (ls LineString) Centroid() Point
Centroid Computes the centroid point of a geometry.
func (LineString) ConvexHull ¶
func (ls LineString) ConvexHull() Geometry
ConvexHull computes the convex hull of a geometry. The convex hull is the smallest convex geometry that encloses all geometries in the input. In the general case the convex hull is a Polygon. The convex hull of two or more collinear points is a two-point LineString. The convex hull of one or more identical points is a Point.
func (LineString) CoordinateSystem ¶ added in v1.0.1
func (ls LineString) CoordinateSystem() int
CoordinateSystem return Coordinate System.
func (LineString) Dimensions ¶
func (ls LineString) Dimensions() int
Dimensions returns 1 because a LineString is a 1d object.
func (LineString) Distance ¶
func (ls LineString) Distance(g Geometry) (float64, error)
Distance returns distance Between the two Geometry.
func (LineString) Envelope ¶
func (ls LineString) Envelope() Geometry
Envelope returns the minimum bounding box for the supplied geometry, as a geometry. The polygon is defined by the corner points of the bounding box ((MINX, MINY), (MINX, MAXY), (MAXX, MAXY), (MAXX, MINY), (MINX, MINY)).
func (LineString) Equals ¶
func (ls LineString) Equals(g Geometry) bool
Equals checks if the LineString represents the same Geometry or vector.
func (LineString) EqualsExact ¶
func (ls LineString) EqualsExact(g Geometry, tolerance float64) bool
EqualsExact Returns true if the two Geometries are exactly equal, up to a specified distance tolerance. Two Geometries are exactly equal within a distance tolerance
func (LineString) EqualsLineString ¶ added in v1.0.2
func (ls LineString) EqualsLineString(lineString LineString) bool
EqualsLineString compares two line strings. Returns true if lengths are the same and all points are Equal.
func (LineString) Filter ¶ added in v1.0.2
func (ls LineString) Filter(f matrix.Filter) Geometry
Filter Performs an operation with the provided .
func (LineString) GeoJSONType ¶
func (ls LineString) GeoJSONType() string
GeoJSONType returns the GeoJSON type for the linestring.
func (LineString) Geom ¶ added in v1.1.0
func (ls LineString) Geom() Geometry
Geom return Geometry without Coordinate System.
func (LineString) IsClosed ¶
func (ls LineString) IsClosed() bool
IsClosed Returns TRUE if the LINESTRING's start and end points are coincident. For Polyhedral Surfaces, reports if the surface is areal (open) or IsC (closed).
func (LineString) IsCollection ¶
func (ls LineString) IsCollection() bool
IsCollection returns true if the Geometry is collection.
func (LineString) IsCorrect ¶ added in v1.1.2
func (ls LineString) IsCorrect() bool
IsCorrect returns true if the geometry struct is Correct.
func (LineString) IsEmpty ¶
func (ls LineString) IsEmpty() bool
IsEmpty returns true if the Geometry is empty.
func (LineString) IsRing ¶
func (ls LineString) IsRing() bool
IsRing returns true if the lineal geometry has the ring property.
func (LineString) IsSimple ¶
func (ls LineString) IsSimple() bool
IsSimple returns true if this space.Geometry has no anomalous geometric points, such as self intersection or self tangency.
func (LineString) IsValid ¶
func (ls LineString) IsValid() bool
IsValid returns true if the geometry is valid.
func (LineString) Length ¶
func (ls LineString) Length() float64
Length Returns the length of this LineString
func (LineString) PointOnSurface ¶
func (ls LineString) PointOnSurface() Geometry
PointOnSurface Returns a POINT guaranteed to intersect a surface.
func (LineString) Simplify ¶
func (ls LineString) Simplify(tolerance float64) Geometry
Simplify returns a "simplified" version of the given geometry using the Douglas-Peucker algorithm, May not preserve topology
func (LineString) SimplifyP ¶
func (ls LineString) SimplifyP(tolerance float64) Geometry
SimplifyP returns a geometry simplified by amount given by tolerance. Unlike Simplify, SimplifyP guarantees it will preserve topology.
func (LineString) SpheroidDistance ¶
func (ls LineString) SpheroidDistance(g Geometry) (float64, error)
SpheroidDistance returns spheroid distance Between the two Geometry.
func (LineString) ToLineArray ¶
func (ls LineString) ToLineArray() (lines []Line)
ToLineArray returns the LineArray
func (LineString) ToMatrix ¶
func (ls LineString) ToMatrix() matrix.Steric
ToMatrix returns the LineMatrix of a Ring geometry.
func (LineString) ToPointArray ¶
func (ls LineString) ToPointArray() (la []Point)
ToPointArray returns the PointArray
func (LineString) UniquePoints ¶
func (ls LineString) UniquePoints() MultiPoint
UniquePoints return all distinct vertices of input geometry as a MultiPoint.
type MultiLineString ¶
type MultiLineString []LineString
MultiLineString is a set of polylines.
func (MultiLineString) Area ¶
func (mls MultiLineString) Area() (float64, error)
Area returns the area of a polygonal geometry. The area of a MultiLineString is 0.
func (MultiLineString) Bound ¶
func (mls MultiLineString) Bound() Bound
Bound returns a bound around all the line strings.
func (MultiLineString) Boundary ¶
func (mls MultiLineString) Boundary() (Geometry, error)
Boundary returns the closure of the combinatorial boundary of this space.Geometry.
func (MultiLineString) Buffer ¶
func (mls MultiLineString) Buffer(width float64, quadsegs int) Geometry
Buffer Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (MultiLineString) BufferInMeter ¶ added in v1.0.2
func (mls MultiLineString) BufferInMeter(width float64, quadsegs int) Geometry
BufferInMeter Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (MultiLineString) Centroid ¶
func (mls MultiLineString) Centroid() Point
Centroid Computes the centroid point of a geometry.
func (MultiLineString) ConvexHull ¶
func (mls MultiLineString) ConvexHull() Geometry
ConvexHull computes the convex hull of a geometry. The convex hull is the smallest convex geometry that encloses all geometries in the input. In the general case the convex hull is a Polygon. The convex hull of two or more collinear points is a two-point LineString. The convex hull of one or more identical points is a Point.
func (MultiLineString) CoordinateSystem ¶ added in v1.0.1
func (mls MultiLineString) CoordinateSystem() int
CoordinateSystem return Coordinate System.
func (MultiLineString) Dimensions ¶
func (mls MultiLineString) Dimensions() int
Dimensions returns 1 because a MultiLineString is a 2d object.
func (MultiLineString) Distance ¶
func (mls MultiLineString) Distance(g Geometry) (float64, error)
Distance returns distance Between the two Geometry.
func (MultiLineString) Envelope ¶
func (mls MultiLineString) Envelope() Geometry
Envelope returns the minimum bounding box for the supplied geometry, as a geometry. The polygon is defined by the corner points of the bounding box ((MINX, MINY), (MINX, MAXY), (MAXX, MAXY), (MAXX, MINY), (MINX, MINY)).
func (MultiLineString) Equals ¶
func (mls MultiLineString) Equals(g Geometry) bool
Equals checks if the MultiLineString represents the same Geometry or vector.
func (MultiLineString) EqualsExact ¶
func (mls MultiLineString) EqualsExact(g Geometry, tolerance float64) bool
EqualsExact Returns true if the two Geometries are exactly equal, up to a specified distance tolerance. Two Geometries are exactly equal within a distance tolerance
func (MultiLineString) EqualsMultiLineString ¶
func (mls MultiLineString) EqualsMultiLineString(multiLineString MultiLineString) bool
EqualsMultiLineString compares two multi line strings. Returns true if lengths are the same and all points are Equal.
func (MultiLineString) Filter ¶ added in v1.0.2
func (mls MultiLineString) Filter(f matrix.Filter) Geometry
Filter Performs an operation with the provided .
func (MultiLineString) GeoJSONType ¶
func (mls MultiLineString) GeoJSONType() string
GeoJSONType returns the GeoJSON type for the object.
func (MultiLineString) Geom ¶ added in v1.1.0
func (mls MultiLineString) Geom() Geometry
Geom return Geometry without Coordinate System.
func (MultiLineString) IsClosed ¶
func (mls MultiLineString) IsClosed() bool
IsClosed Returns TRUE if the LINESTRING's start and end points are coincident. For Polyhedral Surfaces, reports if the surface is areal (open) or IsC (closed).
func (MultiLineString) IsCollection ¶
func (mls MultiLineString) IsCollection() bool
IsCollection returns true if the Geometry is collection.
func (MultiLineString) IsCorrect ¶ added in v1.1.2
func (mls MultiLineString) IsCorrect() bool
IsCorrect returns true if the geometry struct is Correct.
func (MultiLineString) IsEmpty ¶
func (mls MultiLineString) IsEmpty() bool
IsEmpty returns true if the Geometry is empty.
func (MultiLineString) IsRing ¶
func (mls MultiLineString) IsRing() bool
IsRing returns true if the lineal geometry has the ring property.
func (MultiLineString) IsSimple ¶
func (mls MultiLineString) IsSimple() bool
IsSimple returns true if this space.Geometry has no anomalous geometric points, such as self intersection or self tangency.
func (MultiLineString) IsValid ¶
func (mls MultiLineString) IsValid() bool
IsValid returns true if the geometry is valid.
func (MultiLineString) Length ¶
func (mls MultiLineString) Length() float64
Length Returns the length of this MultiLineString
func (MultiLineString) PointOnSurface ¶
func (mls MultiLineString) PointOnSurface() Geometry
PointOnSurface Returns a POINT guaranteed to intersect a surface.
func (MultiLineString) Simplify ¶
func (mls MultiLineString) Simplify(tolerance float64) Geometry
Simplify returns a "simplified" version of the given geometry using the Douglas-Peucker algorithm, May not preserve topology
func (MultiLineString) SimplifyP ¶
func (mls MultiLineString) SimplifyP(tolerance float64) Geometry
SimplifyP returns a geometry simplified by amount given by tolerance. Unlike Simplify, SimplifyP guarantees it will preserve topology.
func (MultiLineString) SpheroidDistance ¶
func (mls MultiLineString) SpheroidDistance(g Geometry) (float64, error)
SpheroidDistance returns spheroid distance Between the two Geometry.
func (MultiLineString) ToMatrix ¶
func (mls MultiLineString) ToMatrix() matrix.Steric
ToMatrix returns the Steric of a geometry.
func (MultiLineString) UniquePoints ¶
func (mls MultiLineString) UniquePoints() MultiPoint
UniquePoints return all distinct vertices of input geometry as a MultiPoint.
type MultiPoint ¶
type MultiPoint []Point
A MultiPoint represents a set of points .
func (MultiPoint) Area ¶
func (mp MultiPoint) Area() (float64, error)
Area returns the area of a polygonal geometry. The area of a multipoint is 0.
func (MultiPoint) Bound ¶
func (mp MultiPoint) Bound() Bound
Bound returns a bound around the points. Uses rectangular coordinates.
func (MultiPoint) Boundary ¶
func (mp MultiPoint) Boundary() (Geometry, error)
Boundary returns the closure of the combinatorial boundary of this space.Geometry.
func (MultiPoint) Buffer ¶
func (mp MultiPoint) Buffer(width float64, quadsegs int) Geometry
Buffer Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (MultiPoint) BufferInMeter ¶ added in v1.0.2
func (mp MultiPoint) BufferInMeter(width float64, quadsegs int) Geometry
BufferInMeter Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (MultiPoint) Centroid ¶
func (mp MultiPoint) Centroid() Point
Centroid Computes the centroid point of a geometry.
func (MultiPoint) ConvexHull ¶
func (mp MultiPoint) ConvexHull() Geometry
ConvexHull computes the convex hull of a geometry. The convex hull is the smallest convex geometry that encloses all geometries in the input. In the general case the convex hull is a Polygon. The convex hull of two or more collinear points is a two-point LineString. The convex hull of one or more identical points is a Point.
func (MultiPoint) CoordinateSystem ¶ added in v1.0.1
func (mp MultiPoint) CoordinateSystem() int
CoordinateSystem return Coordinate System.
func (MultiPoint) Dimensions ¶
func (mp MultiPoint) Dimensions() int
Dimensions returns 0 because a MultiPoint is a 0d object.
func (MultiPoint) Distance ¶
func (mp MultiPoint) Distance(g Geometry) (float64, error)
Distance returns distance Between the two Geometry.
func (MultiPoint) Envelope ¶
func (mp MultiPoint) Envelope() Geometry
Envelope returns the minimum bounding box for the supplied geometry, as a geometry. The polygon is defined by the corner points of the bounding box ((MINX, MINY), (MINX, MAXY), (MAXX, MAXY), (MAXX, MINY), (MINX, MINY)).
func (MultiPoint) Equals ¶
func (mp MultiPoint) Equals(g Geometry) bool
Equals checks if the MultiPoint represents the same Geometry or vector.
func (MultiPoint) EqualsExact ¶
func (mp MultiPoint) EqualsExact(g Geometry, tolerance float64) bool
EqualsExact Returns true if the two Geometries are exactly equal, up to a specified distance tolerance. Two Geometries are exactly equal within a distance tolerance
func (MultiPoint) EqualsMultiPoint ¶
func (mp MultiPoint) EqualsMultiPoint(multiPoint MultiPoint) bool
EqualsMultiPoint compares two MultiPoint objects. Returns true if lengths are the same and all points are Equal, and in the same order.
func (MultiPoint) Filter ¶ added in v1.0.2
func (mp MultiPoint) Filter(f matrix.Filter) Geometry
Filter Performs an operation with the provided .
func (MultiPoint) GeoJSONType ¶
func (mp MultiPoint) GeoJSONType() string
GeoJSONType returns the GeoJSON type for the object.
func (MultiPoint) Geom ¶ added in v1.1.0
func (mp MultiPoint) Geom() Geometry
Geom return Geometry without Coordinate System.
func (MultiPoint) IsClosed ¶
func (mp MultiPoint) IsClosed() bool
IsClosed Returns TRUE if the LINESTRING's start and end points are coincident. For Polyhedral Surfaces, reports if the surface is areal (open) or IsC (closed).
func (MultiPoint) IsCollection ¶
func (mp MultiPoint) IsCollection() bool
IsCollection returns true if the Geometry is collection.
func (MultiPoint) IsCorrect ¶ added in v1.1.2
func (mp MultiPoint) IsCorrect() bool
IsCorrect returns true if the geometry struct is Correct.
func (MultiPoint) IsEmpty ¶
func (mp MultiPoint) IsEmpty() bool
IsEmpty returns true if the Geometry is empty.
func (MultiPoint) IsRing ¶
func (mp MultiPoint) IsRing() bool
IsRing returns true if the lineal geometry has the ring property.
func (MultiPoint) IsSimple ¶
func (mp MultiPoint) IsSimple() bool
IsSimple returns true if this space.Geometry has no anomalous geometric points, such as self intersection or self tangency.
func (MultiPoint) IsValid ¶
func (mp MultiPoint) IsValid() bool
IsValid returns true if the geometry is valid.
func (MultiPoint) Length ¶
func (mp MultiPoint) Length() float64
Length Returns the length of this geometry
func (MultiPoint) PointOnSurface ¶
func (mp MultiPoint) PointOnSurface() Geometry
PointOnSurface Returns a POINT guaranteed to intersect a surface.
func (MultiPoint) Simplify ¶
func (mp MultiPoint) Simplify(tolerance float64) Geometry
Simplify returns a "simplified" version of the given geometry using the Douglas-Peucker algorithm, May not preserve topology
func (MultiPoint) SimplifyP ¶
func (mp MultiPoint) SimplifyP(tolerance float64) Geometry
SimplifyP returns a geometry simplified by amount given by tolerance. Unlike Simplify, SimplifyP guarantees it will preserve topology.
func (MultiPoint) SpheroidDistance ¶
func (mp MultiPoint) SpheroidDistance(g Geometry) (float64, error)
SpheroidDistance returns spheroid distance Between the two Geometry.
func (MultiPoint) ToMatrix ¶
func (mp MultiPoint) ToMatrix() matrix.Steric
ToMatrix returns the Steric of a geometry.
func (MultiPoint) ToPointArray ¶
func (mp MultiPoint) ToPointArray() (pa []Point)
ToPointArray returns the PointArray
func (MultiPoint) UniquePoints ¶
func (mp MultiPoint) UniquePoints() MultiPoint
UniquePoints return all distinct vertices of input geometry as a MultiPoint.
type MultiPolygon ¶
type MultiPolygon []Polygon
MultiPolygon is a set of polygons.
func (MultiPolygon) Area ¶
func (mp MultiPolygon) Area() (float64, error)
Area returns the area of a polygonal geometry.
func (MultiPolygon) Bound ¶
func (mp MultiPolygon) Bound() Bound
Bound returns a bound around the multi-polygon.
func (MultiPolygon) Boundary ¶
func (mp MultiPolygon) Boundary() (Geometry, error)
Boundary returns the closure of the combinatorial boundary of this space.Geometry.
func (MultiPolygon) Buffer ¶
func (mp MultiPolygon) Buffer(width float64, quadsegs int) Geometry
Buffer Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (MultiPolygon) BufferInMeter ¶ added in v1.0.2
func (mp MultiPolygon) BufferInMeter(width float64, quadsegs int) Geometry
BufferInMeter Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (MultiPolygon) Centroid ¶
func (mp MultiPolygon) Centroid() Point
Centroid Computes the centroid point of a geometry.
func (MultiPolygon) ConvexHull ¶
func (mp MultiPolygon) ConvexHull() Geometry
ConvexHull computes the convex hull of a geometry. The convex hull is the smallest convex geometry that encloses all geometries in the input. In the general case the convex hull is a Polygon. The convex hull of two or more collinear points is a two-point LineString. The convex hull of one or more identical points is a Point.
func (MultiPolygon) CoordinateSystem ¶ added in v1.0.1
func (mp MultiPolygon) CoordinateSystem() int
CoordinateSystem return Coordinate System.
func (MultiPolygon) Dimensions ¶
func (mp MultiPolygon) Dimensions() int
Dimensions returns 0 because a MultiPoint is a 0d object.
func (MultiPolygon) Distance ¶
func (mp MultiPolygon) Distance(g Geometry) (float64, error)
Distance returns distance Between the two Geometry.
func (MultiPolygon) Envelope ¶
func (mp MultiPolygon) Envelope() Geometry
Envelope returns the minimum bounding box for the supplied geometry, as a geometry. The polygon is defined by the corner points of the bounding box ((MINX, MINY), (MINX, MAXY), (MAXX, MAXY), (MAXX, MINY), (MINX, MINY)).
func (MultiPolygon) Equals ¶
func (mp MultiPolygon) Equals(g Geometry) bool
Equals checks if the MultiPolygon represents the same Geometry or vector.
func (MultiPolygon) EqualsExact ¶
func (mp MultiPolygon) EqualsExact(g Geometry, tolerance float64) bool
EqualsExact Returns true if the two Geometries are exactly equal, up to a specified distance tolerance. Two Geometries are exactly equal within a distance tolerance
func (MultiPolygon) EqualsMultiPolygon ¶
func (mp MultiPolygon) EqualsMultiPolygon(multiPolygon MultiPolygon) bool
EqualsMultiPolygon compares two multi-polygons.
func (MultiPolygon) Filter ¶ added in v1.0.2
func (mp MultiPolygon) Filter(f matrix.Filter) Geometry
Filter Performs an operation with the provided .
func (MultiPolygon) GeoJSONType ¶
func (mp MultiPolygon) GeoJSONType() string
GeoJSONType returns the GeoJSON type for the object.
func (MultiPolygon) Geom ¶ added in v1.1.0
func (mp MultiPolygon) Geom() Geometry
Geom return Geometry without Coordinate System.
func (MultiPolygon) IsClosed ¶
func (mp MultiPolygon) IsClosed() bool
IsClosed Returns TRUE if the LINESTRING's start and end points are coincident. For Polyhedral Surfaces, reports if the surface is areal (open) or IsC (closed).
func (MultiPolygon) IsCollection ¶
func (mp MultiPolygon) IsCollection() bool
IsCollection returns true if the Geometry is collection.
func (MultiPolygon) IsCorrect ¶ added in v1.1.2
func (mp MultiPolygon) IsCorrect() bool
IsCorrect returns true if the geometry struct is Correct.
func (MultiPolygon) IsEmpty ¶
func (mp MultiPolygon) IsEmpty() bool
IsEmpty returns true if the Geometry is empty.
func (MultiPolygon) IsRing ¶
func (mp MultiPolygon) IsRing() bool
IsRing returns true if the lineal geometry has the ring property.
func (MultiPolygon) IsSimple ¶
func (mp MultiPolygon) IsSimple() bool
IsSimple returns true if this space.Geometry has no anomalous geometric points, such as self intersection or self tangency.
func (MultiPolygon) IsValid ¶
func (mp MultiPolygon) IsValid() bool
IsValid returns true if the geometry is valid.
func (MultiPolygon) Length ¶
func (mp MultiPolygon) Length() float64
Length Returns the length of this MultiPolygon
func (MultiPolygon) PointOnSurface ¶
func (mp MultiPolygon) PointOnSurface() Geometry
PointOnSurface Returns a POINT guaranteed to intersect a surface.
func (MultiPolygon) Simplify ¶
func (mp MultiPolygon) Simplify(tolerance float64) Geometry
Simplify returns a "simplified" version of the given geometry using the Douglas-Peucker algorithm, May not preserve topology
func (MultiPolygon) SimplifyP ¶
func (mp MultiPolygon) SimplifyP(tolerance float64) Geometry
SimplifyP returns a geometry simplified by amount given by tolerance. Unlike Simplify, SimplifyP guarantees it will preserve topology.
func (MultiPolygon) SpheroidDistance ¶
func (mp MultiPolygon) SpheroidDistance(g Geometry) (float64, error)
SpheroidDistance returns spheroid distance Between the two Geometry.
func (MultiPolygon) ToMatrix ¶
func (mp MultiPolygon) ToMatrix() matrix.Steric
ToMatrix returns the Steric of a geometry.
func (MultiPolygon) UniquePoints ¶
func (mp MultiPolygon) UniquePoints() MultiPoint
UniquePoints return all distinct vertices of input geometry as a MultiPoint.
type Point ¶
Point describes a geographic point
func (Point) Boundary ¶
Boundary returns the closure of the combinatorial boundary of this Geometry.
func (Point) Buffer ¶
Buffer Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (Point) BufferInMeter ¶ added in v1.0.2
BufferInMeter Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (Point) ConvexHull ¶
ConvexHull computes the convex hull of a geometry. The convex hull is the smallest convex geometry that encloses all geometries in the input. In the general case the convex hull is a Polygon. The convex hull of two or more collinear points is a two-point LineString. The convex hull of one or more identical points is a Point.
func (Point) CoordinateSystem ¶ added in v1.0.1
CoordinateSystem return Coordinate System.
func (Point) Dimensions ¶
Dimensions returns 0 because a point is a 0d object.
func (Point) Envelope ¶
Envelope returns the minimum bounding box for the supplied geometry, as a geometry. The polygon is defined by the corner points of the bounding box ((MINX, MINY), (MINX, MAXY), (MAXX, MAXY), (MAXX, MINY), (MINX, MINY)).
func (Point) EqualsExact ¶
EqualsExact Returns true if the two Geometries are exactly equal, up to a specified distance tolerance. Two Geometries are exactly equal within a distance tolerance
func (Point) EqualsPoint ¶
EqualsPoint checks if the point represents the same point or vector.
func (Point) GeoJSONType ¶
GeoJSONType returns GeoJSON type for the point
func (Point) IsClosed ¶
IsClosed Returns TRUE if the LINESTRING's start and end points are coincident. For Polyhedral Surfaces, reports if the surface is areal (open) or IsC (closed).
func (Point) IsCollection ¶
IsCollection returns true if the Geometry is collection.
func (Point) IsSimple ¶
IsSimple returns true if this Geometry has no anomalous geometric points, such as self intersection or self tangency.
func (Point) PointOnSurface ¶
PointOnSurface Returns a POINT guaranteed to intersect a surface.
func (Point) Simplify ¶
Simplify returns a "simplified" version of the given geometry using the Douglas-Peucker algorithm, May not preserve topology
func (Point) SimplifyP ¶
SimplifyP returns a geometry simplified by amount given by tolerance. Unlike Simplify, SimplifyP guarantees it will preserve topology.
func (Point) SpheroidDistance ¶
SpheroidDistance returns spheroid distance Between the two Geometry.
func (Point) UniquePoints ¶
func (p Point) UniquePoints() MultiPoint
UniquePoints return all distinct vertices of input geometry as a MultiPoint.
type Polygon ¶
type Polygon matrix.PolygonMatrix
Polygon is a closed area. The first LineString is the outer ring. The others are the holes. Each LineString is expected to be closed ie. the first point matches the last.
func (Polygon) Boundary ¶
Boundary returns the closure of the combinatorial boundary of this space.Geometry.
func (Polygon) Buffer ¶
Buffer Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (Polygon) BufferInMeter ¶ added in v1.0.2
BufferInMeter Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (Polygon) ConvexHull ¶
ConvexHull computes the convex hull of a geometry. The convex hull is the smallest convex geometry that encloses all geometries in the input. In the general case the convex hull is a Polygon. The convex hull of two or more collinear points is a two-point LineString. The convex hull of one or more identical points is a Point.
func (Polygon) CoordinateSystem ¶ added in v1.0.1
CoordinateSystem return Coordinate System.
func (Polygon) Dimensions ¶
Dimensions returns 2 because a Polygon is a 2d object.
func (Polygon) Envelope ¶
Envelope returns the minimum bounding box for the supplied geometry, as a geometry. The polygon is defined by the corner points of the bounding box ((MINX, MINY), (MINX, MAXY), (MAXX, MAXY), (MAXX, MINY), (MINX, MINY)).
func (Polygon) EqualsExact ¶
EqualsExact Returns true if the two Geometries are exactly equal, up to a specified distance tolerance. Two Geometries are exactly equal within a distance tolerance
func (Polygon) EqualsPolygon ¶
EqualsPolygon comEqualPolygonpares two polygons. Returns true if lengths are the same and all points are Equal.
func (Polygon) GeoJSONType ¶
GeoJSONType returns the GeoJSON type for the polygon.
func (Polygon) IsClosed ¶
IsClosed Returns TRUE if the LINESTRING's start and end points are coincident. For Polyhedral Surfaces, reports if the surface is areal (open) or IsC (closed).
func (Polygon) IsCollection ¶
IsCollection returns true if the Geometry is collection.
func (Polygon) IsCorrect ¶ added in v1.1.2
IsCorrect returns true if the geometry struct is Correct.
func (Polygon) IsRectangle ¶
IsRectangle returns true if the polygon is rectangle.
func (Polygon) IsSimple ¶
IsSimple returns true if this space.Geometry has no anomalous geometric points, such as self intersection or self tangency.
func (Polygon) PointOnSurface ¶
PointOnSurface Returns a POINT guaranteed to intersect a surface.
func (Polygon) Simplify ¶
Simplify returns a "simplified" version of the given geometry using the Douglas-Peucker algorithm, May not preserve topology
func (Polygon) SimplifyP ¶
SimplifyP returns a geometry simplified by amount given by tolerance. Unlike Simplify, SimplifyP guarantees it will preserve topology.
func (Polygon) SpheroidDistance ¶
SpheroidDistance returns spheroid distance Between the two Geometry.
func (Polygon) ToRingArray ¶
ToRingArray returns the RingArray
func (Polygon) UniquePoints ¶
func (p Polygon) UniquePoints() MultiPoint
UniquePoints return all distinct vertices of input geometry as a MultiPoint.
type Ring ¶
type Ring LineString
Ring represents a set of ring on the earth.
func (Ring) Boundary ¶
Boundary returns the closure of the combinatorial boundary of this space.Geometry. The boundary of a lineal geometry is always a zero-dimensional geometry (which may be empty).
func (Ring) Buffer ¶
Buffer Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (Ring) BufferInMeter ¶ added in v1.0.2
BufferInMeter Returns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.
func (Ring) ConvexHull ¶
ConvexHull computes the convex hull of a geometry. The convex hull is the smallest convex geometry that encloses all geometries in the input. In the general case the convex hull is a Polygon. The convex hull of two or more collinear points is a two-point LineString. The convex hull of one or more identical points is a Point.
func (Ring) CoordinateSystem ¶ added in v1.0.1
CoordinateSystem return Coordinate System.
func (Ring) Dimensions ¶
Dimensions returns 2 because a Ring is a 2d object.
func (Ring) Envelope ¶
Envelope returns the minimum bounding box for the supplied geometry, as a geometry. The polygon is defined by the corner points of the bounding box ((MINX, MINY), (MINX, MAXY), (MAXX, MAXY), (MAXX, MINY), (MINX, MINY)).
func (Ring) EqualsExact ¶
EqualsExact Returns true if the two Geometries are exactly equal, up to a specified distance tolerance. Two Geometries are exactly equal within a distance tolerance
func (Ring) EqualsRing ¶ added in v1.0.2
EqualsRing compares two rings. Returns true if lengths are the same and all points are Equal.
func (Ring) GeoJSONType ¶
GeoJSONType returns the GeoJSON type for the ring.
func (Ring) IsClosed ¶
IsClosed Returns TRUE if the LINESTRING's start and end points are coincident. For Polyhedral Surfaces, reports if the surface is areal (open) or IsC (closed).
func (Ring) IsCollection ¶
IsCollection returns true if the Geometry is collection.
func (Ring) IsSimple ¶
IsSimple returns true if this space.Geometry has no anomalous geometric points, such as self intersection or self tangency.
func (Ring) PointOnSurface ¶
PointOnSurface Returns a POINT guaranteed to intersect a surface.
func (Ring) Simplify ¶
Simplify returns a "simplified" version of the given geometry using the Douglas-Peucker algorithm, May not preserve topology
func (Ring) SimplifyP ¶
SimplifyP returns a geometry simplified by amount given by tolerance. Unlike Simplify, SimplifyP guarantees it will preserve topology.
func (Ring) SpheroidDistance ¶
SpheroidDistance returns spheroid distance Between the two Geometry.
func (Ring) UniquePoints ¶
func (r Ring) UniquePoints() MultiPoint
UniquePoints return all distinct vertices of input geometry as a MultiPoint.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package spaceerr A representation of error.
|
Package spaceerr A representation of error. |
Package topograph the topological relations between points, line and surface entities in DE-9IM model are given.
|
Package topograph the topological relations between points, line and surface entities in DE-9IM model are given. |
Package topograph the topological relations between points, line and surface entities in DE-9IM model are given.
|
Package topograph the topological relations between points, line and surface entities in DE-9IM model are given. |