Skip to content

Commit

Permalink
Use start datetime for sensing time
Browse files Browse the repository at this point in the history
  • Loading branch information
mitjak committed Sep 26, 2023
1 parent e355962 commit 43e48f5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/layer/PlanetScopeNicfiLayer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { LocationIdSHv3, DataProductId, BYOCSubTypes, Link } from './const';
import { LocationIdSHv3, DataProductId, BYOCSubTypes, Link, PaginatedTiles } from './const';
import { DATASET_PLANETSCOPE_NICFI } from './dataset';
import { AbstractSentinelHubV3Layer } from './AbstractSentinelHubV3Layer';
import { RequestConfiguration } from '../utils/cancelRequests';
import moment from 'moment';

interface ConstructorParameters {
instanceId?: string | null;
Expand Down Expand Up @@ -50,4 +51,16 @@ export class PlanetScopeNicfiLayer extends AbstractSentinelHubV3Layer {
protected getTileLinksFromCatalog(feature: Record<string, any>): Link[] {
return [];
}

protected convertResponseFromCatalog(response: any): PaginatedTiles {
return {
tiles: response.data.features.map((feature: Record<string, any>) => ({
geometry: feature.geometry,
sensingTime: moment.utc(feature.properties.start_datetime).toDate(),
meta: this.extractFindTilesMetaFromCatalog(feature),
links: this.getTileLinksFromCatalog(feature),
})),
hasMore: !!response.data.context.next,
};
}
}

0 comments on commit 43e48f5

Please sign in to comment.