geos

package module
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: MIT Imports: 6 Imported by: 14

README

go-geos

PkgGoDev

Package go-geos provides an interface to GEOS.

Features

  • Fluent Go API.

  • Low-level Context, CoordSeq, Geom, and PrepGeom types provide access to all GEOS methods.

  • High-level geometry.Geometry type implements all GEOS functionality and many standard Go interfaces:

    • database/sql/driver.Valuer and database/sql.Scanner (WKB) for PostGIS database integration.
    • encoding/json.Marshaler and encoding/json.Unmarshaler (GeoJSON).
    • encoding/xml.Marshaler (KML).
    • encoding.BinaryMarshaler and encoding.BinaryUnmarshaler (WKB).
    • encoding.TextMarshaler and encoding.TextUnmarshaler (WKT).
    • encoding/gob.GobEncoder and encoding/gob.GobDecoder (GOB).

    See the PostGIS example for a demonstration of the use of these interfaces.

  • Concurrency-safe. go-geos uses GEOS's threadsafe *_r functions under the hood, with locking to ensure safety, even when used across multiple goroutines. For best performance, use one geos.Context per goroutine.

  • Caching of geometry properties to avoid cgo overhead.

  • Optimized GeoJSON encoder.

  • Automatic finalization of GEOS objects.

Memory management

go-geos objects live mostly on the C heap. go-geos sets finalizers on the objects it creates that free the associated C memory. However, the C heap is not visible to the Go runtime. The can result in significant memory pressure as memory is consumed by large, non-finalized geometries, of which the Go runtime is unaware. Consequently, if it is known that a geometry will no longer be used, it should be explicitly freed by calling its Destroy() method. Periodic calls to runtime.GC() can also help, but the Go runtime makes no guarantees about when or if finalizers will be called.

You can set a function to be called whenever a geometry's finalizer is invoked with the WithGeomFinalizeFunc option to NewContext(). This can be helpful for tracking down geometry leaks.

For more information, see the documentation for runtime.SetFinalizer() and this thread on golang-nuts.

Errors, exceptions, and panics

go-geos uses the stable GEOS C bindings. These bindings catch exceptions from the underlying C++ code and convert them to an integer return code. For normal geometry operations, go-geos panics whenever it encounters a GEOS return code indicating an error, rather than returning an error. Such panics will not occur if go-geos is used correctly. Panics will occur for invalid API calls, out-of-bounds access, or operations on invalid geometries. This behavior is similar to slice access in Go (out-of-bounds accesses panic) and keeps the API fluent. When parsing data, errors are expected so an error is returned.

Comparison with github.com/twpayne/go-geom

github.com/twpayne/go-geom is a pure Go library providing similar functionality to go-geos. The major differences are:

  • go-geos uses GEOS, which is an extremely mature library with a rich feature set.
  • go-geos uses cgo, with all the disadvantages that that entails, notably expensive function call overhead, more complex memory management and trickier cross-compilation.
  • go-geom uses a cache-friendly coordinate layout which is generally faster than GEOS for many operations.

go-geos is a good fit if your program is short-lived (meaning you can ignore memory management), or you require the battle-tested geometry functions provided by GEOS and are willing to handle memory management manually. go-geom is recommended for long-running processes with less stringent geometry function requirements.

License

MIT

Documentation

Overview

Package geos provides an interface to GEOS. See https://trac.osgeo.org/geos/.

Index

Constants

View Source
const (
	VersionMajor = C.GEOS_VERSION_MAJOR
	VersionMinor = C.GEOS_VERSION_MINOR
	VersionPatch = C.GEOS_VERSION_PATCH
)

Version.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bounds

type Bounds struct {
	MinX float64
	MinY float64
	MaxX float64
	MaxY float64
}

A Bounds is a two-dimensional bounds.

func NewBounds added in v0.1.0

func NewBounds(minX, minY, maxX, maxY float64) *Bounds

NewBounds returns a new bounds.

func NewBoundsEmpty

func NewBoundsEmpty() *Bounds

NewBoundsEmpty returns a new empty bounds.

func (*Bounds) Contains

func (b *Bounds) Contains(other *Bounds) bool

Contains returns true if b contains other.

func (*Bounds) ContainsPoint

func (b *Bounds) ContainsPoint(x, y float64) bool

ContainsPoint returns true if b contains the point at x, y.

func (*Bounds) Equals

func (b *Bounds) Equals(other *Bounds) bool

Equals returns true if b equals other.

func (*Bounds) Geom

func (b *Bounds) Geom() *Geom

Geom returns b as a Geom.

func (*Bounds) Height

func (b *Bounds) Height() float64

Height returns the height of b.

func (*Bounds) Intersects

func (b *Bounds) Intersects(other *Bounds) bool

Intersects returns true if b intersects other.

func (*Bounds) IsEmpty

func (b *Bounds) IsEmpty() bool

IsEmpty returns true if b is empty.

func (*Bounds) IsPoint

func (b *Bounds) IsPoint() bool

IsPoint returns true if b is a point.

func (*Bounds) String

func (b *Bounds) String() string

func (*Bounds) Width

func (b *Bounds) Width() float64

Width returns the width of b.

type BufCapStyle added in v0.7.0

type BufCapStyle int
const (
	BufCapStyleRound  BufCapStyle = C.GEOSBUF_CAP_ROUND
	BufCapStyleFlat   BufCapStyle = C.GEOSBUF_CAP_FLAT
	BufCapStyleSquare BufCapStyle = C.GEOSBUF_CAP_SQUARE
)

Buffer cap styles.

type BufJoinStyle added in v0.7.0

type BufJoinStyle int
const (
	BufJoinStyleRound BufJoinStyle = C.GEOSBUF_JOIN_ROUND
	BufJoinStyleMitre BufJoinStyle = C.GEOSBUF_JOIN_MITRE
	BufJoinStyleBevel BufJoinStyle = C.GEOSBUF_JOIN_BEVEL
)

Buffer join styles.

type Context

type Context struct {
	sync.Mutex
	// contains filtered or unexported fields
}

A Context is a context.

func NewContext

func NewContext(options ...ContextOption) *Context

NewContext returns a new Context.

func (*Context) Clone

func (c *Context) Clone(g *Geom) *Geom

Clone clones g into c.

func (*Context) NewCollection

func (c *Context) NewCollection(typeID TypeID, geoms []*Geom) *Geom

NewCollection returns a new collection.

func (*Context) NewCoordSeq

func (c *Context) NewCoordSeq(size, dims int) *CoordSeq

NewCoordSeq returns a new CoordSeq.

func (*Context) NewCoordSeqFromCoords

func (c *Context) NewCoordSeqFromCoords(coords [][]float64) *CoordSeq

NewCoordSeqFromCoords returns a new CoordSeq populated with coords.

func (*Context) NewEmptyCollection

func (c *Context) NewEmptyCollection(typeID TypeID) *Geom

NewEmptyCollection returns a new empty collection.

func (*Context) NewEmptyLineString

func (c *Context) NewEmptyLineString() *Geom

NewEmptyLineString returns a new empty line string.

func (*Context) NewEmptyPoint

func (c *Context) NewEmptyPoint() *Geom

NewEmptyPoint returns a new empty point.

func (*Context) NewEmptyPolygon

func (c *Context) NewEmptyPolygon() *Geom

NewEmptyPolygon returns a new empty polygon.

func (*Context) NewGeomFromBounds

func (c *Context) NewGeomFromBounds(bounds *Bounds) *Geom

NewGeomFromBounds returns a new polygon constructed from bounds.

func (*Context) NewGeomFromGeoJSON added in v0.4.0

func (c *Context) NewGeomFromGeoJSON(geoJSON string) (*Geom, error)

NewGeomFromGeoJSON returns a new geometry in JSON format from json.

func (*Context) NewGeomFromWKB

func (c *Context) NewGeomFromWKB(wkb []byte) (*Geom, error)

NewGeomFromWKB parses a geometry in WKB format from wkb.

func (*Context) NewGeomFromWKT

func (c *Context) NewGeomFromWKT(wkt string) (*Geom, error)

NewGeomFromWKT parses a geometry in WKT format from wkt.

func (*Context) NewLineString

func (c *Context) NewLineString(coords [][]float64) *Geom

NewLineString returns a new line string populated with coords.

func (*Context) NewLinearRing

func (c *Context) NewLinearRing(coords [][]float64) *Geom

NewLinearRing returns a new linear ring populated with coords.

func (*Context) NewPoint

func (c *Context) NewPoint(coord []float64) *Geom

NewPoint returns a new point populated with coord.

func (*Context) NewPoints added in v0.3.0

func (c *Context) NewPoints(coords [][]float64) []*Geom

NewPoints returns a new slice of points populated from coords.

func (*Context) NewPolygon

func (c *Context) NewPolygon(coordss [][][]float64) *Geom

NewPolygon returns a new point populated with coordss.

type ContextOption added in v0.1.0

type ContextOption func(*Context)

A ContextOption sets an option on a Context.

func WithGeomFinalizeFunc added in v0.1.0

func WithGeomFinalizeFunc(geomFinalizeFunc func(*Geom)) ContextOption

WithGeomFinalizeFunc sets a function to be called just before a geometry is finalized. This is typically used to log the geometry to help debug geometry leaks.

type CoordSeq

type CoordSeq struct {
	// contains filtered or unexported fields
}

A CoordSeq is a coordinate sequence.

func NewCoordSeq

func NewCoordSeq(size, dims int) *CoordSeq

NewCoordSeq returns a new CoordSeq.

func NewCoordSeqFromCoords

func NewCoordSeqFromCoords(coords [][]float64) *CoordSeq

NewCoordSeqFromCoords returns a new CoordSeq populated with coords.

func (*CoordSeq) Clone

func (s *CoordSeq) Clone() *CoordSeq

Clone returns a clone of s.

func (*CoordSeq) Dimensions

func (s *CoordSeq) Dimensions() int

Dimensions returns the dimensions of s.

func (*CoordSeq) Ordinate

func (s *CoordSeq) Ordinate(idx, dim int) float64

Ordinate returns the idx-th dim coordinate of s.

func (*CoordSeq) SetOrdinate

func (s *CoordSeq) SetOrdinate(idx, dim int, val float64)

SetOrdinate sets the idx-th dim coordinate of s to val.

func (*CoordSeq) SetX

func (s *CoordSeq) SetX(idx int, val float64)

SetX sets the idx-th X coordinate of s to val.

func (*CoordSeq) SetY

func (s *CoordSeq) SetY(idx int, val float64)

SetY sets the idx-th Y coordinate of s to val.

func (*CoordSeq) SetZ

func (s *CoordSeq) SetZ(idx int, val float64)

SetZ sets the idx-th Z coordinate of s to val.

func (*CoordSeq) Size

func (s *CoordSeq) Size() int

Size returns the size of s.

func (*CoordSeq) ToCoords

func (s *CoordSeq) ToCoords() [][]float64

ToCoords returns s as a [][]float64.

func (*CoordSeq) X

func (s *CoordSeq) X(idx int) float64

X returns the idx-th X coordinate of s.

func (*CoordSeq) Y

func (s *CoordSeq) Y(idx int) float64

Y returns the idx-th Y coordinate of s.

func (*CoordSeq) Z

func (s *CoordSeq) Z(idx int) float64

Z returns the idx-th Z coordinate of s.

type Error

type Error string

An Error is an error returned by GEOS.

func (Error) Error

func (e Error) Error() string

type Geom

type Geom struct {
	// contains filtered or unexported fields
}

A Geom is a geometry.

func Clone

func Clone(g *Geom) *Geom

Clone clones g into c.

func NewCollection

func NewCollection(typeID TypeID, geoms []*Geom) *Geom

NewCollection returns a new collection.

func NewEmptyCollection

func NewEmptyCollection(typeID TypeID) *Geom

NewEmptyCollection returns a new empty collection.

func NewEmptyLineString

func NewEmptyLineString() *Geom

NewEmptyLineString returns a new empty line string.

func NewEmptyPoint

func NewEmptyPoint() *Geom

NewEmptyPoint returns a new empty point.

func NewEmptyPolygon

func NewEmptyPolygon() *Geom

NewEmptyPolygon returns a new empty polygon.

func NewGeomFromBounds

func NewGeomFromBounds(bounds *Bounds) *Geom

NewGeomFromBounds returns a new polygon populated with bounds.

func NewGeomFromGeoJSON added in v0.4.0

func NewGeomFromGeoJSON(geoJSON string) (*Geom, error)

NewGEOMFromGeoJSON parses a geometry in GeoJSON format from geoJSON.

func NewGeomFromWKB

func NewGeomFromWKB(wkb []byte) (*Geom, error)

NewGeomFromWKB parses a geometry in WKB format from wkb.

func NewGeomFromWKT

func NewGeomFromWKT(wkt string) (*Geom, error)

NewGeomFromWKT parses a geometry in WKT format from wkt.

func NewLineString

func NewLineString(coords [][]float64) *Geom

NewLineString returns a new line string populated with coords.

func NewLinearRing

func NewLinearRing(coords [][]float64) *Geom

NewLinearRing returns a new linear ring populated with coords.

func NewPoint

func NewPoint(coord []float64) *Geom

NewPoint returns a new point populated with coord.

func NewPolygon

func NewPolygon(coordss [][][]float64) *Geom

NewPolygon returns a new point populated with coordss.

func (*Geom) Area added in v0.4.0

func (g *Geom) Area() float64

Area returns g's area.

func (*Geom) Bounds

func (g *Geom) Bounds() *Bounds

Bounds returns g's bounds.

func (*Geom) Buffer added in v0.4.0

func (g *Geom) Buffer(width float64, quadsegs int) *Geom

func (*Geom) BufferWithStyle added in v0.7.0

func (g *Geom) BufferWithStyle(width float64, quadsegs int, endCapStyle BufCapStyle, joinStyle BufJoinStyle, mitreLimit float64) *Geom

BufferWithStyle returns a buffer using the provided style parameters.

func (*Geom) Clone

func (g *Geom) Clone() *Geom

Clone returns a clone of g.

func (*Geom) ConcaveHull added in v0.7.0

func (g *Geom) ConcaveHull(ratio float64, allowHoles uint) *Geom

func (*Geom) Contains

func (g *Geom) Contains(other *Geom) bool

Contains returns true if g contains other.

func (*Geom) ConvexHull

func (g *Geom) ConvexHull() *Geom

ConvexHull returns g's convex hull.

func (*Geom) CoordSeq

func (g *Geom) CoordSeq() *CoordSeq

CoordSeq returns g's coordinate sequence.

func (*Geom) CoveredBy

func (g *Geom) CoveredBy(other *Geom) bool

CoveredBy returns true if g is covered by other.

func (*Geom) Covers

func (g *Geom) Covers(other *Geom) bool

Covers returns true if g covers other.

func (*Geom) Crosses

func (g *Geom) Crosses(other *Geom) bool

Crosses returns true if g crosses other.

func (*Geom) Densify added in v0.4.0

func (g *Geom) Densify(tolerance float64) *Geom

func (*Geom) Destroy

func (g *Geom) Destroy()

Destroy destroys g and releases all resources it holds.

func (*Geom) Difference added in v0.6.0

func (g *Geom) Difference(other *Geom) *Geom

Difference returns the difference between g and other.

func (*Geom) DifferencePrec added in v0.6.0

func (g *Geom) DifferencePrec(other *Geom, gridSize float64) *Geom

DifferencePrec returns the difference between g and other.

func (*Geom) Disjoint

func (g *Geom) Disjoint(other *Geom) bool

Disjoint returns true if g is disjoint from other.

func (*Geom) Distance added in v0.3.0

func (g *Geom) Distance(other *Geom) float64

Distance returns the distance between the closes points on g and other.

func (*Geom) DistanceIndexed added in v0.5.0

func (g *Geom) DistanceIndexed(other *Geom) float64

DistanceIndexed returns the distance between g and other, using the indexed facet distance.

func (*Geom) DistanceWithin added in v0.5.0

func (g *Geom) DistanceWithin(other *Geom, dist float64) bool

DistanceWithin returns whether the distance between g and other is within the given dist.

func (*Geom) Envelope

func (g *Geom) Envelope() *Geom

Envelope returns the envelope of g.

func (*Geom) Equals

func (g *Geom) Equals(other *Geom) bool

Equals returns true if g equals other.

func (*Geom) EqualsExact

func (g *Geom) EqualsExact(other *Geom, tolerance float64) bool

EqualsExact returns true if g equals other exactly.

func (*Geom) ExteriorRing

func (g *Geom) ExteriorRing() *Geom

ExteriorRing returns the exterior ring.

func (*Geom) FrechetDistance added in v0.5.0

func (g *Geom) FrechetDistance(other *Geom) float64

FrechetDistance returns the Fréchet distance between g and other.

func (*Geom) FrechetDistanceDensify added in v0.5.0

func (g *Geom) FrechetDistanceDensify(other *Geom, densifyFrac float64) float64

FrechetDistanceDensify returns the Fréchet distance between g and other.

func (*Geom) Geometry

func (g *Geom) Geometry(n int) *Geom

Geometry returns the nth geometry of g.

func (*Geom) HausdorffDistance added in v0.5.0

func (g *Geom) HausdorffDistance(other *Geom) float64

HausdorffDistance returns the Hausdorff distance between g and other.

func (*Geom) HausdorffDistanceDensify added in v0.5.0

func (g *Geom) HausdorffDistanceDensify(other *Geom, densifyFrac float64) float64

HausdorffDistanceDensify returns the Hausdorff distance between g and other.

func (*Geom) InteriorRing

func (g *Geom) InteriorRing(n int) *Geom

InteriorRing returns the nth interior ring.

func (*Geom) Interpolate added in v0.7.0

func (g *Geom) Interpolate(d float64) *Geom

Interpolate returns a point distance d from the start of g, which must be a linestring.

func (*Geom) InterpolateNormalized added in v0.7.0

func (g *Geom) InterpolateNormalized(proportion float64) *Geom

InterpolateNormalized returns the point that is at proportion from the start.

func (*Geom) Intersection

func (g *Geom) Intersection(other *Geom) *Geom

func (*Geom) IntersectionPrec added in v0.7.0

func (g *Geom) IntersectionPrec(other *Geom, gridSize float64) *Geom

func (*Geom) Intersects

func (g *Geom) Intersects(other *Geom) bool

Intersects returns true if g intersects other.

func (*Geom) IsClosed

func (g *Geom) IsClosed() bool

IsClosed returns true if g is closed.

func (*Geom) IsEmpty

func (g *Geom) IsEmpty() bool

IsEmpty returns true if g is empty.

func (*Geom) IsRing

func (g *Geom) IsRing() bool

IsRing returns true if g is a ring.

func (*Geom) IsSimple

func (g *Geom) IsSimple() bool

IsSimple returns true if g is simple.

func (*Geom) IsValid

func (g *Geom) IsValid() bool

IsValid returns true if g is valid.

func (*Geom) IsValidReason

func (g *Geom) IsValidReason() string

IsValidReason returns the reason that g is invalid.

func (*Geom) Length added in v0.4.0

func (g *Geom) Length() float64

Length returns g's length.

func (*Geom) MakeValid added in v0.8.0

func (g *Geom) MakeValid() *Geom

MakeValid repair an invalid geometry, returning a valid output.

func (*Geom) MaximumInscribedCircle added in v0.7.0

func (g *Geom) MaximumInscribedCircle(tolerance float64) *Geom

func (*Geom) MinimumRotatedRectangle added in v0.7.0

func (g *Geom) MinimumRotatedRectangle() *Geom

func (*Geom) MinimumWidth added in v0.4.0

func (g *Geom) MinimumWidth() *Geom

MinimumWidth returns a linestring geometry which represents the minimum diameter of g.

func (*Geom) NearestPoints added in v0.3.0

func (g *Geom) NearestPoints(other *Geom) [][]float64

NearestPoints returns the nearest coordinates of g and other. If the nearest coordinates do not exist (e.g., when either geom is empty), it returns nil.

func (*Geom) NumGeometries

func (g *Geom) NumGeometries() int

NumGeometries returns the number of geometries in g.

func (*Geom) NumInteriorRings

func (g *Geom) NumInteriorRings() int

NumInteriorRings returns the number of interior rings in g.

func (*Geom) NumPoints

func (g *Geom) NumPoints() int

NumPoints returns the number of points in g.

func (*Geom) OffsetCurve added in v0.7.0

func (g *Geom) OffsetCurve(width float64, quadsegs int, joinStyle BufJoinStyle, mitreLimit float64) *Geom

func (*Geom) Overlaps

func (g *Geom) Overlaps(other *Geom) bool

Overlaps returns true if g overlaps other.

func (*Geom) Point

func (g *Geom) Point(n int) *Geom

Point returns the g's nth point.

func (*Geom) Prepare

func (g *Geom) Prepare() *PrepGeom

Prepare prepares g.

func (*Geom) SRID

func (g *Geom) SRID() int

SRID returns g's SRID.

func (*Geom) SetPrecision added in v0.8.0

func (g *Geom) SetPrecision(gridSize float64, flags PrecisionRule) *Geom

func (*Geom) SetSRID

func (g *Geom) SetSRID(srid int) *Geom

SetSRID sets g's SRID to srid.

func (*Geom) Simplify added in v0.8.0

func (g *Geom) Simplify(tolerance float64) *Geom

Simplify returns a simplified geometry.

func (*Geom) String

func (g *Geom) String() string

String returns g in WKT format.

func (*Geom) SymDifference added in v0.7.0

func (g *Geom) SymDifference(other *Geom) *Geom

func (*Geom) ToGeoJSON added in v0.4.0

func (g *Geom) ToGeoJSON(indent int) string

ToGeoJSON returns g in GeoJSON format.

func (*Geom) ToWKB

func (g *Geom) ToWKB() []byte

ToWKB returns g in WKB format.

func (*Geom) ToWKT

func (g *Geom) ToWKT() string

ToWKT returns g in WKT format.

func (*Geom) TopologyPreserveSimplify added in v0.8.0

func (g *Geom) TopologyPreserveSimplify(tolerance float64) *Geom

TopologyPreserveSimplify returns a simplified geometry preserving topology.

func (*Geom) Touches

func (g *Geom) Touches(other *Geom) bool

Touches returns true if g touches other.

func (*Geom) Type

func (g *Geom) Type() string

Type returns g's type.

func (*Geom) TypeID

func (g *Geom) TypeID() TypeID

TypeID returns g's geometry type id.

func (*Geom) UnaryUnion added in v0.4.0

func (g *Geom) UnaryUnion() *Geom

UnaryUnion returns the union of all components of a single geometry.

func (*Geom) Within

func (g *Geom) Within(other *Geom) bool

Within returns true if g is within other.

func (*Geom) X

func (g *Geom) X() float64

X returns g's X coordinate.

func (*Geom) Y

func (g *Geom) Y() float64

Y returns g's Y coordinate.

type PrecisionRule added in v0.8.0

type PrecisionRule int
const (
	PrecisionRuleValidOutput   PrecisionRule = C.GEOS_PREC_VALID_OUTPUT
	PrecisionRulePointwise     PrecisionRule = C.GEOS_PREC_NO_TOPO
	PrecisionRuleKeepCollapsed PrecisionRule = C.GEOS_PREC_KEEP_COLLAPSED
)

Precision rules.

type PrepGeom

type PrepGeom struct {
	// contains filtered or unexported fields
}

A PrepGeom is a prepared geometry.

func (*PrepGeom) Contains

func (pg *PrepGeom) Contains(g *Geom) bool

Contains returns if pg contains g.

func (*PrepGeom) ContainsProperly

func (pg *PrepGeom) ContainsProperly(g *Geom) bool

ContainsProperly returns if pg contains g properly.

func (*PrepGeom) CoveredBy

func (pg *PrepGeom) CoveredBy(g *Geom) bool

CoveredBy returns if pg is covered by g.

func (*PrepGeom) Covers

func (pg *PrepGeom) Covers(g *Geom) bool

Covers returns if pg covers g.

func (*PrepGeom) Crosses

func (pg *PrepGeom) Crosses(g *Geom) bool

Crosses returns if pg crosses g.

func (*PrepGeom) Disjoint

func (pg *PrepGeom) Disjoint(g *Geom) bool

Disjoint returns if pg is disjoint from g.

func (*PrepGeom) Intersects

func (pg *PrepGeom) Intersects(g *Geom) bool

Intersects returns if pg contains g.

func (*PrepGeom) Overlaps

func (pg *PrepGeom) Overlaps(g *Geom) bool

Overlaps returns if pg overlaps g.

func (*PrepGeom) Touches

func (pg *PrepGeom) Touches(g *Geom) bool

Touches returns if pg contains g.

func (*PrepGeom) Within

func (pg *PrepGeom) Within(g *Geom) bool

Within returns if pg is within g.

type TypeID added in v0.7.0

type TypeID int

A TypeID is a geometry type id.

const (
	TypeIDPoint              TypeID = C.GEOS_POINT
	TypeIDLineString         TypeID = C.GEOS_LINESTRING
	TypeIDLinearRing         TypeID = C.GEOS_LINEARRING
	TypeIDPolygon            TypeID = C.GEOS_POLYGON
	TypeIDMultiPoint         TypeID = C.GEOS_MULTIPOINT
	TypeIDMultiLineString    TypeID = C.GEOS_MULTILINESTRING
	TypeIDMultiPolygon       TypeID = C.GEOS_MULTIPOLYGON
	TypeIDGeometryCollection TypeID = C.GEOS_GEOMETRYCOLLECTION
)

Geometry type ids.

Directories

Path Synopsis
examples
internal

Jump to

Keyboard shortcuts

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