Documentation ¶
Index ¶
- Constants
- func ApplyToPoints(geometry geom.Geometry, f func(coords ...float64) ([]float64, error)) (geom.Geometry, error)
- func CloneGeometry(geometry geom.Geometry) (geom.Geometry, error)
- func DefaultPointDecorator(pt Point) string
- func FromWebMercator(SRID uint64, geometry geom.Geometry) (geom.Geometry, error)
- func ToWebMercator(SRID uint64, geometry geom.Geometry) (geom.Geometry, error)
- type Collection
- type G
- type Geometry
- type Line
- func CloneLine(line tegola.LineString) (l Line)
- func NewLine(pointPairs ...float64) Line
- func NewLineFrom2Float64(points ...[2]float64) (l Line)
- func NewLineFromPt(points ...maths.Pt) Line
- func NewLineFromSubPoints(points ...tegola.Point) (l Line)
- func NewLineTruncatedFromPt(points ...maths.Pt) Line
- func (l Line) AsGeomLineString() (ln [][2]float64)
- func (l Line) AsPts() []maths.Pt
- func (l Line) Contains(pt Point) bool
- func (l Line) ContainsLine(ln Line) bool
- func (l Line) Direction() maths.WindingOrder
- func (l Line) GoString() string
- func (l Line) GoStringTypeDecorated(withType bool, indent int, lineComment string, ...) string
- func (l Line) GoStringTyped(withType bool, indent int, lineComment string) string
- func (l Line) IsValid() bool
- func (l Line) MarshalJSON() ([]byte, error)
- func (Line) String() string
- func (l Line) Subpoints() (points []tegola.Point)
- type MultiLine
- type MultiPoint
- type MultiPoint3
- type MultiPolygon
- type Point
- type Point3
- type Polygon
- func (p Polygon) GoString() string
- func (p Polygon) GoStringTypeDecorated(withType bool, indent int, lineComment string, ...) string
- func (p Polygon) GoStringTyped(withType bool, indent int, lineComment string) string
- func (p Polygon) IsValid() bool
- func (p Polygon) MarshalJSON() ([]byte, error)
- func (Polygon) String() string
- func (p Polygon) Sublines() (slines []tegola.LineString)
Constants ¶
const DefaultPointFormat = "{%06f,%06f}, "
Variables ¶
This section is empty.
Functions ¶
func ApplyToPoints ¶
func ApplyToPoints(geometry geom.Geometry, f func(coords ...float64) ([]float64, error)) (geom.Geometry, error)
ApplyToPoints applys the given function to each point in the geometry and any sub geometries, return a new transformed geometry.
func CloneGeometry ¶
CloneGeomtry returns a deep clone of the Geometry.
func DefaultPointDecorator ¶ added in v0.4.0
func FromWebMercator ¶ added in v0.2.0
FromWebMercator takes a geometry encoded with WebMercator, and returns a Geometry encodes to the given srid.
Types ¶
type Collection ¶
type Collection []Geometry
Collection type can represent one or more other basic types.
func (Collection) Geometeries ¶
func (c Collection) Geometeries() (geometeries []G)
Geometeries return a set of geometeies that make that collection.
func (Collection) MarshalJSON ¶ added in v0.4.0
func (c Collection) MarshalJSON() ([]byte, error)
func (Collection) String ¶
func (Collection) String() string
type G ¶ added in v0.4.0
type G struct {
Geometry
}
G is used to pass back a generic Geometry type. It will contains functions to do basic conversions.
func (G) AsMultiPolygon ¶ added in v0.4.0
func (g G) AsMultiPolygon() MultiPolygon
type Geometry ¶ added in v0.4.0
type Geometry interface { String() string // contains filtered or unexported methods }
func MapAsGeometry ¶ added in v0.4.0
func UnmarshalJSON ¶ added in v0.4.0
type Line ¶
type Line []Point
Line is a basic line type which is made up of two or more points that don't intersect. TODO: We don't really check to make sure the points don't intersect.
func CloneLine ¶ added in v0.4.0
func CloneLine(line tegola.LineString) (l Line)
CloneLine will return a basic.Line for a given tegola.LineString
func NewLineFrom2Float64 ¶ added in v0.6.0
func NewLineFromPt ¶ added in v0.4.0
func NewLineFromSubPoints ¶ added in v0.4.0
func NewLineTruncatedFromPt ¶ added in v0.4.0
func (Line) AsGeomLineString ¶ added in v0.6.0
TODO: gdey remove this function when we have moved over to geomLinestring.
func (Line) Contains ¶ added in v0.4.0
Contains tells you weather the given point is contained by the Linestring. This assumes the linestring is a connected linestring.
func (Line) ContainsLine ¶ added in v0.4.0
func (Line) Direction ¶ added in v0.4.0
func (l Line) Direction() maths.WindingOrder
func (Line) GoStringTypeDecorated ¶ added in v0.4.0
func (Line) GoStringTyped ¶ added in v0.4.0
func (Line) IsValid ¶ added in v0.4.0
IsValid returns whether the line is valid according to the OGC specifiction The line should not intersect it's self.
func (Line) MarshalJSON ¶ added in v0.4.0
type MultiLine ¶
type MultiLine []Line
MultiLine is a set of lines.
func CloneMultiLine ¶ added in v0.4.0
CloneMultiLine will return a basic.MultiLine for a given togola.MultiLine
func NewMultiLine ¶ added in v0.4.0
func (MultiLine) Lines ¶
func (ml MultiLine) Lines() (lines []tegola.LineString)
Lines are the lines in a Multiline
func (MultiLine) MarshalJSON ¶ added in v0.4.0
type MultiPoint ¶
type MultiPoint []Point
MultiPoint describes a simple set of 2d points
func CloneMultiPoint ¶ added in v0.4.0
func CloneMultiPoint(mpt tegola.MultiPoint) MultiPoint
CloneMultiPoint will return a basic.MultiPoint for the given tegol.MultiPoint
func (MultiPoint) MarshalJSON ¶ added in v0.4.0
func (p MultiPoint) MarshalJSON() ([]byte, error)
func (MultiPoint) Points ¶
func (v MultiPoint) Points() (points []tegola.Point)
Points are the points that make up the set
func (MultiPoint) String ¶
func (MultiPoint) String() string
type MultiPoint3 ¶
type MultiPoint3 []Point3
MultiPoint3 describes a simple set of 3d points
func (MultiPoint3) MarshalJSON ¶ added in v0.4.0
func (p MultiPoint3) MarshalJSON() ([]byte, error)
func (MultiPoint3) Points ¶
func (v MultiPoint3) Points() (points []tegola.Point)
Points are the points that make up the set
func (MultiPoint3) String ¶
func (MultiPoint3) String() string
type MultiPolygon ¶
type MultiPolygon []Polygon
MultiPolygon describes a set of polygons.
func CloneMultiPolygon ¶ added in v0.4.0
func CloneMultiPolygon(mpolygon tegola.MultiPolygon) (mply MultiPolygon)
CloneMultiPolygon will return a basic.MultiPolygon for a given tegola.MultiPolygon.
func NewMultiPolygonFromPolygons ¶ added in v0.4.0
func NewMultiPolygonFromPolygons(polygons ...tegola.Polygon) (mp MultiPolygon)
func (MultiPolygon) GoString ¶ added in v0.4.0
func (p MultiPolygon) GoString() string
func (MultiPolygon) GoStringTyped ¶ added in v0.4.0
func (p MultiPolygon) GoStringTyped(withType bool, indent int, lineComment string) string
func (MultiPolygon) MarshalJSON ¶ added in v0.4.0
func (p MultiPolygon) MarshalJSON() ([]byte, error)
func (MultiPolygon) Polygons ¶
func (mp MultiPolygon) Polygons() (polygons []tegola.Polygon)
Polygons returns the polygons that make up the set.
func (MultiPolygon) String ¶
func (MultiPolygon) String() string
type Point ¶
type Point [2]float64
Point describes a simple 2d point
func ClonePoint ¶ added in v0.4.0
ClonePoint will return a basic.Point for given tegola.Point.
func (Point) MarshalJSON ¶ added in v0.4.0
type Point3 ¶
type Point3 [3]float64
Point3 describes a simple 3d point
func ClonePoint3 ¶ added in v0.4.0
ClonePoint will return a basic.Point3 for given tegola.Point3.
func (Point3) MarshalJSON ¶ added in v0.4.0
type Polygon ¶
type Polygon []Line
Polygon describes a basic polygon; made up of multiple lines.
func ClonePolygon ¶ added in v0.4.0
ClonePolygon will return a basic.Polygon for a given tegola.Polygon
func NewPolygonFromSubLines ¶ added in v0.4.0
func NewPolygonFromSubLines(lines ...tegola.LineString) (p Polygon)
func (Polygon) GoStringTypeDecorated ¶ added in v0.4.0
func (p Polygon) GoStringTypeDecorated(withType bool, indent int, lineComment string, pointDecorator func(pt Point) string) string
basic.Polygon { // basic.Polygon len(1);
{ lines… }, }
func (Polygon) GoStringTyped ¶ added in v0.4.0
func (Polygon) IsValid ¶ added in v0.4.0
IsValid returns weather the polygon is valid according to the OGC specifiction.
func (Polygon) MarshalJSON ¶ added in v0.4.0
func (Polygon) Sublines ¶
func (p Polygon) Sublines() (slines []tegola.LineString)
Sublines returns the lines that make up the polygon.