@developmentseed/deck.gl-geotiff 0.2.0 → 0.3.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/README.md +33 -4
- package/dist/cog-layer.d.ts +63 -57
- package/dist/cog-layer.d.ts.map +1 -1
- package/dist/cog-layer.js +116 -85
- package/dist/cog-layer.js.map +1 -1
- package/dist/geotiff/geotiff.d.ts +5 -43
- package/dist/geotiff/geotiff.d.ts.map +1 -1
- package/dist/geotiff/geotiff.js +34 -103
- package/dist/geotiff/geotiff.js.map +1 -1
- package/dist/geotiff/render-pipeline.d.ts +7 -5
- package/dist/geotiff/render-pipeline.d.ts.map +1 -1
- package/dist/geotiff/render-pipeline.js +152 -49
- package/dist/geotiff/render-pipeline.js.map +1 -1
- package/dist/geotiff/texture.d.ts +5 -4
- package/dist/geotiff/texture.d.ts.map +1 -1
- package/dist/geotiff/texture.js +7 -7
- package/dist/geotiff/texture.js.map +1 -1
- package/dist/geotiff-layer.d.ts +21 -24
- package/dist/geotiff-layer.d.ts.map +1 -1
- package/dist/geotiff-layer.js +25 -21
- package/dist/geotiff-layer.js.map +1 -1
- package/dist/geotiff-reprojection.d.ts +5 -18
- package/dist/geotiff-reprojection.d.ts.map +1 -1
- package/dist/geotiff-reprojection.js +9 -126
- package/dist/geotiff-reprojection.js.map +1 -1
- package/dist/index.d.ts +3 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -7
- package/dist/index.js.map +1 -1
- package/dist/proj.d.ts +3 -23
- package/dist/proj.d.ts.map +1 -1
- package/dist/proj.js +20 -38
- package/dist/proj.js.map +1 -1
- package/package.json +16 -12
- package/dist/cog-tile-matrix-set.d.ts +0 -32
- package/dist/cog-tile-matrix-set.d.ts.map +0 -1
- package/dist/cog-tile-matrix-set.js +0 -180
- package/dist/cog-tile-matrix-set.js.map +0 -1
- package/dist/ellipsoids.d.ts +0 -153
- package/dist/ellipsoids.d.ts.map +0 -1
- package/dist/ellipsoids.js +0 -153
- package/dist/ellipsoids.js.map +0 -1
- package/dist/geotiff/types.d.ts +0 -34
- package/dist/geotiff/types.d.ts.map +0 -1
- package/dist/geotiff/types.js +0 -18
- package/dist/geotiff/types.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
# @developmentseed/deck.gl-geotiff
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
High-level API for rendering [Cloud-Optimized GeoTIFFs] in deck.gl.
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
|
|
5
|
+
[Cloud-Optimized GeoTIFFs]: https://cogeo.org/
|
|
6
|
+
|
|
7
|
+
This uses `@developmentseed/geotiff` and [`@cogeotiff/core`] to efficiently read Cloud-Optimized GeoTIFFs from the browser.
|
|
8
|
+
|
|
9
|
+
[`@cogeotiff/core`]: https://github.com/blacha/cogeotiff
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Deck } from '@deck.gl/core';
|
|
15
|
+
import { COGLayer } from '@developmentseed/deck.gl-geotiff';
|
|
16
|
+
|
|
17
|
+
new Deck({
|
|
18
|
+
initialViewState: {
|
|
19
|
+
longitude: 0,
|
|
20
|
+
latitude: 0,
|
|
21
|
+
zoom: 2
|
|
22
|
+
},
|
|
23
|
+
controller: true,
|
|
24
|
+
layers: [
|
|
25
|
+
new COGLayer({
|
|
26
|
+
id: 'cog-layer',
|
|
27
|
+
geotiff: 'https://example.com/my-cog.tif'
|
|
28
|
+
})
|
|
29
|
+
]
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The {@link COGLayer} is the recommended layer for rendering Cloud-Optimized GeoTIFFs. It leverages deck.gl's [`TileLayer`] to match the internal COG structure, automatically fetching appropriate overviews based on zoom level.
|
|
34
|
+
|
|
35
|
+
[`TileLayer`]: https://deck.gl/docs/api-reference/geo-layers/tile-layer
|
package/dist/cog-layer.d.ts
CHANGED
|
@@ -2,12 +2,14 @@ import type { CompositeLayerProps, Layer, LayersList, UpdateParameters } from "@
|
|
|
2
2
|
import { CompositeLayer } from "@deck.gl/core";
|
|
3
3
|
import type { _Tile2DHeader as Tile2DHeader, TileLayerProps, _TileLoadProps as TileLoadProps } from "@deck.gl/geo-layers";
|
|
4
4
|
import { TileLayer } from "@deck.gl/geo-layers";
|
|
5
|
-
import type { RasterModule
|
|
5
|
+
import type { RasterModule } from "@developmentseed/deck.gl-raster";
|
|
6
|
+
import type { DecoderPool, GeoTIFF, Overview } from "@developmentseed/geotiff";
|
|
7
|
+
import type { TileMatrixSet } from "@developmentseed/morecantile";
|
|
6
8
|
import type { ReprojectionFns } from "@developmentseed/raster-reproject";
|
|
7
|
-
import type { Device } from "@luma.gl/core";
|
|
8
|
-
import type {
|
|
9
|
+
import type { Device, Texture } from "@luma.gl/core";
|
|
10
|
+
import type { ProjectionDefinition } from "wkt-parser";
|
|
9
11
|
import type { TextureDataT } from "./geotiff/render-pipeline.js";
|
|
10
|
-
import type {
|
|
12
|
+
import type { EpsgResolver } from "./proj.js";
|
|
11
13
|
/**
|
|
12
14
|
* Minimum interface that **must** be returned from getTileData.
|
|
13
15
|
*/
|
|
@@ -15,78 +17,82 @@ export type MinimalDataT = {
|
|
|
15
17
|
height: number;
|
|
16
18
|
width: number;
|
|
17
19
|
};
|
|
18
|
-
|
|
19
|
-
texture:
|
|
20
|
+
type DefaultDataT = MinimalDataT & {
|
|
21
|
+
texture: Texture;
|
|
20
22
|
};
|
|
21
23
|
/** Options passed to `getTileData`. */
|
|
22
24
|
export type GetTileDataOptions = {
|
|
23
25
|
/** The luma.gl Device */
|
|
24
26
|
device: Device;
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
+
/** The x coordinate of the tile within the IFD. */
|
|
28
|
+
x: number;
|
|
29
|
+
/** The y coordinate of the tile within the IFD. */
|
|
30
|
+
y: number;
|
|
27
31
|
/** An AbortSignal that may be signalled if the request is to be aborted */
|
|
28
32
|
signal?: AbortSignal;
|
|
29
33
|
/** The decoder pool to use. */
|
|
30
|
-
pool:
|
|
34
|
+
pool: DecoderPool;
|
|
31
35
|
};
|
|
32
36
|
type GetTileDataResult<DataT> = {
|
|
33
37
|
data: DataT;
|
|
34
38
|
forwardTransform: ReprojectionFns["forwardTransform"];
|
|
35
39
|
inverseTransform: ReprojectionFns["inverseTransform"];
|
|
36
40
|
};
|
|
37
|
-
|
|
41
|
+
type COGLayerDataProps<DataT extends MinimalDataT> = {
|
|
38
42
|
/**
|
|
39
|
-
*
|
|
43
|
+
* User-defined method to load data for a tile.
|
|
40
44
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* - An instance of GeoTIFF.js's GeoTIFF class
|
|
45
|
-
* - An instance of GeoTIFF.js's BaseClient for custom fetching
|
|
45
|
+
* Must be provided together with `renderTile`. If neither is provided,
|
|
46
|
+
* the default pipeline is used, which fetches the tile, uploads it as a
|
|
47
|
+
* GPU texture, and renders it using an inferred shader pipeline.
|
|
46
48
|
*/
|
|
47
|
-
|
|
49
|
+
getTileData: (image: GeoTIFF | Overview, options: GetTileDataOptions) => Promise<DataT>;
|
|
48
50
|
/**
|
|
49
|
-
*
|
|
50
|
-
* definition.
|
|
51
|
+
* User-defined method to render data for a tile.
|
|
51
52
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* more extensive but adds 1.5MB to your bundle size.
|
|
53
|
+
* Must be provided together with `getTileData`. Receives the value
|
|
54
|
+
* returned by `getTileData` and must return a render pipeline.
|
|
55
55
|
*/
|
|
56
|
-
|
|
56
|
+
renderTile: (data: DataT) => ImageData | RasterModule[];
|
|
57
|
+
} | {
|
|
58
|
+
getTileData?: undefined;
|
|
59
|
+
renderTile?: undefined;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Props that can be passed into the {@link COGLayer}.
|
|
63
|
+
*/
|
|
64
|
+
export type COGLayerProps<DataT extends MinimalDataT = DefaultDataT> = CompositeLayerProps & COGLayerDataProps<DataT> & {
|
|
57
65
|
/**
|
|
58
|
-
* GeoTIFF
|
|
66
|
+
* Cloud-optimized GeoTIFF input.
|
|
67
|
+
*
|
|
68
|
+
* - {@link URL} or `string` pointing to a COG
|
|
69
|
+
* - {@link ArrayBuffer} containing the COG data
|
|
70
|
+
* - An instance of the {@link GeoTIFF} class.
|
|
71
|
+
*/
|
|
72
|
+
geotiff: GeoTIFF | string | URL | ArrayBuffer;
|
|
73
|
+
/**
|
|
74
|
+
* A function callback for parsing numeric EPSG codes to projection
|
|
75
|
+
* information (as returned by `wkt-parser`).
|
|
76
|
+
*
|
|
77
|
+
* The default implementation:
|
|
78
|
+
* - makes a request to epsg.io to resolve EPSG codes found in the GeoTIFF.
|
|
79
|
+
* - caches any previous requests
|
|
80
|
+
* - parses PROJJSON response with `wkt-parser`
|
|
81
|
+
*/
|
|
82
|
+
epsgResolver?: EpsgResolver;
|
|
83
|
+
/**
|
|
84
|
+
* Worker pool for decoding image chunks.
|
|
59
85
|
*
|
|
60
86
|
* If none is provided, a default Pool will be created and shared between all
|
|
61
87
|
* COGLayer and GeoTIFFLayer instances.
|
|
62
88
|
*/
|
|
63
|
-
pool?:
|
|
89
|
+
pool?: DecoderPool;
|
|
64
90
|
/**
|
|
65
91
|
* Maximum reprojection error in pixels for mesh refinement.
|
|
66
92
|
* Lower values create denser meshes with higher accuracy.
|
|
67
93
|
* @default 0.125
|
|
68
94
|
*/
|
|
69
95
|
maxError?: number;
|
|
70
|
-
/**
|
|
71
|
-
* User-defined method to load data for a tile.
|
|
72
|
-
*
|
|
73
|
-
* The default implementation loads an RGBA image using geotiff.js's readRGB
|
|
74
|
-
* method, returning an ImageData object.
|
|
75
|
-
*
|
|
76
|
-
* For more customizability, you can also return a Texture object from
|
|
77
|
-
* luma.gl, along with optional custom shaders for the RasterLayer.
|
|
78
|
-
*/
|
|
79
|
-
getTileData?: (image: GeoTIFFImage, options: GetTileDataOptions) => Promise<DataT>;
|
|
80
|
-
/**
|
|
81
|
-
* User-defined method to render data for a tile.
|
|
82
|
-
*
|
|
83
|
-
* This receives the data returned by getTileData and must return a render
|
|
84
|
-
* pipeline.
|
|
85
|
-
*
|
|
86
|
-
* The default implementation returns an object with a `texture` property,
|
|
87
|
-
* assuming that this texture is already renderable.
|
|
88
|
-
*/
|
|
89
|
-
renderTile: (data: DataT) => ImageData | RasterModule[];
|
|
90
96
|
/**
|
|
91
97
|
* Enable debug visualization showing the triangulation mesh
|
|
92
98
|
* @default false
|
|
@@ -99,12 +105,9 @@ export interface COGLayerProps<DataT extends MinimalDataT = DefaultDataT> extend
|
|
|
99
105
|
debugOpacity?: number;
|
|
100
106
|
/**
|
|
101
107
|
* Called when the GeoTIFF metadata has been loaded and parsed.
|
|
102
|
-
*
|
|
103
|
-
* @param {GeoTIFF} geotiff
|
|
104
|
-
* @param {ProjectionInfo} projection
|
|
105
108
|
*/
|
|
106
109
|
onGeoTIFFLoad?: (geotiff: GeoTIFF, options: {
|
|
107
|
-
projection:
|
|
110
|
+
projection: ProjectionDefinition;
|
|
108
111
|
/**
|
|
109
112
|
* Bounds of the image in geographic coordinates (WGS84) [minLon, minLat,
|
|
110
113
|
* maxLon, maxLat]
|
|
@@ -123,7 +126,7 @@ export interface COGLayerProps<DataT extends MinimalDataT = DefaultDataT> extend
|
|
|
123
126
|
* automatically aborted.
|
|
124
127
|
*/
|
|
125
128
|
signal?: AbortSignal;
|
|
126
|
-
}
|
|
129
|
+
};
|
|
127
130
|
/**
|
|
128
131
|
* COGLayer renders a COG using a tiled approach with reprojection.
|
|
129
132
|
*/
|
|
@@ -131,27 +134,30 @@ export declare class COGLayer<DataT extends MinimalDataT = DefaultDataT> extends
|
|
|
131
134
|
static layerName: string;
|
|
132
135
|
static defaultProps: Partial<COGLayerProps<DefaultDataT>>;
|
|
133
136
|
state: {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
geotiff: GeoTIFF;
|
|
138
|
+
forwardTo4326?: ReprojectionFns["forwardReproject"];
|
|
139
|
+
inverseFrom4326?: ReprojectionFns["inverseReproject"];
|
|
140
|
+
forwardTo3857?: ReprojectionFns["forwardReproject"];
|
|
141
|
+
tms?: TileMatrixSet;
|
|
138
142
|
defaultGetTileData?: COGLayerProps<TextureDataT>["getTileData"];
|
|
139
143
|
defaultRenderTile?: COGLayerProps<TextureDataT>["renderTile"];
|
|
140
144
|
};
|
|
141
145
|
initializeState(): void;
|
|
142
146
|
updateState(params: UpdateParameters<this>): void;
|
|
147
|
+
clearState(): void;
|
|
143
148
|
_parseGeoTIFF(): Promise<void>;
|
|
144
149
|
/**
|
|
145
150
|
* Inner callback passed in to the underlying TileLayer's `getTileData`.
|
|
146
151
|
*/
|
|
147
|
-
_getTileData(tile: TileLoadProps,
|
|
152
|
+
_getTileData(tile: TileLoadProps, geotiff: GeoTIFF, tms: TileMatrixSet): Promise<GetTileDataResult<DataT>>;
|
|
148
153
|
_renderSubLayers(props: TileLayerProps<GetTileDataResult<DataT>> & {
|
|
149
154
|
id: string;
|
|
150
155
|
data?: GetTileDataResult<DataT>;
|
|
151
156
|
_offset: number;
|
|
152
157
|
tile: Tile2DHeader<GetTileDataResult<DataT>>;
|
|
153
|
-
},
|
|
154
|
-
|
|
158
|
+
}, tms: TileMatrixSet, forwardTo4326: ReprojectionFns["forwardReproject"], inverseFrom4326: ReprojectionFns["inverseReproject"]): Layer | LayersList | null;
|
|
159
|
+
/** Define the underlying deck.gl TileLayer. */
|
|
160
|
+
renderTileLayer(tms: TileMatrixSet, forwardTo4326: ReprojectionFns["forwardReproject"], inverseFrom4326: ReprojectionFns["inverseReproject"], forwardTo3857: ReprojectionFns["forwardReproject"], geotiff: GeoTIFF): TileLayer;
|
|
155
161
|
renderLayers(): TileLayer<any, {}> | null;
|
|
156
162
|
}
|
|
157
163
|
export {};
|
package/dist/cog-layer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cog-layer.d.ts","sourceRoot":"","sources":["../src/cog-layer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,KAAK,EACL,UAAU,EACV,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EACV,aAAa,IAAI,YAAY,EAC7B,cAAc,EACd,cAAc,IAAI,aAAa,EAEhC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"cog-layer.d.ts","sourceRoot":"","sources":["../src/cog-layer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,KAAK,EACL,UAAU,EACV,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EACV,aAAa,IAAI,YAAY,EAC7B,cAAc,EACd,cAAc,IAAI,aAAa,EAEhC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAKpE,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAK/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAGjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,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AC/D,CAAC;IAEO,eAAe,IAAI,IAAI;IAIvB,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAgBnD,UAAU;IAYJ,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAiDpC;;OAEG;IACG,YAAY,CAChB,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAuDpC,gBAAgB,CAGd,KAAK,EAAE,cAAc,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,GAAG;QAChD,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAChC,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,YAAY,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;KAC9C,EACD,GAAG,EAAE,aAAa,EAClB,aAAa,EAAE,eAAe,CAAC,kBAAkB,CAAC,EAClD,eAAe,EAAE,eAAe,CAAC,kBAAkB,CAAC,GACnD,KAAK,GAAG,UAAU,GAAG,IAAI;IAkG5B,+CAA+C;IAC/C,eAAe,CACb,GAAG,EAAE,aAAa,EAClB,aAAa,EAAE,eAAe,CAAC,kBAAkB,CAAC,EAClD,eAAe,EAAE,eAAe,CAAC,kBAAkB,CAAC,EACpD,aAAa,EAAE,eAAe,CAAC,kBAAkB,CAAC,EAClD,OAAO,EAAE,OAAO,GACf,SAAS;IAoBZ,YAAY;CAyBb"}
|
package/dist/cog-layer.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { CompositeLayer } from "@deck.gl/core";
|
|
2
2
|
import { TileLayer } from "@deck.gl/geo-layers";
|
|
3
3
|
import { PathLayer } from "@deck.gl/layers";
|
|
4
|
-
import { RasterLayer,
|
|
4
|
+
import { RasterLayer, TileMatrixSetTileset, } from "@developmentseed/deck.gl-raster";
|
|
5
|
+
import { defaultDecoderPool, generateTileMatrixSet, } from "@developmentseed/geotiff";
|
|
6
|
+
import { tileTransform } from "@developmentseed/morecantile";
|
|
5
7
|
import proj4 from "proj4";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
+
import wktParser from "wkt-parser";
|
|
9
|
+
import { fetchGeoTIFF, getGeographicBounds } from "./geotiff/geotiff.js";
|
|
8
10
|
import { inferRenderPipeline } from "./geotiff/render-pipeline.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
+
import { fromAffine } from "./geotiff-reprojection.js";
|
|
12
|
+
import { epsgResolver } from "./proj.js";
|
|
11
13
|
const defaultProps = {
|
|
12
|
-
|
|
14
|
+
epsgResolver,
|
|
13
15
|
debug: false,
|
|
14
16
|
debugOpacity: 0.5,
|
|
15
17
|
};
|
|
@@ -27,76 +29,101 @@ export class COGLayer extends CompositeLayer {
|
|
|
27
29
|
const { props, oldProps, changeFlags } = params;
|
|
28
30
|
const needsUpdate = Boolean(changeFlags.dataChanged) || props.geotiff !== oldProps.geotiff;
|
|
29
31
|
if (needsUpdate) {
|
|
32
|
+
// Clear stale state so renderLayers returns null until the new GeoTIFF is
|
|
33
|
+
// ready
|
|
34
|
+
this.clearState();
|
|
30
35
|
this._parseGeoTIFF();
|
|
31
36
|
}
|
|
32
37
|
}
|
|
38
|
+
clearState() {
|
|
39
|
+
this.setState({
|
|
40
|
+
geotiff: undefined,
|
|
41
|
+
tms: undefined,
|
|
42
|
+
forwardTo4326: undefined,
|
|
43
|
+
inverseFrom4326: undefined,
|
|
44
|
+
forwardTo3857: undefined,
|
|
45
|
+
defaultGetTileData: undefined,
|
|
46
|
+
defaultRenderTile: undefined,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
33
49
|
async _parseGeoTIFF() {
|
|
34
50
|
const geotiff = await fetchGeoTIFF(this.props.geotiff);
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const inverseReproject = (x, y) => converter.inverse([x, y], false);
|
|
51
|
+
const crs = geotiff.crs;
|
|
52
|
+
const sourceProjection = typeof crs === "number"
|
|
53
|
+
? await this.props.epsgResolver(crs)
|
|
54
|
+
: wktParser(crs);
|
|
55
|
+
const tms = generateTileMatrixSet(geotiff, sourceProjection);
|
|
56
|
+
// @ts-expect-error - proj4 typings are incomplete and don't support
|
|
57
|
+
// wkt-parser input
|
|
58
|
+
const converter4326 = proj4(sourceProjection, "EPSG:4326");
|
|
59
|
+
const forwardTo4326 = (x, y) => converter4326.forward([x, y], false);
|
|
60
|
+
const inverseFrom4326 = (x, y) => converter4326.inverse([x, y], false);
|
|
61
|
+
// @ts-expect-error - proj4 typings are incomplete and don't support
|
|
62
|
+
// wkt-parser input
|
|
63
|
+
const converter3857 = proj4(sourceProjection, "EPSG:3857");
|
|
64
|
+
const forwardTo3857 = (x, y) => converter3857.forward([x, y], false);
|
|
50
65
|
if (this.props.onGeoTIFFLoad) {
|
|
51
|
-
const geographicBounds = getGeographicBounds(
|
|
66
|
+
const geographicBounds = getGeographicBounds(geotiff, converter4326);
|
|
52
67
|
this.props.onGeoTIFFLoad(geotiff, {
|
|
53
68
|
projection: sourceProjection,
|
|
54
69
|
geographicBounds,
|
|
55
70
|
});
|
|
56
71
|
}
|
|
57
|
-
|
|
72
|
+
// Only create a default render pipeline if the user did not provide a
|
|
73
|
+
// custom one
|
|
74
|
+
if (!this.props.getTileData || !this.props.renderTile) {
|
|
75
|
+
const { getTileData: defaultGetTileData, renderTile: defaultRenderTile } = inferRenderPipeline(geotiff, this.context.device);
|
|
76
|
+
this.setState({ defaultGetTileData, defaultRenderTile });
|
|
77
|
+
}
|
|
58
78
|
this.setState({
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
defaultRenderTile,
|
|
79
|
+
geotiff,
|
|
80
|
+
tms,
|
|
81
|
+
forwardTo4326,
|
|
82
|
+
inverseFrom4326,
|
|
83
|
+
forwardTo3857,
|
|
65
84
|
});
|
|
66
85
|
}
|
|
67
86
|
/**
|
|
68
87
|
* Inner callback passed in to the underlying TileLayer's `getTileData`.
|
|
69
88
|
*/
|
|
70
|
-
async _getTileData(tile,
|
|
89
|
+
async _getTileData(tile, geotiff, tms) {
|
|
71
90
|
const { signal } = tile;
|
|
72
91
|
const { x, y, z } = tile.index;
|
|
73
92
|
// Select overview image
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Math.min((y + 1) * tileHeight, imageHeight),
|
|
86
|
-
];
|
|
87
|
-
const getTileData = this.props.getTileData || this.state.defaultGetTileData;
|
|
93
|
+
// If z=0, use the coarsest overview (which is the last in the array)
|
|
94
|
+
// If z=max, use the full-resolution image (which is the first in the array)
|
|
95
|
+
// TODO: should be able to (micro) optimize this to not create the array
|
|
96
|
+
// Something like:
|
|
97
|
+
// const image = z === geotiff.overviews.length - 1 ? geotiff :
|
|
98
|
+
// geotiff.overviews[geotiff.overviews.length - 1 - z]!;
|
|
99
|
+
const images = [geotiff, ...geotiff.overviews];
|
|
100
|
+
const image = images[images.length - 1 - z];
|
|
101
|
+
const tileMatrix = tms.tileMatrices[z];
|
|
102
|
+
const tileAffine = tileTransform(tileMatrix, { col: x, row: y });
|
|
103
|
+
const { forwardTransform, inverseTransform } = fromAffine(tileAffine);
|
|
88
104
|
// Combine abort signals if both are defined
|
|
89
105
|
const combinedSignal = signal && this.props.signal
|
|
90
106
|
? AbortSignal.any([signal, this.props.signal])
|
|
91
107
|
: signal || this.props.signal;
|
|
92
|
-
const
|
|
108
|
+
const getTileDataProps = {
|
|
93
109
|
device: this.context.device,
|
|
94
|
-
|
|
110
|
+
x,
|
|
111
|
+
y,
|
|
95
112
|
signal: combinedSignal,
|
|
96
|
-
pool: this.props.pool
|
|
97
|
-
}
|
|
113
|
+
pool: this.props.pool ?? defaultDecoderPool(),
|
|
114
|
+
};
|
|
115
|
+
let data;
|
|
116
|
+
if (this.props.getTileData) {
|
|
117
|
+
// In the case that the user passed in a custom `getTileData`, TS knows
|
|
118
|
+
// that `DataT` is the return type of that function
|
|
119
|
+
data = await this.props.getTileData(image, getTileDataProps);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
// In the case where the user did not pass in a custom `getTileData`, we
|
|
123
|
+
// have to tell TS that `DefaultDataT` is assignable to `DataT`
|
|
124
|
+
data = (await this.state.defaultGetTileData(image, getTileDataProps));
|
|
125
|
+
}
|
|
98
126
|
return {
|
|
99
|
-
// @ts-expect-error type mismatch when using provided getTileData
|
|
100
127
|
data,
|
|
101
128
|
forwardTransform,
|
|
102
129
|
inverseTransform,
|
|
@@ -105,7 +132,7 @@ export class COGLayer extends CompositeLayer {
|
|
|
105
132
|
_renderSubLayers(
|
|
106
133
|
// TODO: it would be nice to have a cleaner type here
|
|
107
134
|
// this is copy-pasted from the upstream tile layer definition for props.
|
|
108
|
-
props,
|
|
135
|
+
props, tms, forwardTo4326, inverseFrom4326) {
|
|
109
136
|
const { maxError, debug, debugOpacity } = this.props;
|
|
110
137
|
const { tile } = props;
|
|
111
138
|
if (!props.data) {
|
|
@@ -115,37 +142,48 @@ export class COGLayer extends CompositeLayer {
|
|
|
115
142
|
const layers = [];
|
|
116
143
|
if (data) {
|
|
117
144
|
const { height, width } = data;
|
|
118
|
-
|
|
119
|
-
|
|
145
|
+
let renderPipeline;
|
|
146
|
+
if (this.props.getTileData) {
|
|
147
|
+
// In the case that the user passed in a custom `getTileData`, TS knows
|
|
148
|
+
// that `data` can be passed in to `renderTile`.
|
|
149
|
+
renderPipeline = this.props.renderTile(data);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
// In the default case, `data` is `DefaultDataT` — cast required because
|
|
153
|
+
// TS can't prove that `DataT` (which defaults to `DefaultDataT`) is
|
|
154
|
+
// `DefaultDataT` at this point.
|
|
155
|
+
renderPipeline = this.state.defaultRenderTile(data);
|
|
156
|
+
}
|
|
157
|
+
layers.push(new RasterLayer(this.getSubLayerProps({
|
|
120
158
|
id: `${props.id}-raster`,
|
|
121
159
|
width,
|
|
122
160
|
height,
|
|
123
|
-
renderPipeline
|
|
161
|
+
renderPipeline,
|
|
124
162
|
maxError,
|
|
125
163
|
reprojectionFns: {
|
|
126
164
|
forwardTransform,
|
|
127
165
|
inverseTransform,
|
|
128
|
-
forwardReproject,
|
|
129
|
-
inverseReproject,
|
|
166
|
+
forwardReproject: forwardTo4326,
|
|
167
|
+
inverseReproject: inverseFrom4326,
|
|
130
168
|
},
|
|
131
169
|
debug,
|
|
132
170
|
debugOpacity,
|
|
133
|
-
}));
|
|
171
|
+
})));
|
|
134
172
|
}
|
|
135
173
|
if (debug) {
|
|
136
174
|
// Get projected bounds from tile data
|
|
137
175
|
// getTileMetadata returns data that includes projectedBounds
|
|
138
176
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
139
177
|
const projectedBounds = tile?.projectedBounds;
|
|
140
|
-
if (!projectedBounds || !
|
|
178
|
+
if (!projectedBounds || !tms) {
|
|
141
179
|
return [];
|
|
142
180
|
}
|
|
143
181
|
// Project bounds from image CRS to WGS84
|
|
144
182
|
const { topLeft, topRight, bottomLeft, bottomRight } = projectedBounds;
|
|
145
|
-
const topLeftWgs84 =
|
|
146
|
-
const topRightWgs84 =
|
|
147
|
-
const bottomRightWgs84 =
|
|
148
|
-
const bottomLeftWgs84 =
|
|
183
|
+
const topLeftWgs84 = forwardTo4326(topLeft[0], topLeft[1]);
|
|
184
|
+
const topRightWgs84 = forwardTo4326(topRight[0], topRight[1]);
|
|
185
|
+
const bottomRightWgs84 = forwardTo4326(bottomRight[0], bottomRight[1]);
|
|
186
|
+
const bottomLeftWgs84 = forwardTo4326(bottomLeft[0], bottomLeft[1]);
|
|
149
187
|
// Create a closed path around the tile bounds
|
|
150
188
|
const path = [
|
|
151
189
|
topLeftWgs84,
|
|
@@ -166,44 +204,37 @@ export class COGLayer extends CompositeLayer {
|
|
|
166
204
|
}
|
|
167
205
|
return layers;
|
|
168
206
|
}
|
|
169
|
-
|
|
207
|
+
/** Define the underlying deck.gl TileLayer. */
|
|
208
|
+
renderTileLayer(tms, forwardTo4326, inverseFrom4326, forwardTo3857, geotiff) {
|
|
170
209
|
// Create a factory class that wraps COGTileset2D with the metadata
|
|
171
|
-
class
|
|
210
|
+
class TileMatrixSetTilesetFactory extends TileMatrixSetTileset {
|
|
172
211
|
constructor(opts) {
|
|
173
|
-
super(
|
|
212
|
+
super(opts, tms, {
|
|
213
|
+
projectTo4326: forwardTo4326,
|
|
214
|
+
projectTo3857: forwardTo3857,
|
|
215
|
+
});
|
|
174
216
|
}
|
|
175
217
|
}
|
|
176
218
|
return new TileLayer({
|
|
177
219
|
id: `cog-tile-layer-${this.id}`,
|
|
178
|
-
TilesetClass:
|
|
179
|
-
getTileData: async (tile) => this._getTileData(tile,
|
|
180
|
-
renderSubLayers: (props) => this._renderSubLayers(props,
|
|
220
|
+
TilesetClass: TileMatrixSetTilesetFactory,
|
|
221
|
+
getTileData: async (tile) => this._getTileData(tile, geotiff, tms),
|
|
222
|
+
renderSubLayers: (props) => this._renderSubLayers(props, tms, forwardTo4326, inverseFrom4326),
|
|
181
223
|
});
|
|
182
224
|
}
|
|
183
225
|
renderLayers() {
|
|
184
|
-
const {
|
|
185
|
-
if (!
|
|
226
|
+
const { forwardTo4326, inverseFrom4326, forwardTo3857, tms, geotiff } = this.state;
|
|
227
|
+
if (!forwardTo4326 ||
|
|
228
|
+
!inverseFrom4326 ||
|
|
229
|
+
!forwardTo3857 ||
|
|
230
|
+
!tms ||
|
|
231
|
+
!geotiff) {
|
|
186
232
|
return null;
|
|
187
233
|
}
|
|
188
234
|
// Split into a separate method to make TS happy, because when metadata is
|
|
189
235
|
// nullable in any part of function scope, the tileset factory wrapper gives
|
|
190
236
|
// a type error
|
|
191
|
-
return this.renderTileLayer(
|
|
237
|
+
return this.renderTileLayer(tms, forwardTo4326, inverseFrom4326, forwardTo3857, geotiff);
|
|
192
238
|
}
|
|
193
239
|
}
|
|
194
|
-
/**
|
|
195
|
-
* Compute the affine geotransform for this tile.
|
|
196
|
-
*
|
|
197
|
-
* We need to offset the geotransform for the matrix level by the tile's pixel
|
|
198
|
-
* origin.
|
|
199
|
-
*/
|
|
200
|
-
function computeTileGeotransform(x, y, tileMatrix) {
|
|
201
|
-
const { tileWidth, tileHeight } = tileMatrix;
|
|
202
|
-
const xPixelOrigin = x * tileWidth;
|
|
203
|
-
const yPixelOrigin = y * tileHeight;
|
|
204
|
-
const [a, b, c, d, e, f] = tileMatrix.geotransform;
|
|
205
|
-
const xCoordOffset = a * xPixelOrigin + b * yPixelOrigin + c;
|
|
206
|
-
const yCoordOffset = d * xPixelOrigin + e * yPixelOrigin + f;
|
|
207
|
-
return [a, b, xCoordOffset, d, e, yCoordOffset];
|
|
208
|
-
}
|
|
209
240
|
//# sourceMappingURL=cog-layer.js.map
|
package/dist/cog-layer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cog-layer.js","sourceRoot":"","sources":["../src/cog-layer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAO/C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"cog-layer.js","sourceRoot":"","sources":["../src/cog-layer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAO/C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,SAAS,E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