Documentation ¶
Overview ¶
package media provides common methods for creating and updated media-specific Who's On First records.
Index ¶
- func NewMediaFeature(ctx context.Context, rsp *gather.GatherImagesResponse, depicts []byte, ...) ([]byte, error)
- func NewMediaFeatureWithProvider(ctx context.Context, pr id.Provider, rsp *gather.GatherImagesResponse, ...) ([]byte, error)
- type Coordinates
- type Feature
- type Geometry
- type NewMediaFeatureNameFunc
- type NewMediaFeatureOptions
- type Properties
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMediaFeature ¶
func NewMediaFeature(ctx context.Context, rsp *gather.GatherImagesResponse, depicts []byte, opts *NewMediaFeatureOptions) ([]byte, error)
Create a new geojson.Feature instance with media:properties associated with a Feature instance it depicts.
func NewMediaFeatureWithProvider ¶ added in v0.0.3
func NewMediaFeatureWithProvider(ctx context.Context, pr id.Provider, rsp *gather.GatherImagesResponse, depicts []byte, opts *NewMediaFeatureOptions) ([]byte, error)
Create a new geojson.Feature instance with media:properties associated with a Feature instance it depicts, using a custom id.Provider.
Types ¶
type Coordinates ¶
type Coordinates []float64
type Coordinates stores a single longitude, latitude coordinate pair.
type Feature ¶
type Feature struct { Type string `json:"type"` Properties Properties `json:"properties"` Geometry Geometry `json:"geometry"` }
type Feature provides a GeoJSON struct.
type Geometry ¶
type Geometry struct { Type string `json:"type"` Coordinates Coordinates `json:"coordinates"` }
type Geomerty stores a GeoJSON geometry dictionary.
type NewMediaFeatureNameFunc ¶
NewMediaFeatureNameFunc is a function for manipulating an input name in to a final name to be assigned to a feature's wof:name property.
type NewMediaFeatureOptions ¶
type NewMediaFeatureOptions struct { // The gocloud.dev/blob.Bucket where media records are loaded from SourceBucket *blob.Bucket // The name of the repository that this feature will be stored in. Repo string // An optional NewMediaFeatureNameFunc for deriving the final wof:name property assigned to the new feature. NameFunction NewMediaFeatureNameFunc // An optional string label for a WOF placetype. If present it will be used to derive the set of WOF IDs for that placetype and its ancestors, associated with the feature being depicted by the new media feature, to be assigned to the new feature. DepictsPlacetype string // Custom properties to assign to the new Feature CustomProperties map[string]interface{} }
NewMediaFeatureOptions is a struct containing application-specific options used in the create of new media-related GeoJSON Features.
type Properties ¶
type Properties map[string]interface{}
type Geomerty stores a GeoJSON properties dictionary.