-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from sentinel-hub/feature/s-5
Feature/s 5
- Loading branch information
Showing
8 changed files
with
387 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ S1GRDEW_LAYER_ID= | |
S2L2A_LAYER_ID= | ||
S3SLSTR_LAYER_ID= | ||
S3OLCI_LAYER_ID= | ||
S5PL2_LAYER_ID= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { BBox } from 'src/bbox'; | ||
import { PaginatedTiles } from 'src/layer/const'; | ||
import { DATASET_S5PL2 } from 'src/layer/dataset'; | ||
import { AbstractSentinelHubV3Layer } from 'src/layer/AbstractSentinelHubV3Layer'; | ||
|
||
/* | ||
S-5P is a bit special in that we need to supply productType when searching | ||
for tiles, but we don't need it for getMap() (it is determined automatically | ||
from the evalscript). | ||
*/ | ||
|
||
export enum ProductType { | ||
AER_AI = 'AER_AI', | ||
CLOUD = 'CLOUD', | ||
CO = 'CO', | ||
HCHO = 'HCHO', | ||
NO2 = 'NO2', | ||
O3 = 'O3', | ||
SO2 = 'SO2', | ||
CH4 = 'CH4', | ||
} | ||
|
||
type S5PL2FindTilesDatasetParameters = { | ||
type: string; | ||
productType: ProductType; | ||
}; | ||
|
||
export class S5PL2Layer extends AbstractSentinelHubV3Layer { | ||
public readonly dataset = DATASET_S5PL2; | ||
|
||
public async findTiles( | ||
bbox: BBox, | ||
fromTime: Date, | ||
toTime: Date, | ||
maxCount?: number, | ||
offset?: number, | ||
productType?: ProductType, | ||
): Promise<PaginatedTiles> { | ||
const findTilesDatasetParameters: S5PL2FindTilesDatasetParameters = { | ||
type: this.dataset.shProcessingApiDatasourceAbbreviation, | ||
productType: productType, | ||
}; | ||
const response = await this.fetchTiles( | ||
bbox, | ||
fromTime, | ||
toTime, | ||
maxCount, | ||
offset, | ||
null, | ||
findTilesDatasetParameters, | ||
); | ||
return { | ||
tiles: response.data.tiles.map(tile => { | ||
return { | ||
geometry: tile.tileDrawRegionGeometry, | ||
sensingTime: tile.sensingTime, | ||
meta: {}, | ||
}; | ||
}), | ||
hasMore: response.data.hasMore, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.