media

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2023 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

package media provides common methods for creating and updated media-specific Who's On First records.

Index

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

type NewMediaFeatureNameFunc func(string) (string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL