Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Feature ¶
type Feature struct { ID string `jsonapi:"primary,features" json:"id"` Type string `jsonapi:"attr,type" json:"type"` BoundingBox []float64 `json:"bbox,omitempty"` Geometry *geojson.Geometry `json:"geometry,omitempty"` Properties map[string]interface{} `jsonapi:"attr,properties" json:"properties"` CRS map[string]interface{} `json:"crs,omitempty"` // Coordinate Reference System Objects are not currently supported }
A Feature corresponds to GeoJSON feature object
func UnmarshalFeature ¶
UnmarshalFeature decodes the data into a GeoJSON feature.
func (*Feature) MarshalJSON ¶
MarshalJSON converts the feature object into the proper JSON. It will handle the encoding of all the child geometries.
type FeatureCollection ¶
type FeatureCollection struct { Type string `json:"type"` BoundingBox []float64 `json:"bbox,omitempty"` Features []*Feature `json:"features"` CRS map[string]interface{} `json:"crs,omitempty"` Links *jsonapi.Links `json:"links,omitempty"` }
A FeatureCollection correlates to a GeoJSON feature collection.
func NewFeatureCollection ¶
func NewFeatureCollection() *FeatureCollection
NewFeatureCollection creates and initializes a new feature collection.
func (*FeatureCollection) AddFeature ¶
func (fc *FeatureCollection) AddFeature(feature *Feature) *FeatureCollection
AddFeature appends a feature to the collection.
func (*FeatureCollection) Link ¶
func (fc *FeatureCollection) Link(links jsonapi.Links)
Link add links to the FeatureCollection
func (*FeatureCollection) MarshalJSON ¶
func (fc *FeatureCollection) MarshalJSON() ([]byte, error)
MarshalJSON converts the feature collection object into the proper JSON. It will handle the encoding of all the child features and geometries. Alternately one can call json.Marshal(fc) directly for the same result.