Skip to content

Commit

Permalink
Use renders from stac
Browse files Browse the repository at this point in the history
  • Loading branch information
hanbyul-here committed Aug 7, 2024
1 parent 4591e79 commit e6b860d
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@ function reconcileQueryDataWithDataset(

if (queryData.status === DatasetStatus.SUCCESS) {
const domain = resolveLayerTemporalExtent(base.data.id, queryData.data);
const titilerParams = queryData.data.renderParams?? base.data.sourceParams;

base = {
...base,
data: {
...base.data,
...queryData.data,
domain
domain,
sourceParams: titilerParams
}
};
}
Expand Down Expand Up @@ -77,7 +80,6 @@ async function fetchStacDatasetById(
const { data } = await axios.get(
`${stacApiEndpointToUse}/collections/${stacCol}`
);

const commonTimeseriesParams = {
isPeriodic: !!data['dashboard:is_periodic'],
timeDensity: data['dashboard:time_density'] || TimeDensity.DAY
Expand Down Expand Up @@ -112,13 +114,15 @@ async function fetchStacDatasetById(
? data.summaries.datetime
: data.extent.temporal.interval[0];

const renderParams = data.renders?.dashboard;
if (!domain?.length || domain.some((d) => !d)) {
throw new Error('Invalid datetime domain');
}

return {
...commonTimeseriesParams,
domain
domain,
renderParams
};
}
}
Expand Down

0 comments on commit e6b860d

Please sign in to comment.