Class: ImageCollection

ImageCollection(params)

ImageCollection はcollection.jsonのSTACを利用するためのクラスです。

Constructor

new ImageCollection(params)

Parameters:
Name Type Description
params Object ImageCollectionインスタンスを作成するための条件です。
Properties
Name Type Description
collectionUrl string collection.jsonのURLです。
See:

Methods

(async) exists(tid) → {boolean}

データセットの時刻IDが存在するか判定します。
Parameters:
Name Type Description
tid string データの有無を確認したい時刻IDです。
Returns:
存在する場合にtrue、存在しない場合はfalseを返します。
Type
boolean

first() → {string}

データセットの最初の時刻IDを返します。
Returns:
時刻IDを表す文字列です。
Type
string

firstDate() → {Date}

データセットの最初の時刻をDateとして返します。
Returns:
日時を表すDateです。
Type
Date

formatDate(date) → {string}

データセットの時刻IDの形式に変換した文字列を返します。
Parameters:
Name Type Description
date Date 変換対象の時刻オブジェクトです。
Returns:
時刻IDを表す文字列です。
Type
string

formattedDate(date) → {string}

データセットの日時の形式に変換した文字列を返します。
Parameters:
Name Type Description
date Date 変換対象の時刻オブジェクトです。
Returns:
日時を表す文字列です。
Type
string

getBandIdAll() → {Array.<string>}

データセットのバンドIDを全て返します。
Returns:
バンドID文字列の配列です。
Type
Array.<string>

getBbox() → {BboxObject}

データセット全体の緯度経度範囲を返します。
Returns:
緯度経度範囲を表すBboxObjectです。
Type
BboxObject

getCollectionUrl() → {string}

参照しているcollection.jsonのURLを取得します。
Returns:
URLです。
Type
string

getDateFormat() → {string}

データセットの日時の形式を返します。
Returns:
日時の文字列です。
Type
string

(async) getImage(…args) → {Image}

日時、バンド名を指定してImageを取得します。
Parameters:
Name Type Attributes Description
args Object <repeatable>
取得するImageの時刻などの条件です。
Properties
Name Type Description
tid string 日時を示す時刻IDです。dateを指定した場合は無視されます。
date Date 日時を示すDateオブジェクトです。tidの指定よりも優先されます。時刻はUTC(new Date(Date.UTC(yyyy,mm-1,dd))で指定する必要があります。
band string バンドを示す文字列です。
Returns:
Imageオブジェクトを返します。
Type
Image

getLicense() → {string}

データセットのライセンスを返します。
Returns:
ライセンスのURLです。
Type
string

getProjection() → {string}

データセットの投影法を返します。
Returns:
投影法の名前の文字列です。
Type
string

(async) getTemporalId(date) → {string}

指定した時刻に該当する時刻IDを返します。指定した日時に該当したデータが存在しない場合はその日時よりも前のデータが存在する時刻IDを返します。(例えば現在時刻new Date()を入力すると、このデータセットの中で利用できる最新データが自動で取得されます)
Parameters:
Name Type Description
date Date 日時です。時刻はUTC(new Date(Date.UTC(yyyy,mm-1,dd))で指定する必要があります。
Returns:
時刻IDを表す文字列を返します。
Type
string

(async) getTemporalIdAll(start, end) → {Array.<string>}

指定した時刻範囲(start <= date < end)に存在する時刻IDを全て返します。
Parameters:
Name Type Description
start Date 開始日時です。時刻はUTC(new Date(Date.UTC(yyyy,mm-1,dd))で指定する必要があります。
end Date 終了日時です。時刻はUTC(new Date(Date.UTC(yyyy,mm-1,dd))で指定する必要があります。
Returns:
時刻IDを表す文字列の配列を返します。
Type
Array.<string>

getTitle() → {string}

データセットのタイトルを返します。
Returns:
タイトルの文字列です。
Type
string

(async) init()

初期化します。この中でSTACのデータが取得されるため、必ず実行が必要です。

last() → {string}

データセットの最後(最新)の時刻IDを返します。
Returns:
時刻IDを表す文字列です。
Type
string

lastDate() → {Date}

データセットの最後(最新)の時刻をDateとして返します。
Returns:
日時を表すDateです。
Type
Date

(async) next(tid) → {string}

次の時刻IDを返します。
Parameters:
Name Type Description
tid string 検索の基準となる時刻IDです。
Returns:
時刻IDを表す文字列です。
Type
string

(async) nextAll(tid, size) → {Array.<string>}

指定した時刻IDよりも後の時刻IDを必要な件数分返します。
Parameters:
Name Type Description
tid string 検索の基準となる時刻IDです。
size number 件数です。
Returns:
時刻IDを表す文字列の配列を返します。
Type
Array.<string>

parseDate(tid) → {string}

時刻IDが示す時刻をDateオブジェクトで返します。
Parameters:
Name Type Description
tid string 変換対象の時刻IDです。
Returns:
時刻を表すDateオブジェクトです。
Type
string

(async) prev(tid) → {string}

前の時刻IDを返します。
Parameters:
Name Type Description
tid string 検索の基準となる時刻IDです。
Returns:
時刻IDを表す文字列です。
Type
string

(async) prevAll(tid, size) → {Array.<string>}

指定した時刻IDよりも前の時刻IDを必要な件数分返します。
Parameters:
Name Type Description
tid string 検索の基準となる時刻IDです。
size number 件数です。
Returns:
時刻IDを表す文字列の配列を返します。
Type
Array.<string>