-
Notifications
You must be signed in to change notification settings - Fork 9
/
defaultcontext.go
101 lines (81 loc) · 2.96 KB
/
defaultcontext.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package geos
// DefaultContext is the default context.
var DefaultContext = NewContext()
// Clone clones g into c.
func Clone(g *Geom) *Geom {
return DefaultContext.Clone(g)
}
// NewGeomFromBounds returns a new polygon populated with bounds.
func NewGeomFromBounds(minX, minY, maxX, maxY float64) *Geom {
return DefaultContext.NewGeomFromBounds(minX, minY, maxX, maxY)
}
// NewCollection returns a new collection.
func NewCollection(typeID TypeID, geoms []*Geom) *Geom {
return DefaultContext.NewCollection(typeID, geoms)
}
// NewCoordSeq returns a new CoordSeq.
func NewCoordSeq(size, dims int) *CoordSeq {
return DefaultContext.NewCoordSeq(size, dims)
}
// NewCoordSeqFromCoords returns a new CoordSeq populated with coords.
func NewCoordSeqFromCoords(coords [][]float64) *CoordSeq {
return DefaultContext.NewCoordSeqFromCoords(coords)
}
// NewEmptyCollection returns a new empty collection.
func NewEmptyCollection(typeID TypeID) *Geom {
return DefaultContext.NewEmptyCollection(typeID)
}
// NewEmptyLineString returns a new empty line string.
func NewEmptyLineString() *Geom {
return DefaultContext.NewEmptyLineString()
}
// NewEmptyPoint returns a new empty point.
func NewEmptyPoint() *Geom {
return DefaultContext.NewEmptyPoint()
}
// NewEmptyPolygon returns a new empty polygon.
func NewEmptyPolygon() *Geom {
return DefaultContext.NewEmptyPolygon()
}
// NewGEOMFromGeoJSON parses a geometry in GeoJSON format from GeoJSON.
func NewGeomFromGeoJSON(geoJSON string) (*Geom, error) {
return DefaultContext.NewGeomFromGeoJSON(geoJSON)
}
// NewGeomFromWKB parses a geometry in WKB format from wkb.
func NewGeomFromWKB(wkb []byte) (*Geom, error) {
return DefaultContext.NewGeomFromWKB(wkb)
}
// NewGeomFromWKT parses a geometry in WKT format from wkt.
func NewGeomFromWKT(wkt string) (*Geom, error) {
return DefaultContext.NewGeomFromWKT(wkt)
}
// NewLinearRing returns a new linear ring populated with coords.
func NewLinearRing(coords [][]float64) *Geom {
return DefaultContext.NewLinearRing(coords)
}
// NewLineString returns a new line string populated with coords.
func NewLineString(coords [][]float64) *Geom {
return DefaultContext.NewLineString(coords)
}
// NewPoint returns a new point populated with coord.
func NewPoint(coord []float64) *Geom {
return DefaultContext.NewPoint(coord)
}
// NewPointFromXY returns a new point with x and y.
func NewPointFromXY(x, y float64) *Geom {
return DefaultContext.NewPointFromXY(x, y)
}
// NewPolygon returns a new point populated with coordss.
func NewPolygon(coordss [][][]float64) *Geom {
return DefaultContext.NewPolygon(coordss)
}
// Polygonize returns a set of geometries which contains linework that
// represents the edges of a planar graph.
func Polygonize(geoms []*Geom) *Geom {
return DefaultContext.Polygonize(geoms)
}
// PolygonizeValid returns a set of polygons which contains linework that
// represents the edges of a planar graph.
func PolygonizeValid(geoms []*Geom) *Geom {
return DefaultContext.PolygonizeValid(geoms)
}