-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeometry.go
36 lines (31 loc) · 1.24 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
package geojson
// GeometryType defines the type of geometry in GeoJSON.
type GeometryType string
// Predefined GeometryType constants representing various geometry types in GeoJSON.
const (
TypeEmptyGeometry GeometryType = "Object"
TypePoint GeometryType = "Point"
TypeMultiPoint GeometryType = "MultiPoint"
TypeLineString GeometryType = "LineString"
TypeMultiLineString GeometryType = "MultiLineString"
TypePolygon GeometryType = "Polygon"
TypeMultiPolygon GeometryType = "MultiPolygon"
TypeGeometryCollection GeometryType = "GeometryCollection"
)
// GeometryIdentifier is an interface for objects that can report their geometry type.
type GeometryIdentifier interface {
// Type returns the GeometryType of the object.
Type() GeometryType
}
// geometryBuilder is an interface for building coordinates for geometries.
type geometryBuilder interface {
// buildCoordinates initializes a geometry's coordinates from the given input.
buildCoordinates(interface{}) error
}
// Geometry is a composite interface that combines GeometryIdentifier, BoundingBoxer,
// and geometryBuilder, representing a GeoJSON geometry object.
type Geometry interface {
GeometryIdentifier
BoundingBoxer
geometryBuilder
}