@opengeoweb/webmap-react 19.4.0 → 19.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1091 -151
- package/dist/src/lib/components/OpenLayers/component/OpenLayersMapView.d.ts +1 -0
- package/dist/src/lib/components/OpenLayers/layers/TimeAwareGeoTIFFLayer.d.ts +5 -1
- package/dist/src/lib/components/OpenLayers/layers/TimeAwareGeoTIFFLayerUtils.d.ts +18 -1
- package/dist/src/lib/components/OpenLayers/layers/useStacViewportBbox.d.ts +6 -0
- package/dist/src/lib/components/OpenLayers/utils/types.d.ts +1 -0
- package/dist/src/lib/geotiff-layer-api/api.d.ts +22 -7
- package/dist/src/lib/geotiff-layer-api/hooks.d.ts +4 -2
- package/dist/src/lib/geotiff-layer-api/index.d.ts +1 -0
- package/dist/src/lib/geotiff-layer-api/utils/stacColormapToOlStyle.d.ts +18 -1
- package/dist/src/lib/geotiff-layer-api/utils/stacTimeStepUtils.d.ts +6 -3
- package/dist/src/lib/geotiff-layer-api/utils/styleSelection.d.ts +1 -0
- package/dist/src/lib/geotiff-layer-api/utils/useGetStacGeoTIFFLayerInstance.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Dimension } from '@opengeoweb/webmap';
|
|
2
|
+
import type { Dimension, STACGeoTIFFLayerOptions } from '@opengeoweb/webmap';
|
|
3
3
|
import type { OpenLayersFeatureLayerProps } from './OpenLayersFeatureLayer';
|
|
4
4
|
import { getStacFrameItemsToRender, getStacItemLookupWindowForTimes } from './TimeAwareGeoTIFFLayerUtils';
|
|
5
5
|
import type { OnInitializeLayerProps } from '../utils/types';
|
|
@@ -13,5 +13,9 @@ interface TimeAwareGeoTIFFLayerProps extends OpenLayersFeatureLayerProps {
|
|
|
13
13
|
onInitializeLayer?: (payload: OnInitializeLayerProps) => void;
|
|
14
14
|
opacity?: number;
|
|
15
15
|
visible?: boolean;
|
|
16
|
+
assetKey?: string;
|
|
17
|
+
dataLayout?: STACGeoTIFFLayerOptions['dataLayout'];
|
|
18
|
+
spatialFilter?: boolean;
|
|
19
|
+
temporalStep?: string;
|
|
16
20
|
}
|
|
17
21
|
export declare const TimeAwareGeoTIFFLayer: React.FC<TimeAwareGeoTIFFLayerProps>;
|
|
@@ -3,10 +3,26 @@ import type { STACItem } from '../../../geotiff-layer-api/api';
|
|
|
3
3
|
export declare const STAC_ITEM_LOOKUP_WINDOW_MS: number;
|
|
4
4
|
export declare const STAC_ITEM_LOOKUP_WINDOW_INTERVAL_MULTIPLIER = 20;
|
|
5
5
|
export declare const STAC_GEOTIFF_FRAME_PRELOAD_RADIUS = 4;
|
|
6
|
+
export declare const STAC_TILED_ITEM_PAGE_LIMIT = 100;
|
|
7
|
+
export declare const STAC_TILED_OVERVIEW_ITEM_PAGE_LIMIT = 1000;
|
|
6
8
|
export interface STACFrameItem {
|
|
7
9
|
item: STACItem;
|
|
8
10
|
isSelected: boolean;
|
|
9
11
|
}
|
|
12
|
+
interface ResolveStacItemQueryStateProps {
|
|
13
|
+
hasCollectionData: boolean;
|
|
14
|
+
isTiledCollection: boolean;
|
|
15
|
+
rasterViewportBbox?: number[];
|
|
16
|
+
shouldUseSpatialFilter: boolean;
|
|
17
|
+
viewportBbox?: number[];
|
|
18
|
+
}
|
|
19
|
+
interface StacItemQueryState {
|
|
20
|
+
isItemQueryEnabled: boolean;
|
|
21
|
+
isTiledOverview: boolean;
|
|
22
|
+
itemQueryBbox?: number[];
|
|
23
|
+
}
|
|
24
|
+
export declare const resolveStacItemQueryState: ({ hasCollectionData, isTiledCollection, rasterViewportBbox, shouldUseSpatialFilter, viewportBbox, }: ResolveStacItemQueryStateProps) => StacItemQueryState;
|
|
25
|
+
export declare const getSingleStacRasterItem: (frameItems: STACFrameItem[], selectionBbox?: number[], preferredItemId?: string) => STACFrameItem[];
|
|
10
26
|
export type STACItemLookupWindow = [string | undefined, string | undefined];
|
|
11
27
|
export declare const resolvePreferredStyleName: (styleNames: string[], currentStyle?: string) => string;
|
|
12
28
|
export declare const getTimeIntervalInMilliseconds: (interval?: TimeInterval) => number | undefined;
|
|
@@ -17,4 +33,5 @@ export declare const getLookupStepInMilliseconds: (frameStepMs: number | undefin
|
|
|
17
33
|
export declare const shouldPreloadStacFrames: (frameStepMs: number | undefined, timeIntervalMs: number | undefined) => boolean;
|
|
18
34
|
export declare const getStacFrameTargetTimes: (timeValue: string | undefined, prefetchList: number[], fallbackStepMs: number | undefined, preloadRadius?: number) => number[];
|
|
19
35
|
export declare const getRequiredLookupMarginInMilliseconds: (timeValue: string | undefined, frameTargetTimes: number[], fallbackMarginMs: number) => number;
|
|
20
|
-
export declare const getStacFrameItemsToRender: (items: STACItem[] | undefined, timeValue?: string, frameTargetTimes?: number[]) => STACFrameItem[];
|
|
36
|
+
export declare const getStacFrameItemsToRender: (items: STACItem[] | undefined, timeValue?: string, frameTargetTimes?: number[], selectionBbox?: number[], frameTimeToleranceMs?: number, selectionTimeToleranceMs?: number) => STACFrameItem[];
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type Map from 'ol/Map';
|
|
2
|
+
export declare const STAC_TILED_MINIMUM_ZOOM = 10;
|
|
3
|
+
export declare const getStacViewportBbox: (map: Map) => number[] | undefined;
|
|
4
|
+
export declare const isStacViewportBboxQueryable: (bbox?: number[]) => bbox is number[];
|
|
5
|
+
export declare const getNextStacViewportBbox: (currentBbox: number[] | undefined, viewportBbox: number[], bufferRatio?: number) => number[];
|
|
6
|
+
export declare const useStacViewportBbox: (map: Map | null, enabled: boolean, minimumZoom?: number, bufferRatio?: number) => number[] | undefined;
|
|
@@ -7,6 +7,7 @@ export interface HoverSelect {
|
|
|
7
7
|
export interface ClickOnFeature {
|
|
8
8
|
onClick: (f: Feature[], isShiftClick?: boolean) => void;
|
|
9
9
|
hitTolerance?: number;
|
|
10
|
+
eventType?: 'click' | 'singleclick';
|
|
10
11
|
}
|
|
11
12
|
export interface BoxSelect {
|
|
12
13
|
onBoxSelect: (features: Feature[], addToSelection: boolean) => void;
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import type { Geometry } from 'geojson';
|
|
2
2
|
import type { LayerProps } from '@opengeoweb/webmap';
|
|
3
|
-
interface Properties {
|
|
3
|
+
interface Properties extends Record<string, unknown> {
|
|
4
4
|
datetime: string | null;
|
|
5
5
|
'proj:wkt2'?: string;
|
|
6
|
+
'proj:code'?: string;
|
|
7
|
+
'proj:epsg'?: number;
|
|
6
8
|
}
|
|
7
|
-
interface STACAsset {
|
|
9
|
+
export interface STACAsset {
|
|
8
10
|
href: string;
|
|
9
|
-
type
|
|
10
|
-
created
|
|
11
|
+
type?: string;
|
|
12
|
+
created?: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
roles?: string[];
|
|
11
15
|
}
|
|
16
|
+
export type STACItemAssets = Record<string, STACAsset>;
|
|
17
|
+
export type STACItemAssetDefinitions = Record<string, Omit<STACAsset, 'href'> & {
|
|
18
|
+
href?: string;
|
|
19
|
+
}>;
|
|
12
20
|
export interface STACExtent {
|
|
13
21
|
spatial?: {
|
|
14
22
|
bbox?: number[][];
|
|
@@ -20,6 +28,7 @@ export interface STACExtent {
|
|
|
20
28
|
export interface STACLink {
|
|
21
29
|
href: string;
|
|
22
30
|
rel: string;
|
|
31
|
+
method?: string;
|
|
23
32
|
}
|
|
24
33
|
export interface STACItem {
|
|
25
34
|
type: 'Feature';
|
|
@@ -29,7 +38,7 @@ export interface STACItem {
|
|
|
29
38
|
bbox: number[];
|
|
30
39
|
properties: Properties;
|
|
31
40
|
links: STACLink[];
|
|
32
|
-
assets
|
|
41
|
+
assets?: STACItemAssets;
|
|
33
42
|
}
|
|
34
43
|
export type STACColormapEntry = [number, number, number, number];
|
|
35
44
|
export interface STACRenderEntry {
|
|
@@ -49,11 +58,16 @@ export interface STACCollection {
|
|
|
49
58
|
extent: STACExtent;
|
|
50
59
|
links: STACLink[];
|
|
51
60
|
features: STACItem[];
|
|
61
|
+
numberMatched?: number;
|
|
62
|
+
numberReturned?: number;
|
|
52
63
|
renders?: Record<string, STACRenderEntry>;
|
|
64
|
+
item_assets?: STACItemAssetDefinitions;
|
|
53
65
|
}
|
|
54
66
|
export declare const STAC_ITEM_PAGE_LIMIT = 1000;
|
|
55
67
|
export declare const STAC_TEMPORAL_STEP_SAMPLE_LIMIT = 11;
|
|
56
|
-
export declare const getStacItemsUrl: (stacBaseUrlWithCollection: string, startDate?: string, endDate?: string) => string;
|
|
68
|
+
export declare const getStacItemsUrl: (stacBaseUrlWithCollection: string, startDate?: string, endDate?: string, bbox?: number[]) => string;
|
|
69
|
+
export declare const STAC_ITEM_SEARCH_FIELDS_CONFORMANCE = "https://api.stacspec.org/v1.0.0/item-search#fields";
|
|
70
|
+
export declare const getStacItemSearchUrl: (searchUrl: string, collectionId: string, startDate?: string, endDate?: string, bbox?: number[]) => string;
|
|
57
71
|
export declare const fetchStacCollection: (stacBaseUrlWithCollection: string) => Promise<STACCollection>;
|
|
58
72
|
export declare const fetchStacItem: (stacItemUrl: string) => Promise<STACItem>;
|
|
59
73
|
export declare const fetchStacItems: (collectionUrl: string) => Promise<STACItem[]>;
|
|
@@ -67,7 +81,7 @@ export declare const fetchStacItemsPage: (baseUrl: string, itemLimit?: number, o
|
|
|
67
81
|
* @param itemLimit - Max items per page (default: 1000)
|
|
68
82
|
* @returns Array of all fetched STAC items
|
|
69
83
|
*/
|
|
70
|
-
export declare const fetchStacItemsWithPagination: (baseUrl: string, itemLimit?: number) => Promise<STACItem[]>;
|
|
84
|
+
export declare const fetchStacItemsWithPagination: (baseUrl: string, itemLimit?: number, signal?: AbortSignal, maximumPages?: number) => Promise<STACItem[]>;
|
|
71
85
|
export interface STACCatalogCollection {
|
|
72
86
|
id: string;
|
|
73
87
|
title?: string;
|
|
@@ -76,6 +90,7 @@ export interface STACCatalogCollection {
|
|
|
76
90
|
keywords?: string[];
|
|
77
91
|
links: STACLink[];
|
|
78
92
|
renders?: Record<string, STACRenderEntry>;
|
|
93
|
+
item_assets?: STACItemAssetDefinitions;
|
|
79
94
|
}
|
|
80
95
|
export interface STACCatalogRoot {
|
|
81
96
|
type?: string;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
-
import type { STACCollection, STACItem } from './api';
|
|
2
|
+
import type { STACCatalogRoot, STACCollection, STACItem } from './api';
|
|
3
3
|
export declare const useStacCollection: (stacBaseUrlWithCollection: string, instanceId?: string, enabled?: boolean) => UseQueryResult<STACCollection, Error>;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const useStacCatalogRoot: (stacRootUrl: string, enabled?: boolean) => UseQueryResult<STACCatalogRoot, Error>;
|
|
5
|
+
export declare const useStacItems: (stacBaseUrlWithCollection: string, startDate?: string, endDate?: string, bbox?: number[], enabled?: boolean, itemLimit?: number, maximumPages?: number) => UseQueryResult<STACItem[], Error>;
|
|
6
|
+
export declare const useStacOverviewItems: (searchUrl: string, collectionId: string, startDate?: string, endDate?: string, bbox?: number[], enabled?: boolean, itemLimit?: number) => UseQueryResult<STACItem[], Error>;
|
|
5
7
|
export declare const useStacTemporalStepItems: (stacBaseUrlWithCollection: string, startDate?: string, endDate?: string, enabled?: boolean) => UseQueryResult<STACItem[], Error>;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import type { Style } from '@opengeoweb/webmap';
|
|
2
|
-
import type { STACColormapEntry, STACRenderEntry } from '../api';
|
|
2
|
+
import type { STACColormapEntry, STACItemAssetDefinitions, STACRenderEntry } from '../api';
|
|
3
|
+
export declare const STAC_ASSET_STYLE_PREFIX = "asset:";
|
|
4
|
+
export declare const getStacAssetKeyFromStyle: (styleName?: string) => string | undefined;
|
|
5
|
+
export declare const isGeoTIFFAsset: (asset: {
|
|
6
|
+
href?: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
}) => boolean;
|
|
9
|
+
export declare const isBrowserReadableGeoTIFFAsset: (asset: {
|
|
10
|
+
href?: string;
|
|
11
|
+
type?: string;
|
|
12
|
+
}) => boolean;
|
|
3
13
|
/**
|
|
4
14
|
* Converts a STAC render extension colormap to an OpenLayers WebGLTile palette style.
|
|
5
15
|
*
|
|
@@ -23,3 +33,10 @@ export declare const stacNormalizedGrayscaleOlStyle: () => object;
|
|
|
23
33
|
* compatible with the Layer Manager style selector.
|
|
24
34
|
*/
|
|
25
35
|
export declare const getRendersAsStyles: (renders: Record<string, STACRenderEntry>) => Style[];
|
|
36
|
+
export declare const getStacAssetStyles: (itemAssets?: STACItemAssetDefinitions) => Style[];
|
|
37
|
+
export declare const getStacCollectionStyles: (renders?: Record<string, STACRenderEntry>, itemAssets?: STACItemAssetDefinitions) => Style[];
|
|
38
|
+
export declare const resolveStacAssetKey: (assets: Record<string, {
|
|
39
|
+
href?: string;
|
|
40
|
+
type?: string;
|
|
41
|
+
roles?: string[];
|
|
42
|
+
}>, styleName?: string, renderAssets?: string[], configuredAssetKey?: string) => string | undefined;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import type { STACGeoTIFFLayerOptions } from '@opengeoweb/webmap';
|
|
1
2
|
import type { STACCollection, STACItem } from '../api';
|
|
3
|
+
export declare const isSpatiallyTiledStacCollection: (dataLayout: STACGeoTIFFLayerOptions["dataLayout"], hasItemAssets: boolean, sampleItems?: STACItem[]) => boolean;
|
|
2
4
|
/**
|
|
3
5
|
* Infers the temporal step (time resolution) from STAC collection metadata and items.
|
|
4
6
|
* Attempts multiple strategies:
|
|
5
7
|
* 1. Look for 'temporal-resolution' in collection properties
|
|
6
|
-
* 2.
|
|
7
|
-
* 3.
|
|
8
|
+
* 2. Use a daily step for spatially tiled collections
|
|
9
|
+
* 3. Calculate from actual item timestamps
|
|
10
|
+
* 4. Fall back to PT1H if unable to determine
|
|
8
11
|
*
|
|
9
12
|
* @param collection - STAC collection with metadata and items
|
|
10
13
|
* @returns ISO 8601 duration string (e.g., 'PT5M', 'PT1H', 'P1D')
|
|
11
14
|
*/
|
|
12
|
-
export declare const inferTemporalStep: (collection: STACCollection | undefined, items?: STACItem[]) => string;
|
|
15
|
+
export declare const inferTemporalStep: (collection: STACCollection | undefined, items?: STACItem[], dataLayout?: STACGeoTIFFLayerOptions["dataLayout"]) => string;
|
|
13
16
|
/**
|
|
14
17
|
* Converts milliseconds to ISO 8601 duration string
|
|
15
18
|
* @param ms - Duration in milliseconds
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const resolvePreferredStyleName: (styleNames: string[], currentStyle?: string) => string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { WMLayer } from '@opengeoweb/webmap';
|
|
2
|
+
import type { STACGeoTIFFLayerOptions } from '@opengeoweb/webmap';
|
|
2
3
|
import type { OnInitializeLayerProps } from '../../components/OpenLayers/utils/types';
|
|
3
4
|
/**
|
|
4
5
|
* Returns WMLayer instance in STAC GeoTIFF mode. The layer will contains parsed dimensions and styles and keeps a state for these properties.
|
|
@@ -8,4 +9,4 @@ import type { OnInitializeLayerProps } from '../../components/OpenLayers/utils/t
|
|
|
8
9
|
* @returns {(WMLayer | null)}
|
|
9
10
|
*/
|
|
10
11
|
export declare const useGetStacGeoTIFFWMLayerInstance: (serviceUrl: string, name: string, id?: string, onLayerError?: (layerId: string, message: string) => void) => WMLayer | null;
|
|
11
|
-
export declare const useGetStacGeoTIFFLayerInstance: (stacCollectionURL: string, parameter: string, layerId?: string, onInitializeLayer?: (payload: OnInitializeLayerProps) => void) => WMLayer | null;
|
|
12
|
+
export declare const useGetStacGeoTIFFLayerInstance: (stacCollectionURL: string, parameter: string, layerId?: string, onInitializeLayer?: (payload: OnInitializeLayerProps) => void, configuredTemporalStep?: string, dataLayout?: STACGeoTIFFLayerOptions["dataLayout"]) => WMLayer | null;
|