whosonfirst / go-whosonfirst-spr

Go package for the Who's On First "standard places responses" (SPR) interface.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-whosonfirst-spr

Go package for the Who's On First "standard places responses" (SPR) interface.

Documentation

Go Reference

Description

The StandardPlacesResult (SPR) interface defines the minimum set of methods that a system working with a collection of Who's On First (WOF) must implement for any given record. Not all records are the same so the SPR interface is meant to serve as a baseline for common data that describes every record.

The StandardPlacesResults takes the Flickr standard photo response as its inspiration which was designed to be the minimum amount of information about a Flickr photo necessary to display that photo with proper attribution and a link back to the photo page itself. The StandardPlacesResults aims to achieve the same thing for WOF records.

Being a Go language interface type the SPR is not designed as a data exchange method. Any given implementation of the SPR may allow its internal data to be exported or serialized (for example, as JSON) but this is not a requirement.

For a concrete example of a package that implements the SPR have a look at the go-whosonfirst-sqlite-spr package.

Notes

  • The Id() and ParentId() methods return string (rather than int64) values to account for non-WOF GeoJSON documents that are consumed by the whosonfirst/go-whosonfirst-geojson-v2 package.

  • Flags are defined in the go-whosonfirst-flags package.

  • The Path() method is expected to return a relative URI. The URI method is expected to return a fully-qualified URI. These two methods are confusing and that confusion should be addressed.

See also

Related

About

Go package for the Who's On First "standard places responses" (SPR) interface.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Go 100.0%