Skip to content

Commit

Permalink
Update data products
Browse files Browse the repository at this point in the history
  • Loading branch information
mitjak committed Sep 23, 2024
1 parent a937a80 commit 238cbfc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/layer/__tests__/fixtures.makeLayersSHv3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const getLayersFromConfigurationService = [
name: 'default',
description: 'Default layer style',
dataProduct: {
id: 'dataProductId',
'@id':
'https://services.sentinel-hub.com/configuration/v1/datasets/S2L2A/dataproducts/dataProductId',
},
Expand All @@ -75,6 +76,7 @@ export const getLayersFromConfigurationService = [
'@id': 'https://services.sentinel-hub.com/api/v2/configuration/instances/instanceId',
},
dataset: { '@id': 'https://services.sentinel-hub.com/configuration/v1/datasets/S2L2A' },
collectionType: 'S2L2A',
datasetSource: { '@id': 'https://services.sentinel-hub.com/configuration/v1/datasets/S2L2A/sources/2' },
defaultStyleName: 'default',
datasourceDefaults: {
Expand Down Expand Up @@ -215,7 +217,7 @@ export const expectedResultConfigurationService = (
evalscript: null as string,
evalscriptUrl: null as string,
dataProduct:
'https://services.sentinel-hub.com/configuration/v1/datasets/S2L2A/dataproducts/dataProductId',
'https://services.sentinel-hub.com/api/v2/configuration/datasets/S2L2A/dataproducts/dataProductId',
upsampling: null as string,
downsampling: null as string,
mosaickingOrder: 'mostRecent',
Expand Down
2 changes: 1 addition & 1 deletion src/layer/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export const DEFAULT_FIND_TILES_MAX_COUNT_PARAMETER = 50;
export type DataProductId = string;

export const SUPPORTED_DATA_PRODUCTS_PROCESSING: DataProductId[] = [
'https://services.sentinel-hub.com/configuration/v1/datasets/S2L1C/dataproducts/643',
'https://services.sentinel-hub.com/api/v2/configuration/datasets/S2L1C/dataproducts/643',
];

export type BYOCBand = {
Expand Down
4 changes: 3 additions & 1 deletion src/layer/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@ export async function fetchLayerParamsFromConfigurationService(
maxCloudCoverPercent: l.datasourceDefaults.maxCloudCoverage,
}),
evalscript: l.styles[0].evalScript,
dataProduct: l.styles[0].dataProduct ? l.styles[0].dataProduct['@id'] : undefined,
dataProduct: l.styles[0].dataProduct
? `${configurationServiceHostName}api/v2/configuration/datasets/${l.collectionType}/dataproducts/${l.styles[0].dataProduct['id']}`
: undefined,
legend: l.styles.find((s: any) => s.name === l.defaultStyleName)
? l.styles.find((s: any) => s.name === l.defaultStyleName).legend
: null,
Expand Down

0 comments on commit 238cbfc

Please sign in to comment.