Home Reference Source Repository
import {Coverage} from 'covjson-reader'
public class | source

Coverage

Wraps a CoverageJSON Coverage object as a Coverage API object.

See:

Constructor Summary

Public Constructor
public

constructor(covjson: Object, cacheRanges: boolean)

Member Summary

Public Members
public
A bounding box array with elements [westLon, southLat, eastLon, northLat].
public
public
public
public

Method Summary

Public Methods
public
public

loadRange(paramKey: string): Promise

Returns the requested range data as a Promise.
public

loadRanges(paramKeys: iterable): Promise

Returns the requested range data as a Promise.

Public Constructors

public constructor(covjson: Object, cacheRanges: boolean) source

Params:

NameTypeAttributeDescription
covjson Object

A CoverageJSON Coverage object.

cacheRanges boolean

If true, then any range that was loaded remotely is cached. (The domain is always cached.)

Public Members

public bbox: Array | undefined source

A bounding box array with elements [westLon, southLat, eastLon, northLat].

public cacheRanges: boolean source

public domainType: string source

public parameters: Map source

public type: string source

Public Methods

public loadDomain(): Promise source

Return:

Promise

public loadRange(paramKey: string): Promise source

Returns the requested range data as a Promise.

Note that this method implicitly loads the domain as well.

Params:

NameTypeAttributeDescription
paramKey string

The key of the Parameter for which to load the range.

Return:

Promise

A Promise object which loads the requested range data and succeeds with a Range object.

Example:

cov.loadRange('salinity').then(function (sal) {
  // work with Range object
}).catch(function (e) {
  // there was an error when loading the range
  console.log(e.message)
}) 

public loadRanges(paramKeys: iterable): Promise source

Returns the requested range data as a Promise.

Note that this method implicitly loads the domain as well.

Params:

NameTypeAttributeDescription
paramKeys iterable
  • optional

An iterable of parameter keys for which to load the range data. If not given, loads all range data.

Return:

Promise

A Promise object which loads the requested range data and succeeds with a Map object.

Example:

cov.loadRanges(['salinity','temp']).then(function (ranges) {
  // work with Map object
  console.log(ranges.get('salinity').values)
}).catch(function (e) {
  // there was an error when loading the range data
  console.log(e)
})