Documentation
¶
Index ¶
- type Collection
- type Geometry
- func (g *Geometry) ToLineString() (*LineString, error)
- func (g *Geometry) ToMultiLineString() (*MultiLineString, error)
- func (g *Geometry) ToMultiPoint() (*MultiPoint, error)
- func (g *Geometry) ToMultiPolygon() (*MultiPolygon, error)
- func (g *Geometry) ToPoint() (*Point, error)
- func (g *Geometry) ToPolygon() (*Polygon, error)
- type LineString
- type MultiLineString
- type MultiPoint
- type MultiPolygon
- type Object
- type Point
- type Polygon
- type Position
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct { Type geojson.OBjectType `json:"type"` Geometries []Geometry `json:"geometries"` }
Collection type https://tools.ietf.org/html/rfc7946#section-3.1.8
func CollectionFromJSON ¶
func CollectionFromJSON(gjson string) (*Collection, error)
CollectionFromJSON returns a new Collection by passing in a valid JSON string.
func NewGeometryCollection ¶
func NewGeometryCollection(geometries []Geometry) (*Collection, error)
NewGeometryCollection initializes a new instance of GeometryCollection
type Geometry ¶
type Geometry struct { // GeoJSONType describes the type of GeoJSON Geometry, Feature or FeatureCollection this object is. GeoJSONType geojson.OBjectType `json:"type"` Coordinates interface{} `json:"coordinates"` }
Geometry type https://tools.ietf.org/html/rfc7946#section-3
func (*Geometry) ToLineString ¶
func (g *Geometry) ToLineString() (*LineString, error)
ToLineString converts a ToLineString Geometry to ToLineString geometry.
func (*Geometry) ToMultiLineString ¶
func (g *Geometry) ToMultiLineString() (*MultiLineString, error)
ToMultiLineString converts a MultiLineString faeture to MultiLineString geometry.
func (*Geometry) ToMultiPoint ¶
func (g *Geometry) ToMultiPoint() (*MultiPoint, error)
ToMultiPoint converts the Geometry to MultiPoint
func (*Geometry) ToMultiPolygon ¶
func (g *Geometry) ToMultiPolygon() (*MultiPolygon, error)
ToMultiPolygon converts a MultiPolygon Feature to MultiPolygon geometry.
type LineString ¶
type LineString struct {
Coordinates []Point
}
LineString defines the linestring type.
func NewLineString ¶
func NewLineString(coordinates []Point) (*LineString, error)
NewLineString initializes a new LineString
func (*LineString) IsClosed ¶
func (l *LineString) IsClosed() bool
IsClosed determines if the Linestring is closed which means that has its first and last coordinate at the same position
func (*LineString) IsLinearRing ¶
func (l *LineString) IsLinearRing() bool
IsLinearRing returns true if it is a closed LineString with four or more positions https://tools.ietf.org/html/rfc7946#section-3.1.1
type MultiLineString ¶
type MultiLineString struct {
Coordinates []LineString
}
MultiLineString type https://tools.ietf.org/html/rfc7946#section-3.1.5
func NewMultiLineString ¶
func NewMultiLineString(coordinates []LineString) (*MultiLineString, error)
NewMultiLineString initializes a new MultiLineString
type MultiPoint ¶
type MultiPoint struct {
Coordinates []Point
}
MultiPoint defines the MultiPoint type https://tools.ietf.org/html/rfc7946#section-3.1.3
func NewMultiPoint ¶
func NewMultiPoint(coordinates []Point) (*MultiPoint, error)
NewMultiPoint initializes a new MultiLineString
type MultiPolygon ¶
type MultiPolygon struct {
Coordinates []Polygon
}
MultiPolygon defines the MultiPolygon type For type "MultiPolygon", the "coordinates" member is an array of Polygon coordinate arrays. https://tools.ietf.org/html/rfc7946#section-3.1.7
func NewMultiPolygon ¶
func NewMultiPolygon(coordinates []Polygon) (*MultiPolygon, error)
NewMultiPolygon initialize a new MultiPolygon
type Object ¶
type Object struct {
Type geojson.OBjectType
}
Object is the base interface for GeometryObject types
type Point ¶
Point represents a geolocation using ESPG-900913/(ESPG-3875) Projection. For type "Point" the coordinates member must be a single position.
type Polygon ¶
type Polygon struct {
Coordinates []LineString
}
Polygon defines a polygon type https://tools.ietf.org/html/rfc7946#section-3.1.6
func NewPolygon ¶
func NewPolygon(coordinates []LineString) (*Polygon, error)
NewPolygon initializes a new instance of a Polygon The coordinates of a polygon must be an array of linear ring coordinate arrays. For Polygons with more than one of these rings, the first MUST be the exterior ring, and any others MUST be interior rings. The exterior ring bounds the surface, and the interior ring bound holes within the surface.
type Position ¶
Position is the fundamental geometry construct, consisting of Latitude, Longtitude and Altitude
func NewPosition ¶
NewPosition initializes a new instance of the Position