space

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: LGPL-2.1 Imports: 12 Imported by: 2

Documentation

Overview

Package space A representation of a linear vector geometry. include point line ring polygon multipoint multiline multrpolygon collection bound.

Index

Constants

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

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

func Distance

func Distance(from, to Geometry, f measure.Distance) (float64, error)

Distance returns distance Between the two Geometry.

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) Area

func (b Bound) Area() (float64, error)

Area returns the area of a polygonal geometry. The area of a bound is 0.

func (Bound) Bottom

func (b Bound) Bottom() float64

Bottom returns the bottom of the bound.

func (Bound) Bound

func (b Bound) Bound() Bound

Bound returns the the same bound.

func (Bound) Boundary

func (b Bound) Boundary() (Geometry, error)

Boundary returns the closure of the combinatorial boundary of this space.Geometry.

func (Bound) Buffer

func (b Bound) 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 (Bound) BufferInMeter added in v1.0.2

func (b Bound) 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 (Bound) Centroid

func (b Bound) Centroid() Point

Centroid Computes the centroid point of a geometry.

func (Bound) Contains

func (b Bound) Contains(point Point) bool

Contains determines if the point is within the bound. Points on the boundary are considered within.

func (Bound) ContainsBound

func (b Bound) ContainsBound(bound Bound) bool

ContainsBound determines if the bound is within the bound.

func (Bound) ConvexHull

func (b Bound) 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 (Bound) CoordinateSystem added in v1.0.1

func (b Bound) CoordinateSystem() int

CoordinateSystem return Coordinate System.

func (Bound) Dimensions

func (b Bound) Dimensions() int

Dimensions returns 2 because a Bound is a 2d object.

func (Bound) Distance

func (b Bound) Distance(g Geometry) (float64, error)

Distance returns distance Between the two Geometry.

func (Bound) Envelope

func (b Bound) 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 (Bound) Equals

func (b Bound) Equals(g Geometry) bool

Equals checks if the Bound represents the same Geometry or vector.

func (Bound) EqualsBound

func (b Bound) EqualsBound(c Bound) bool

EqualsBound returns if two bounds are equal.

func (Bound) EqualsExact

func (b Bound) 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 (Bound) Extend

func (b Bound) Extend(point Point) Bound

Extend grows the bound to include the new point.

func (Bound) Filter added in v1.0.2

func (b Bound) Filter(f matrix.Filter) Geometry

Filter Performs an operation with the provided .

func (Bound) GeoJSONType

func (b Bound) GeoJSONType() string

GeoJSONType returns the GeoJSON type for the object.

func (Bound) Geom added in v1.1.0

func (b Bound) Geom() Geometry

Geom return Geometry without Coordinate System.

func (Bound) IntersectsBound

func (b Bound) IntersectsBound(other Bound) bool

IntersectsBound Tests if the region defined by other intersects the region of this Envelope.

func (Bound) IsClosed

func (b Bound) 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 (Bound) IsCollection

func (b Bound) IsCollection() bool

IsCollection returns true if the Geometry is collection.

func (Bound) IsCorrect added in v1.1.2

func (b Bound) IsCorrect() bool

IsCorrect returns true if the geometry struct is Correct.

func (Bound) IsEmpty

func (b Bound) IsEmpty() bool

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) IsRing

func (b Bound) IsRing() bool

IsRing returns true if the lineal geometry has the ring property.

func (Bound) IsSimple

func (b Bound) IsSimple() bool

IsSimple returns true if this space.Geometry has no anomalous geometric points, such as self intersection or self tangency.

func (Bound) IsValid

func (b Bound) IsValid() bool

IsValid returns true if the geometry is valid.

func (Bound) Left

func (b Bound) Left() float64

Left returns the left of the bound.

func (Bound) LeftTop

func (b Bound) LeftTop() Point

LeftTop returns the upper left point of the bound.

func (Bound) Length

func (b Bound) Length() float64

Length Returns the length of this LineString

func (Bound) Nums

func (b Bound) Nums() int

Nums ...

func (Bound) PointOnSurface

func (b Bound) PointOnSurface() Geometry

PointOnSurface Returns a POINT guaranteed to intersect a surface.

func (Bound) Right

func (b Bound) Right() float64

Right returns the right of the bound.

func (Bound) RightBottom

func (b Bound) RightBottom() Point

RightBottom return the lower right point of the bound.

func (Bound) Simplify

func (b Bound) Simplify(tolerance float64) Geometry

Simplify returns a "simplified" version of the given geometry using the Douglas-Peucker algorithm, May not preserve topology

func (Bound) SimplifyP

func (b Bound) SimplifyP(tolerance float64) Geometry

SimplifyP returns a geometry simplified by amount given by tolerance. Unlike Simplify, SimplifyP guarantees it will preserve topology.

func (Bound) SpheroidDistance

func (b Bound) SpheroidDistance(g Geometry) (float64, error)

SpheroidDistance returns spheroid distance Between the two Geometry.

func (Bound) ToMatrix

func (b Bound) ToMatrix() matrix.Steric

ToMatrix returns the Steric of a geometry.

func (Bound) ToPolygon

func (b Bound) ToPolygon() Polygon

ToPolygon converts the bound into a Polygon object.

func (Bound) ToRing

func (b Bound) ToRing() Ring

ToRing converts the bound into a loop defined by the boundary of the box.

func (Bound) Top

func (b Bound) Top() float64

Top returns the top of the bound.

func (Bound) Union

func (b Bound) Union(other Bound) Bound

Union extends this bound to contain the union of this and the given bound.

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

type Circle struct {
	Polygon
	Centre   Point
	Radius   float64
	Segments int
}

Circle describes a circle Valid

func CreateCircle added in v1.0.2

func CreateCircle(centre Point, radius float64) (*Circle, error)

CreateCircle Returns valid circle.

func CreateCircleWithSegments added in v1.0.2

func CreateCircleWithSegments(centre Point, radius float64, segments int) (*Circle, error)

CreateCircleWithSegments Returns valid circle.

func (*Circle) Area added in v1.0.2

func (c *Circle) Area() (float64, error)

Area returns the area of a circle geometry.

func (*Circle) Bound added in v1.0.2

func (c *Circle) Bound() Bound

Bound returns a rect around the circle. Uses rectangular coordinates.

func (*Circle) Buffer added in v1.0.2

func (c *Circle) Buffer(width float64, quadsegs int) Geometry

Buffer sReturns a geometry that represents all points whose distance from this space.Geometry is less than or equal to distance.

func (*Circle) Centroid added in v1.0.2

func (c *Circle) Centroid() Point

Centroid Computes the centroid point of a geometry.

func (*Circle) Envelope added in v1.0.2

func (c *Circle) 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 (*Circle) Equals added in v1.0.2

func (c *Circle) Equals(g Geometry) bool

Equals checks if the Circle represents the same Geometry or vector.

func (*Circle) EqualsCircle added in v1.0.2

func (c *Circle) EqualsCircle(circle *Circle) bool

EqualsCircle compares two circles.

func (*Circle) EqualsExact added in v1.0.2

func (c *Circle) 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 (*Circle) GeoJSONType added in v1.0.2

func (c *Circle) GeoJSONType() string

GeoJSONType returns the GeoJSON type for the circle.

func (*Circle) Geom added in v1.1.0

func (c *Circle) Geom() Geometry

Geom return Geometry without Coordinate System.

func (*Circle) IsClosed added in v1.0.2

func (c *Circle) 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 (*Circle) IsRing added in v1.0.2

func (c *Circle) IsRing() bool

IsRing returns true if the lineal geometry has the circle property.

func (*Circle) IsSimple added in v1.0.2

func (c *Circle) IsSimple() bool

IsSimple returns true if this space.Geometry has no anomalous geometric points, such as self intersection or self tangency.

func (*Circle) IsValid added in v1.0.2

func (c *Circle) IsValid() bool

IsValid returns true if the geometry is valid.

func (*Circle) Length added in v1.0.2

func (c *Circle) Length() float64

Length Returns the length of this circle

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) Nums

func (c Collection) Nums() int

Nums ...

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 Coordinate

type Coordinate struct {
	X float64
	Y float64
	Z float64
}

Coordinate coord

func (Coordinate) String

func (c Coordinate) String() string

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

func BufferInMeter(geometry Geometry, width float64, quadsegs int) Geometry

BufferInMeter ...

func TransGeometry

func TransGeometry(inputGeom matrix.Steric) Geometry

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 Line

type Line struct {
	Start, End Point
}

Line straight line .

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) Nums

func (ls LineString) Nums() int

Nums num of linestrings

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) Nums

func (mls MultiLineString) Nums() int

Nums num of multiLinstrings

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) Nums

func (mp MultiPoint) Nums() int

Nums num of multiPoint.

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) Nums

func (mp MultiPolygon) Nums() int

Nums num of multiPolygons

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

type Point matrix.Matrix

Point describes a geographic point

func Centroid

func Centroid(geom Geometry) Point

Centroid Computes the centroid point of a geometry.

func (Point) Area

func (p Point) Area() (float64, error)

Area returns the area of a polygonal geometry. The area of a point is 0.

func (Point) Bound

func (p Point) Bound() Bound

Bound returns a single point bound of the point.

func (Point) Boundary

func (p Point) Boundary() (Geometry, error)

Boundary returns the closure of the combinatorial boundary of this Geometry.

func (Point) Buffer

func (p Point) 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 (Point) BufferInMeter added in v1.0.2

func (p Point) 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 (Point) Centroid

func (p Point) Centroid() Point

Centroid Computes the centroid point of a geometry.

func (Point) ConvexHull

func (p Point) 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 (Point) CoordinateSystem added in v1.0.1

func (p Point) CoordinateSystem() int

CoordinateSystem return Coordinate System.

func (Point) Dimensions

func (p Point) Dimensions() int

Dimensions returns 0 because a point is a 0d object.

func (Point) Distance

func (p Point) Distance(g Geometry) (float64, error)

Distance returns distance Between the two Geometry.

func (Point) Envelope

func (p Point) 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 (Point) Equals

func (p Point) Equals(g Geometry) bool

Equals checks if the point represents the same Geometry or vector.

func (Point) EqualsExact

func (p Point) 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 (Point) EqualsPoint

func (p Point) EqualsPoint(point Point) bool

EqualsPoint checks if the point represents the same point or vector.

func (Point) Filter added in v1.0.2

func (p Point) Filter(f matrix.Filter) Geometry

Filter Performs an operation with the provided .

func (Point) Generate

func (p Point) Generate(r *rand.Rand, _ int) reflect.Value

Generate implements the Generator interface for Points

func (Point) GeoJSONType

func (p Point) GeoJSONType() string

GeoJSONType returns GeoJSON type for the point

func (Point) Geom added in v1.1.0

func (p Point) Geom() Geometry

Geom return Geometry without Coordinate System.

func (Point) IsClosed

func (p Point) 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 (Point) IsCollection

func (p Point) IsCollection() bool

IsCollection returns true if the Geometry is collection.

func (Point) IsCorrect added in v1.1.2

func (p Point) IsCorrect() bool

IsCorrect returns true if the geometry struct is Correct.

func (Point) IsEmpty

func (p Point) IsEmpty() bool

IsEmpty returns true if the Geometry is empty.

func (Point) IsRing

func (p Point) IsRing() bool

IsRing returns true if the lineal geometry has the ring property.

func (Point) IsSimple

func (p Point) IsSimple() bool

IsSimple returns true if this Geometry has no anomalous geometric points, such as self intersection or self tangency.

func (Point) IsValid

func (p Point) IsValid() bool

IsValid returns true if the geometry is valid.

func (Point) Lat

func (p Point) Lat() float64

Lat returns the vertical, latitude coordinate of the point.

func (Point) Length

func (p Point) Length() float64

Length Returns the length of this geometry

func (Point) Lon

func (p Point) Lon() float64

Lon returns the horizontal, longitude coordinate of the point.

func (Point) Nums

func (p Point) Nums() int

Nums num of points

func (Point) PointOnSurface

func (p Point) PointOnSurface() Geometry

PointOnSurface Returns a POINT guaranteed to intersect a surface.

func (Point) Simplify

func (p Point) Simplify(tolerance float64) Geometry

Simplify returns a "simplified" version of the given geometry using the Douglas-Peucker algorithm, May not preserve topology

func (Point) SimplifyP

func (p Point) SimplifyP(tolerance float64) Geometry

SimplifyP returns a geometry simplified by amount given by tolerance. Unlike Simplify, SimplifyP guarantees it will preserve topology.

func (Point) SpheroidDistance

func (p Point) SpheroidDistance(g Geometry) (float64, error)

SpheroidDistance returns spheroid distance Between the two Geometry.

func (Point) ToMatrix

func (p Point) ToMatrix() matrix.Steric

ToMatrix returns the Steric of a geometry.

func (Point) UniquePoints

func (p Point) UniquePoints() MultiPoint

UniquePoints return all distinct vertices of input geometry as a MultiPoint.

func (Point) X

func (p Point) X() float64

X returns the horizontal coordinate of the point.

func (Point) Y

func (p Point) Y() float64

Y returns the vertical coordinate of the point.

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) Area

func (p Polygon) Area() (float64, error)

Area returns the area of a polygonal geometry.

func (Polygon) Bound

func (p Polygon) Bound() Bound

Bound returns a bound around the polygon.

func (Polygon) Boundary

func (p Polygon) Boundary() (Geometry, error)

Boundary returns the closure of the combinatorial boundary of this space.Geometry.

func (Polygon) Buffer

func (p Polygon) 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 (Polygon) BufferInMeter added in v1.0.2

func (p Polygon) 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 (Polygon) Centroid

func (p Polygon) Centroid() Point

Centroid Computes the centroid point of a geometry.

func (Polygon) ConvexHull

func (p Polygon) 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 (Polygon) CoordinateSystem added in v1.0.1

func (p Polygon) CoordinateSystem() int

CoordinateSystem return Coordinate System.

func (Polygon) Dimensions

func (p Polygon) Dimensions() int

Dimensions returns 2 because a Polygon is a 2d object.

func (Polygon) Distance

func (p Polygon) Distance(g Geometry) (float64, error)

Distance returns distance Between the two Geometry.

func (Polygon) Envelope

func (p Polygon) 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 (Polygon) Equals

func (p Polygon) Equals(g Geometry) bool

Equals checks if the Polygon represents the same Geometry or vector.

func (Polygon) EqualsExact

func (p Polygon) 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 (Polygon) EqualsPolygon

func (p Polygon) EqualsPolygon(polygon Polygon) bool

EqualsPolygon comEqualPolygonpares two polygons. Returns true if lengths are the same and all points are Equal.

func (Polygon) Filter added in v1.0.2

func (p Polygon) Filter(f matrix.Filter) Geometry

Filter Performs an operation with the provided .

func (Polygon) GeoJSONType

func (p Polygon) GeoJSONType() string

GeoJSONType returns the GeoJSON type for the polygon.

func (Polygon) Geom added in v1.1.0

func (p Polygon) Geom() Geometry

Geom return Geometry without Coordinate System.

func (Polygon) Holes

func (p Polygon) Holes() []Ring

Holes returns Holes..

func (Polygon) IsClosed

func (p Polygon) 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 (Polygon) IsCollection

func (p Polygon) IsCollection() bool

IsCollection returns true if the Geometry is collection.

func (Polygon) IsCorrect added in v1.1.2

func (p Polygon) IsCorrect() bool

IsCorrect returns true if the geometry struct is Correct.

func (Polygon) IsEmpty

func (p Polygon) IsEmpty() bool

IsEmpty returns true if the Geometry is empty.

func (Polygon) IsRectangle

func (p Polygon) IsRectangle() bool

IsRectangle returns true if the polygon is rectangle.

func (Polygon) IsRing

func (p Polygon) IsRing() bool

IsRing returns true if the lineal geometry has the ring property.

func (Polygon) IsSimple

func (p Polygon) IsSimple() bool

IsSimple returns true if this space.Geometry has no anomalous geometric points, such as self intersection or self tangency.

func (Polygon) IsValid

func (p Polygon) IsValid() bool

IsValid returns true if the geometry is valid.

func (Polygon) Length

func (p Polygon) Length() float64

Length Returns the length of this Polygon

func (Polygon) Nums

func (p Polygon) Nums() int

Nums num of polygons

func (Polygon) PointOnSurface

func (p Polygon) PointOnSurface() Geometry

PointOnSurface Returns a POINT guaranteed to intersect a surface.

func (Polygon) Shell

func (p Polygon) Shell() Ring

Shell returns shell..

func (Polygon) Simplify

func (p Polygon) Simplify(tolerance float64) Geometry

Simplify returns a "simplified" version of the given geometry using the Douglas-Peucker algorithm, May not preserve topology

func (Polygon) SimplifyP

func (p Polygon) SimplifyP(tolerance float64) Geometry

SimplifyP returns a geometry simplified by amount given by tolerance. Unlike Simplify, SimplifyP guarantees it will preserve topology.

func (Polygon) SpheroidDistance

func (p Polygon) SpheroidDistance(g Geometry) (float64, error)

SpheroidDistance returns spheroid distance Between the two Geometry.

func (Polygon) ToMatrix

func (p Polygon) ToMatrix() matrix.Steric

ToMatrix returns the LineMatrix of a Ring geometry.

func (Polygon) ToRingArray

func (p Polygon) ToRingArray() (r []Ring)

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) Area

func (r Ring) Area() (float64, error)

Area returns the area of a polygonal geometry.

func (Ring) Bound

func (r Ring) Bound() Bound

Bound returns a rect around the ring. Uses rectangular coordinates.

func (Ring) Boundary

func (r Ring) 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 (Ring) Buffer

func (r Ring) 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 (Ring) BufferInMeter added in v1.0.2

func (r Ring) 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 (Ring) Centroid

func (r Ring) Centroid() Point

Centroid Computes the centroid point of a geometry.

func (Ring) ConvexHull

func (r Ring) 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 (Ring) CoordinateSystem added in v1.0.1

func (r Ring) CoordinateSystem() int

CoordinateSystem return Coordinate System.

func (Ring) Dimensions

func (r Ring) Dimensions() int

Dimensions returns 2 because a Ring is a 2d object.

func (Ring) Distance

func (r Ring) Distance(g Geometry) (float64, error)

Distance returns distance Between the two Geometry.

func (Ring) Envelope

func (r Ring) 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 (Ring) Equals

func (r Ring) Equals(g Geometry) bool

Equals checks if the Ring represents the same Geometry or vector.

func (Ring) EqualsExact

func (r Ring) 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 (Ring) EqualsRing added in v1.0.2

func (r Ring) EqualsRing(ring Ring) bool

EqualsRing compares two rings. Returns true if lengths are the same and all points are Equal.

func (Ring) Filter added in v1.0.2

func (r Ring) Filter(f matrix.Filter) Geometry

Filter Performs an operation with the provided .

func (Ring) GeoJSONType

func (r Ring) GeoJSONType() string

GeoJSONType returns the GeoJSON type for the ring.

func (Ring) Geom added in v1.1.0

func (r Ring) Geom() Geometry

Geom return Geometry without Coordinate System.

func (Ring) IsClosed

func (r Ring) 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 (Ring) IsCollection

func (r Ring) IsCollection() bool

IsCollection returns true if the Geometry is collection.

func (Ring) IsCorrect added in v1.1.2

func (r Ring) IsCorrect() bool

IsCorrect returns true if the geometry struct is Correct.

func (Ring) IsEmpty

func (r Ring) IsEmpty() bool

IsEmpty returns true if the Geometry is empty.

func (Ring) IsRing

func (r Ring) IsRing() bool

IsRing returns true if the lineal geometry has the ring property.

func (Ring) IsSimple

func (r Ring) IsSimple() bool

IsSimple returns true if this space.Geometry has no anomalous geometric points, such as self intersection or self tangency.

func (Ring) IsValid

func (r Ring) IsValid() bool

IsValid returns true if the geometry is valid.

func (Ring) Length

func (r Ring) Length() float64

Length Returns the length of this LineString

func (Ring) Nums

func (r Ring) Nums() int

Nums num of linstrings

func (Ring) PointOnSurface

func (r Ring) PointOnSurface() Geometry

PointOnSurface Returns a POINT guaranteed to intersect a surface.

func (Ring) Simplify

func (r Ring) Simplify(tolerance float64) Geometry

Simplify returns a "simplified" version of the given geometry using the Douglas-Peucker algorithm, May not preserve topology

func (Ring) SimplifyP

func (r Ring) SimplifyP(tolerance float64) Geometry

SimplifyP returns a geometry simplified by amount given by tolerance. Unlike Simplify, SimplifyP guarantees it will preserve topology.

func (Ring) SpheroidDistance

func (r Ring) SpheroidDistance(g Geometry) (float64, error)

SpheroidDistance returns spheroid distance Between the two Geometry.

func (Ring) ToMatrix

func (r Ring) ToMatrix() matrix.Steric

ToMatrix returns the LineMatrix of a Ring geometry.

func (Ring) UniquePoints

func (r Ring) UniquePoints() MultiPoint

UniquePoints return all distinct vertices of input geometry as a MultiPoint.

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.

Jump to

Keyboard shortcuts

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