Documentation
¶
Overview ¶
Package geom is a geometry library in Go.
It provides definition of basic geometry structures (Point, LineString, Polygon), including Z, M and ZM variants. MultiGeometry and Geometry collections are also provided.
Index ¶
- type Envelope
- type EnvelopeM
- type EnvelopeZ
- type EnvelopeZM
- type Geometry
- type GeometryCollection
- type GeometryCollectionM
- type GeometryCollectionZ
- type GeometryCollectionZM
- func (c GeometryCollectionZM) Clone() Geometry
- func (c GeometryCollectionZM) Envelope() *Envelope
- func (c GeometryCollectionZM) EnvelopeM() *EnvelopeM
- func (c GeometryCollectionZM) EnvelopeZ() *EnvelopeZ
- func (c GeometryCollectionZM) EnvelopeZM() *EnvelopeZM
- func (c GeometryCollectionZM) Iterate(f func([]Point) error) error
- type GeometryM
- type GeometryZ
- type GeometryZM
- type LineString
- type LineStringM
- type LineStringZ
- type LineStringZM
- type MultiLineString
- type MultiLineStringM
- type MultiLineStringZ
- type MultiLineStringZM
- func (c MultiLineStringZM) Clone() Geometry
- func (c MultiLineStringZM) Envelope() *Envelope
- func (c MultiLineStringZM) EnvelopeM() *EnvelopeM
- func (c MultiLineStringZM) EnvelopeZ() *EnvelopeZ
- func (c MultiLineStringZM) EnvelopeZM() *EnvelopeZM
- func (c MultiLineStringZM) Iterate(f func([]Point) error) error
- type MultiPoint
- type MultiPointM
- type MultiPointZ
- type MultiPointZM
- type MultiPolygon
- type MultiPolygonM
- type MultiPolygonZ
- type MultiPolygonZM
- type Point
- type PointM
- type PointZ
- type PointZM
- type Polygon
- type PolygonM
- type PolygonZ
- type PolygonZM
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Envelope ¶
type Envelope struct {
Min, Max Point
}
Envelope represents a two-dimensional rectangular region
func NewEnvelopeFromPoint ¶
NewEnvelopeFromPoint returns a new envelope containing a single point
func (*Envelope) Extend ¶
Extend extends the envelope with the givent envelope and returns the modified envelope
func (*Envelope) ExtendPoint ¶
ExtendPoint extends the envelope with the givent point and returns the modified envelope
type EnvelopeM ¶
type EnvelopeM struct {
Min, Max PointM
}
EnvelopeM represents a two-dimensional rectangular region, with M values
func NewEnvelopeMFromPoint ¶
NewEnvelopeMFromPoint returns a new envelope containing a single point
func (*EnvelopeM) Extend ¶
Extend extends the envelope with the givent envelope and returns the modified envelope
func (*EnvelopeM) ExtendPoint ¶
ExtendPoint extends the envelope with the givent point and returns the modified envelope
type EnvelopeZ ¶
type EnvelopeZ struct {
Min, Max PointZ
}
EnvelopeZ represents a three-dimensional rectangular region
func NewEnvelopeZFromPoint ¶
NewEnvelopeZFromPoint returns a new envelope containing a single point
func (*EnvelopeZ) Extend ¶
Extend extends the envelope with the givent envelope and returns the modified envelope
func (*EnvelopeZ) ExtendPoint ¶
ExtendPoint extends the envelope with the givent point and returns the modified envelope
type EnvelopeZM ¶
type EnvelopeZM struct {
Min, Max PointZM
}
EnvelopeZM represents a three-dimensional rectangular region, with M values
func NewEnvelopeZMFromPoint ¶
func NewEnvelopeZMFromPoint(pt PointZM) *EnvelopeZM
NewEnvelopeZMFromPoint returns a new envelope containing a single point
func (*EnvelopeZM) Extend ¶
func (e *EnvelopeZM) Extend(other *EnvelopeZM) *EnvelopeZM
Extend extends the envelope with the givent envelope and returns the modified envelope
func (*EnvelopeZM) ExtendPoint ¶
func (e *EnvelopeZM) ExtendPoint(pt PointZM) *EnvelopeZM
ExtendPoint extends the envelope with the givent point and returns the modified envelope
type Geometry ¶
type Geometry interface { Envelope() *Envelope Clone() Geometry Iterate(f func([]Point) error) error //The iterate function can modify Point in place }
Geometry represents a geometry object
type GeometryCollection ¶
type GeometryCollection []Geometry
GeometryCollection is a collection of two-dimensional geometries
func (GeometryCollection) Clone ¶
func (c GeometryCollection) Clone() Geometry
Clone returns a deep copy of the geometry collection
func (GeometryCollection) Envelope ¶
func (c GeometryCollection) Envelope() *Envelope
Envelope returns an envelope around the GeometryCollection
type GeometryCollectionM ¶
type GeometryCollectionM []GeometryM
GeometryCollectionM is a collection of two-dimensional geometries, with an additional value defined on each vertex
func (GeometryCollectionM) Clone ¶
func (c GeometryCollectionM) Clone() Geometry
Clone returns a deep copy of the geometry collection
func (GeometryCollectionM) Envelope ¶
func (c GeometryCollectionM) Envelope() *Envelope
Envelope returns an envelope around the geometry collection
func (GeometryCollectionM) EnvelopeM ¶
func (c GeometryCollectionM) EnvelopeM() *EnvelopeM
EnvelopeM returns an envelope around the geometry collection
type GeometryCollectionZ ¶
type GeometryCollectionZ []GeometryZ
GeometryCollectionZ is a collection of three-dimensional geometries
func (GeometryCollectionZ) Clone ¶
func (c GeometryCollectionZ) Clone() Geometry
Clone returns a deep copy of the geometry collection
func (GeometryCollectionZ) Envelope ¶
func (c GeometryCollectionZ) Envelope() *Envelope
Envelope returns an envelope around the geometry collection
func (GeometryCollectionZ) EnvelopeZ ¶
func (c GeometryCollectionZ) EnvelopeZ() *EnvelopeZ
EnvelopeZ returns an envelope around the geometry collection
type GeometryCollectionZM ¶
type GeometryCollectionZM []GeometryZM
GeometryCollectionZM is a collection of three-dimensional geometries, with an additional value defined on each vertex
func (GeometryCollectionZM) Clone ¶
func (c GeometryCollectionZM) Clone() Geometry
Clone returns a deep copy of the geometry collection
func (GeometryCollectionZM) Envelope ¶
func (c GeometryCollectionZM) Envelope() *Envelope
Envelope returns an envelope around the geometry collection
func (GeometryCollectionZM) EnvelopeM ¶
func (c GeometryCollectionZM) EnvelopeM() *EnvelopeM
EnvelopeM returns an envelope around the geometry collection
func (GeometryCollectionZM) EnvelopeZ ¶
func (c GeometryCollectionZM) EnvelopeZ() *EnvelopeZ
EnvelopeZ returns an envelope around the geometry collection
func (GeometryCollectionZM) EnvelopeZM ¶
func (c GeometryCollectionZM) EnvelopeZM() *EnvelopeZM
EnvelopeZM returns an envelope around the GeometryCollection
type GeometryM ¶
GeometryM represents a geometry object, with an additional value defined on each vertex
type GeometryZM ¶
type GeometryZM interface { GeometryZ //Duplication of methods of GeometryM because we can not embed it directly (kind of diamond inheritance problem) EnvelopeM() *EnvelopeM EnvelopeZM() *EnvelopeZM }
GeometryZM represents a three-dimensional geometry object, with an additional value defined on each vertex
type LineString ¶
type LineString []Point
LineString is a two-dimensional geometry representing a multi-vertex line
func (LineString) Clone ¶
func (l LineString) Clone() Geometry
Clone returns a deep copy of the line
func (LineString) Envelope ¶
func (l LineString) Envelope() *Envelope
Envelope returns an envelope around the line
type LineStringM ¶
type LineStringM []PointM
LineStringM is a two-dimensional geometry representing a multi-vertex line, with an additional value defined on each vertex
func (LineStringM) Clone ¶
func (l LineStringM) Clone() Geometry
Clone returns a deep copy of the line
func (LineStringM) Envelope ¶
func (l LineStringM) Envelope() *Envelope
Envelope returns an envelope around the line
func (LineStringM) EnvelopeM ¶
func (l LineStringM) EnvelopeM() *EnvelopeM
EnvelopeM returns an envelope around the line
type LineStringZ ¶
type LineStringZ []PointZ
LineStringZ is a three-dimensional geometry representing a multi-vertex line
func (LineStringZ) Clone ¶
func (l LineStringZ) Clone() Geometry
Clone returns a deep copy of the line
func (LineStringZ) Envelope ¶
func (l LineStringZ) Envelope() *Envelope
Envelope returns an envelope around the line
func (LineStringZ) EnvelopeZ ¶
func (l LineStringZ) EnvelopeZ() *EnvelopeZ
EnvelopeZ returns an envelope around the line
type LineStringZM ¶
type LineStringZM []PointZM
LineStringZM is a three-dimensional geometry representing a multi-vertex line, with an additional value defined on each vertex
func (LineStringZM) Clone ¶
func (l LineStringZM) Clone() Geometry
Clone returns a deep copy of the line
func (LineStringZM) Envelope ¶
func (l LineStringZM) Envelope() *Envelope
Envelope returns an envelope around the line
func (LineStringZM) EnvelopeM ¶
func (l LineStringZM) EnvelopeM() *EnvelopeM
EnvelopeM returns an envelope around the line
func (LineStringZM) EnvelopeZ ¶
func (l LineStringZM) EnvelopeZ() *EnvelopeZ
EnvelopeZ returns an envelope around the line
func (LineStringZM) EnvelopeZM ¶
func (l LineStringZM) EnvelopeZM() *EnvelopeZM
EnvelopeZM returns an envelope around the line
type MultiLineString ¶
type MultiLineString []LineString
MultiLineString is a collection of two-dimensional geometries representing multi-vertex lines
func (MultiLineString) Clone ¶
func (c MultiLineString) Clone() Geometry
Clone returns a deep copy of the multi-linestring
func (MultiLineString) Envelope ¶
func (c MultiLineString) Envelope() *Envelope
Envelope returns an envelope around the GeometryCollection
type MultiLineStringM ¶
type MultiLineStringM []LineStringM
MultiLineStringM is a collection of two-dimensional geometries representing multi-vertex lines, with an additional value defined on each vertex
func (MultiLineStringM) Clone ¶
func (c MultiLineStringM) Clone() Geometry
Clone returns a deep copy of the multi-linestring
func (MultiLineStringM) Envelope ¶
func (c MultiLineStringM) Envelope() *Envelope
Envelope returns an envelope around the GeometryCollection
func (MultiLineStringM) EnvelopeM ¶
func (c MultiLineStringM) EnvelopeM() *EnvelopeM
EnvelopeM returns an envelope around the GeometryCollection
type MultiLineStringZ ¶
type MultiLineStringZ []LineStringZ
MultiLineStringZ is a collection of three-dimensional geometries representing multi-vertex lines
func (MultiLineStringZ) Clone ¶
func (c MultiLineStringZ) Clone() Geometry
Clone returns a deep copy of the multi-linestring
func (MultiLineStringZ) Envelope ¶
func (c MultiLineStringZ) Envelope() *Envelope
Envelope returns an envelope around the GeometryCollection
func (MultiLineStringZ) EnvelopeZ ¶
func (c MultiLineStringZ) EnvelopeZ() *EnvelopeZ
EnvelopeZ returns an envelope around the GeometryCollection
type MultiLineStringZM ¶
type MultiLineStringZM []LineStringZM
MultiLineStringZM is a collection of three-dimensional geometries representing multi-vertex lines, with an additional value defined on each vertex
func (MultiLineStringZM) Clone ¶
func (c MultiLineStringZM) Clone() Geometry
Clone returns a deep copy of the multi-linestring
func (MultiLineStringZM) Envelope ¶
func (c MultiLineStringZM) Envelope() *Envelope
Envelope returns an envelope around the GeometryCollection
func (MultiLineStringZM) EnvelopeM ¶
func (c MultiLineStringZM) EnvelopeM() *EnvelopeM
EnvelopeM returns an envelope around the GeometryCollection
func (MultiLineStringZM) EnvelopeZ ¶
func (c MultiLineStringZM) EnvelopeZ() *EnvelopeZ
EnvelopeZ returns an envelope around the GeometryCollection
func (MultiLineStringZM) EnvelopeZM ¶
func (c MultiLineStringZM) EnvelopeZM() *EnvelopeZM
EnvelopeZM returns an envelope around the GeometryCollection
type MultiPoint ¶
type MultiPoint []Point
MultiPoint is a collection of two-dimensional geometries representing points
func (MultiPoint) Clone ¶
func (c MultiPoint) Clone() Geometry
Clone returns a deep copy of the multi-point
func (MultiPoint) Envelope ¶
func (c MultiPoint) Envelope() *Envelope
Envelope returns an envelope around the multi-point
type MultiPointM ¶
type MultiPointM []PointM
MultiPointM is a collection of two-dimensional geometries representing points, with an additional value defined on each point
func (MultiPointM) Clone ¶
func (c MultiPointM) Clone() Geometry
Clone returns a deep copy of the multi-point
func (MultiPointM) Envelope ¶
func (c MultiPointM) Envelope() *Envelope
Envelope returns an envelope around the multi-point
func (MultiPointM) EnvelopeM ¶
func (c MultiPointM) EnvelopeM() *EnvelopeM
EnvelopeM returns an envelope around the multi-point
type MultiPointZ ¶
type MultiPointZ []PointZ
MultiPointZ is a collection of three-dimensional geometries representing points
func (MultiPointZ) Clone ¶
func (c MultiPointZ) Clone() Geometry
Clone returns a deep copy of the multi-point
func (MultiPointZ) Envelope ¶
func (c MultiPointZ) Envelope() *Envelope
Envelope returns an envelope around the multi-point
func (MultiPointZ) EnvelopeZ ¶
func (c MultiPointZ) EnvelopeZ() *EnvelopeZ
EnvelopeZ returns an envelope around the multi-point
type MultiPointZM ¶
type MultiPointZM []PointZM
MultiPointZM is a collection of three-dimensional geometries representing points, with an additional value defined on each point
func (MultiPointZM) Clone ¶
func (c MultiPointZM) Clone() Geometry
Clone returns a deep copy of the multi-point
func (MultiPointZM) Envelope ¶
func (c MultiPointZM) Envelope() *Envelope
Envelope returns an envelope around the multi-point
func (MultiPointZM) EnvelopeM ¶
func (c MultiPointZM) EnvelopeM() *EnvelopeM
EnvelopeM returns an envelope around the multi-point
func (MultiPointZM) EnvelopeZ ¶
func (c MultiPointZM) EnvelopeZ() *EnvelopeZ
EnvelopeZ returns an envelope around the multi-point
func (MultiPointZM) EnvelopeZM ¶
func (c MultiPointZM) EnvelopeZM() *EnvelopeZM
EnvelopeZM returns an envelope around the multi-point
type MultiPolygon ¶
type MultiPolygon []Polygon
MultiPolygon is a collection of two-dimensional geometries representing polygons
func (MultiPolygon) Clone ¶
func (c MultiPolygon) Clone() Geometry
Clone returns a deep copy of the multi-polygon
func (MultiPolygon) Envelope ¶
func (c MultiPolygon) Envelope() *Envelope
Envelope returns an envelope around the GeometryCollection
type MultiPolygonM ¶
type MultiPolygonM []PolygonM
MultiPolygonM is a collection of two-dimensional geometries representing polygons, with an additional value defined on each vertex
func (MultiPolygonM) Clone ¶
func (c MultiPolygonM) Clone() Geometry
Clone returns a deep copy of the multi-polygon
func (MultiPolygonM) Envelope ¶
func (c MultiPolygonM) Envelope() *Envelope
Envelope returns an envelope around the GeometryCollection
func (MultiPolygonM) EnvelopeM ¶
func (c MultiPolygonM) EnvelopeM() *EnvelopeM
EnvelopeM returns an envelope around the GeometryCollection
type MultiPolygonZ ¶
type MultiPolygonZ []PolygonZ
MultiPolygonZ is a collection of three-dimensional geometries representing polygons
func (MultiPolygonZ) Clone ¶
func (c MultiPolygonZ) Clone() Geometry
Clone returns a deep copy of the multi-polygon
func (MultiPolygonZ) Envelope ¶
func (c MultiPolygonZ) Envelope() *Envelope
Envelope returns an envelope around the GeometryCollection
func (MultiPolygonZ) EnvelopeZ ¶
func (c MultiPolygonZ) EnvelopeZ() *EnvelopeZ
EnvelopeZ returns an envelope around the GeometryCollection
type MultiPolygonZM ¶
type MultiPolygonZM []PolygonZM
MultiPolygonZM is a collection of three-dimensional geometries representing polygons, with an additional value defined on each vertex
func (MultiPolygonZM) Clone ¶
func (c MultiPolygonZM) Clone() Geometry
Clone returns a deep copy of the multi-polygon
func (MultiPolygonZM) Envelope ¶
func (c MultiPolygonZM) Envelope() *Envelope
Envelope returns an envelope around the GeometryCollection
func (MultiPolygonZM) EnvelopeM ¶
func (c MultiPolygonZM) EnvelopeM() *EnvelopeM
EnvelopeM returns an envelope around the GeometryCollection
func (MultiPolygonZM) EnvelopeZ ¶
func (c MultiPolygonZM) EnvelopeZ() *EnvelopeZ
EnvelopeZ returns an envelope around the GeometryCollection
func (MultiPolygonZM) EnvelopeZM ¶
func (c MultiPolygonZM) EnvelopeZM() *EnvelopeZM
EnvelopeZM returns an envelope around the GeometryCollection
type Point ¶
Point is a two-dimensional geometry representing a point
type PointZM ¶
PointZM is a three-dimensional geometry representing a point, with an additionnal value
func (PointZM) EnvelopeZM ¶
func (pt PointZM) EnvelopeZM() *EnvelopeZM
EnvelopeZM returns an envelope around the point
type Polygon ¶
type Polygon []LineString
Polygon is a two-dimensional geometry representing a polygon
type PolygonM ¶
type PolygonM []LineStringM
PolygonM is a two-dimensional geometry representing a polygon, with an additional value defined on each vertex
type PolygonZ ¶
type PolygonZ []LineStringZ
PolygonZ is a three-dimensional geometry representing a polygon
type PolygonZM ¶
type PolygonZM []LineStringZM
PolygonZM is a three-dimensional geometry representing a polygon, with an additional value defined on each vertex
func (PolygonZM) EnvelopeZM ¶
func (p PolygonZM) EnvelopeZM() *EnvelopeZM
EnvelopeZM returns an envelope around the polygon
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
encoding
|
|
geojson
Package geojson implements decoding of GeoJSON objects as defined at http://geojson.org/.
|
Package geojson implements decoding of GeoJSON objects as defined at http://geojson.org/. |
wkb
Package wkb implements decoding of WKB objects as defined in OGC 06-103r4.
|
Package wkb implements decoding of WKB objects as defined in OGC 06-103r4. |