georeference

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignReferences

func AssignReferences(ctx context.Context, opts *AssignReferencesOptions, depiction_id int64, refs ...*Reference) ([]byte, error)

AssignReferences updates records associated with 'depiction_id' (that is the depiction record itself and it's "parent" object record) and 'refs'. An alternate geometry file will be created for each element in 'ref' and a multi-point geometry (derived from 'refs') will be assigned to the depiction and parent (subject) record.

Types

type AssignReferencesOptions

type AssignReferencesOptions struct {
	// A valid whosonfirst/go-reader.Reader instance for reading depiction features.
	DepictionReader reader.Reader
	// A valid whosonfirst/go-writer.Writer instance for writing depiction features.
	DepictionWriter writer.Writer
	// A valid whosonfirst/go-reader.Reader instance for reading subject features.
	SubjectReader reader.Reader
	// A valid whosonfirst/go-writer.Writer instance for writing subject features.
	SubjectWriter writer.Writer
	// A valid whosonfirst/go-reader.Reader instance for reading "parent" features.
	WhosOnFirstReader reader.Reader
	// Author is the name of a person to associate with commit messages if using a `githubapi://` writer
	Author string
	// SourceGeomSuffix is an additional suffix to append to 'src:geom' properties (default is "sfomuseum#geoference")
	SourceGeomSuffix string
	// DepictionWriterURI is the URI used to create `DepictionWriter`; it is a temporary necessity to be removed with the go-writer/v3 (clone) release
	DepictionWriterURI string
	// SubjectWriterURI is the URI used to create `SubjectWriter`; it is a temporary necessity to be removed with the go-writer/v3 (clone) release
	SubjectWriterURI string
	// A valid whosonfirst/go-reader.Reader instance for reading "sfomuseum" features (for example the aviation collection).
	SFOMuseumReader reader.Reader
}

AssignReferencesOptions defines a struct for reading/writing options when updating geo-related information in depictions. A depiction is assumed to be the record for an image or some other piece of media. A subject is assumed to be the record for an object.

type Reference

type Reference struct {
	// Ids are the Who's On First ID of the place being referenced
	Ids []int64 `json:"id"`
	// Property is the (relative) label to use for the class of georeference.
	Property string `json:"property"`
	// AltLabel is the alternate geometry label to use for the class of georeference.
	AltLabel string `json:"alt_label"`
}

type Reference is a struct that encapusulates data about a place being georeferenced.

func MultiKeyValueStringsToReferences added in v0.0.21

func MultiKeyValueStringsToReferences(kv_references multi.KeyValueString) ([]*Reference, error)

MultiKeyValueStringsToReferences converts a list of `multi.KeyValueString` key-value pairs in to a list of `Reference` instances.

func (*Reference) String added in v0.0.21

func (r *Reference) String() string

Jump to

Keyboard shortcuts

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