forked from go-spatial/tegola
-
Notifications
You must be signed in to change notification settings - Fork 0
/
geometry.go
57 lines (48 loc) · 1.31 KB
/
geometry.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
// Package tegola describes the basic geometeries that can be used to convert to
// and from.
package tegola
// Geometry describes a geometry.
type Geometry interface{}
// Point is how a point should look like.
type Point interface {
Geometry
X() float64
Y() float64
}
// Point3 is a point with three dimensions; at current is just converted and treated as a point.
type Point3 interface {
Point
Z() float64
}
// MultiPoint is a Geometry with multiple individual points.
type MultiPoint interface {
Geometry
Points() []Point
}
// LineString is a Geometry of a line.
type LineString interface {
Geometry
Subpoints() []Point
}
// MultiLine is a Geometry with multiple individual lines.
type MultiLine interface {
Geometry
Lines() []LineString
}
// Polygon is a multi-line Geometry where all the lines connect to form an enclose space.
type Polygon interface {
Geometry
Sublines() []LineString
}
// MultiPolygon describes a Geometry multiple intersecting polygons. There should only one
// exterior polygon, and the rest of the polygons should be interior polygons. The interior
// polygons will exclude the area from the exterior polygon.
type MultiPolygon interface {
Geometry
Polygons() []Polygon
}
// Collection is a collections of different geometries.
type Collection interface {
Geometry
Geometries() []Geometry
}