Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Commit

Permalink
more readme
Browse files Browse the repository at this point in the history
  • Loading branch information
letmaik committed Mar 23, 2016
1 parent 1064b28 commit 776333f
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
# Coverage REST Client
# coverage-rest-client

An experimental library that wraps [Coverage or Coverage Collection objects](https://github.com/Reading-eScience-Centre/coverage-jsapi)
and runs operations like subsetting through a REST API that follows the ["Coverage Data REST API Core Specification"](https://github.com/Reading-eScience-Centre/coverage-restapi) instead of loading the complete data and doing it locally.

## Example using covjson-reader
## Usage

We use the [covjson-reader](https://github.com/Reading-eScience-Centre/covjson-reader) library
to load a [CoverageJSON](https://github.com/neothemachine/coveragejson) document which then is wrapped with the coverage-rest-client library in order to support pagination and run operations like subsetting or collection filtering server-side.
coverage-rest-client can be used in browsers only.

```js
Standalone minified and source versions can be found in the [releases section](https://github.com/Reading-eScience-Centre/coverage-rest-client/releases). The library can also be used within npm, currently as a GitHub dependency only due to its experimental character.

As an example, we use the [covjson-reader](https://github.com/Reading-eScience-Centre/covjson-reader) library
to load a [CoverageJSON](https://github.com/neothemachine/coveragejson) document which then is wrapped with the coverage-rest-client library in order to support pagination and run operations like subsetting or collection filtering server-side:
```html
<script src="https://cdn.jsdelivr.net/covjson-reader/0.7/covjson-reader.min.js"></script>
<script src="coverage-rest-client.min.js"></script>
<script>
var url = 'http://example.com/temperature.covjson'
CovJSON.read(url).then(function (cov) {
return CoverageREST.wrap(cov, {loader: CovJSON.read})
}).then(function (cov) {
// work with REST-enabled coverage data object
}).catch(function (e) {
// there was an error when loading the coverage data
console.log(e)
})
```
Expand All @@ -25,3 +34,6 @@ For the interested ones: All HTTP Link headers (which may be used for pagination
Note that this library currently supports arbitrary JSON-LD and uses the [jsonld.js](https://github.com/digitalbazaar/jsonld.js) parser which is not that lightweight in terms of file size. It may be the case that in the future a JSON-LD profile for such coverage-related REST API control data is created which would force a specific JSON-LD structure and allow easier processing without a full JSON-LD parser.
## Acknowledgments
This library is developed within the [MELODIES project](http://www.melodiesproject.eu).

0 comments on commit 776333f

Please sign in to comment.