https://github.com/whosonfirst/go-whosonfirst-spr
Go package for the Who's On First "standard places responses" (SPR) interface.
https://github.com/whosonfirst/go-whosonfirst-spr
golang spr whosonfirst
Last synced: 3 months ago
JSON representation
Go package for the Who's On First "standard places responses" (SPR) interface.
- Host: GitHub
- URL: https://github.com/whosonfirst/go-whosonfirst-spr
- Owner: whosonfirst
- License: bsd-3-clause
- Created: 2017-07-17T13:55:45.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2023-11-14T21:48:51.000Z (over 1 year ago)
- Last Synced: 2025-01-17T20:16:34.806Z (5 months ago)
- Topics: golang, spr, whosonfirst
- Language: Go
- Homepage:
- Size: 704 KB
- Stars: 0
- Watchers: 6
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-whosonfirst-spr
Go package for the Who's On First "standard places responses" (SPR) interface.
## Documentation
[](https://pkg.go.dev/github.com/whosonfirst/go-whosonfirst-spr)
## 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](https://code.flickr.net/2008/08/19/standard-photos-response-apis-for-civilized-age) 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](https://www.alexedwards.net/blog/interfaces-explained) 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](https://github.com/whosonfirst/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](https://github.com/whosonfirst/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
* https://github.com/whosonfirst/go-whosonfirst-geojson-v2
* https://github.com/whosonfirst/go-whosonfirst-flags
* https://github.com/whosonfirst/go-whosonfirst-sqlite-spr
* https://github.com/sfomuseum/go-edtf### Related
* https://code.flickr.net/2008/08/19/standard-photos-response-apis-for-civilized-age/
* https://code.flickr.net/2008/08/25/api-responses-as-feeds/