Documentation ¶
Index ¶
- Constants
- Variables
- func Create(ft *Feature) error
- func GetAll(loc string, opts *Options) (*model.Result, error)
- func GetByGroup(id, loc string, opts *Options) (*model.Result, error)
- func GetByText(q, loc string, opts *Options) (*model.Result, error)
- func Remove(id string) error
- func Replace(id string, ft *Feature) error
- type Coordinates
- type Feature
- type Geometry
- type GeometryType
- type Options
Constants ¶
View Source
const Collection = "features"
Collection indicates the MongoDB feature collection
Variables ¶
View Source
var ( // ErrBadGeometrySemantic indicates that a GeoJSON geometry is semantically invalid ErrBadGeometrySemantic = errors.New("bad geometry semantic") // ErrUnknownGeometryType indicates that a GeoJSON geometry type is invalid ErrUnknownGeometryType = errors.New("unknown geometry type") // ErrBadGeometryCoords indicates that GeoJSON geometry coordinates are ivnalid ErrBadGeometryCoords = errors.New("bad geometry coordinates") // ErrBadGeometryCollection indicates that a GeoJSON geometry collection are invalid ErrBadGeometryCollection = errors.New("empty geometry collection") )
Functions ¶
func GetByGroup ¶
GetByGroup returns a result based on feature group
Types ¶
type Feature ¶
type Feature struct { ID objectID `json:"_id" bson:"_id"` Name string `json:"name" bson:"name"` Description string `json:"description" bson:"description"` Geometry Geometry `json:"geometry" bson:"geometry"` Properties map[string]interface{} `json:"properties" bson:"properties"` Group objectID `json:"group" bson:"group"` Location objectID `json:"_location" bson:"_location"` Modified timestamp `json:"_modified" bson:"_modified"` }
Feature describes the entity of a feature
type Geometry ¶
type Geometry struct { Type GeometryType `json:"type" bson:"type"` Coordinates Coordinates `json:"coordinates,omitempty" bson:"coordinates,omitempty"` Geometries []Geometry `json:"geometries,omitempty" bson:"geometries,omitempty"` }
Geometry describes a GeoJSON geometry object
type GeometryType ¶
type GeometryType int
GeometryType represents an GeoJSON geometry type
const ( UnknownGeometry GeometryType = iota Point MultiPoint LineString MultiLineString Polygon MultiPolygon GeometryCollection )
Represents the GeoJSON geometry types
func (GeometryType) MarshalBSONValue ¶
func (g GeometryType) MarshalBSONValue() (bsontype.Type, []byte, error)
MarshalBSONValue implements the BSON value marshaler
func (GeometryType) MarshalJSON ¶
func (g GeometryType) MarshalJSON() ([]byte, error)
MarshalJSON implements the JSON marshaler
func (GeometryType) String ¶
func (g GeometryType) String() string
String returns a string representing the GeometryType
func (*GeometryType) UnmarshalBSONValue ¶
func (g *GeometryType) UnmarshalBSONValue(t bsontype.Type, b []byte) error
UnmarshalBSONValue implements the BSON value unmarshaler
func (*GeometryType) UnmarshalJSON ¶
func (g *GeometryType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the JSON unmarshaler
Click to show internal directories.
Click to hide internal directories.