@developmentseed/deck.gl-geotiff 0.1.0-beta.6 → 0.1.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/cog-layer.d.ts +107 -9
- package/dist/cog-layer.d.ts.map +1 -1
- package/dist/cog-layer.js +122 -95
- package/dist/cog-layer.js.map +1 -1
- package/dist/cog-tile-matrix-set.d.ts +2 -1
- package/dist/cog-tile-matrix-set.d.ts.map +1 -1
- package/dist/cog-tile-matrix-set.js +20 -23
- package/dist/cog-tile-matrix-set.js.map +1 -1
- package/dist/ellipsoids.d.ts +1 -1
- package/dist/ellipsoids.js +1 -1
- package/dist/geotiff/geotiff.d.ts +59 -0
- package/dist/geotiff/geotiff.d.ts.map +1 -0
- package/dist/geotiff/geotiff.js +146 -0
- package/dist/geotiff/geotiff.js.map +1 -0
- package/dist/geotiff/index.d.ts +1 -0
- package/dist/geotiff/index.d.ts.map +1 -0
- package/dist/geotiff/index.js +2 -0
- package/dist/geotiff/index.js.map +1 -0
- package/dist/geotiff/render-pipeline.d.ts +13 -0
- package/dist/geotiff/render-pipeline.d.ts.map +1 -0
- package/dist/geotiff/render-pipeline.js +149 -0
- package/dist/geotiff/render-pipeline.js.map +1 -0
- package/dist/geotiff/texture.d.ts +14 -0
- package/dist/geotiff/texture.d.ts.map +1 -0
- package/dist/geotiff/texture.js +134 -0
- package/dist/geotiff/texture.js.map +1 -0
- package/dist/geotiff/types.d.ts +34 -0
- package/dist/geotiff/types.d.ts.map +1 -0
- package/dist/geotiff/types.js +18 -0
- package/dist/geotiff/types.js.map +1 -0
- package/dist/geotiff-layer.d.ts +42 -3
- package/dist/geotiff-layer.d.ts.map +1 -1
- package/dist/geotiff-layer.js +21 -7
- package/dist/geotiff-layer.js.map +1 -1
- package/dist/geotiff-reprojection.d.ts +5 -11
- package/dist/geotiff-reprojection.d.ts.map +1 -1
- package/dist/geotiff-reprojection.js +8 -37
- package/dist/geotiff-reprojection.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/proj.d.ts +24 -0
- package/dist/proj.d.ts.map +1 -0
- package/dist/proj.js +46 -0
- package/dist/proj.js.map +1 -0
- package/package.json +10 -15
- package/dist/geotiff.d.ts +0 -31
- package/dist/geotiff.d.ts.map +0 -1
- package/dist/geotiff.js +0 -70
- package/dist/geotiff.js.map +0 -1
package/dist/cog-layer.d.ts
CHANGED
|
@@ -1,11 +1,59 @@
|
|
|
1
|
-
import type { CompositeLayerProps, UpdateParameters } from "@deck.gl/core";
|
|
1
|
+
import type { CompositeLayerProps, Layer, LayersList, UpdateParameters } from "@deck.gl/core";
|
|
2
2
|
import { CompositeLayer } from "@deck.gl/core";
|
|
3
|
+
import type { _Tile2DHeader as Tile2DHeader, TileLayerProps, _TileLoadProps as TileLoadProps } from "@deck.gl/geo-layers";
|
|
3
4
|
import { TileLayer } from "@deck.gl/geo-layers";
|
|
4
|
-
import type { TileMatrixSet } from "@developmentseed/deck.gl-raster";
|
|
5
|
+
import type { RasterModule, TileMatrixSet } from "@developmentseed/deck.gl-raster";
|
|
5
6
|
import type { ReprojectionFns } from "@developmentseed/raster-reproject";
|
|
6
|
-
import type {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import type { Device } from "@luma.gl/core";
|
|
8
|
+
import type { BaseClient, GeoTIFF, GeoTIFFImage, Pool } from "geotiff";
|
|
9
|
+
import type { TextureDataT } from "./geotiff/render-pipeline.js";
|
|
10
|
+
import type { GeoKeysParser, ProjectionInfo } from "./proj.js";
|
|
11
|
+
/**
|
|
12
|
+
* Minimum interface that **must** be returned from getTileData.
|
|
13
|
+
*/
|
|
14
|
+
export type MinimalDataT = {
|
|
15
|
+
height: number;
|
|
16
|
+
width: number;
|
|
17
|
+
};
|
|
18
|
+
export type DefaultDataT = MinimalDataT & {
|
|
19
|
+
texture: ImageData;
|
|
20
|
+
};
|
|
21
|
+
/** Options passed to `getTileData`. */
|
|
22
|
+
export type GetTileDataOptions = {
|
|
23
|
+
/** The luma.gl Device */
|
|
24
|
+
device: Device;
|
|
25
|
+
/** the subset to read data from in pixels. */
|
|
26
|
+
window?: [number, number, number, number];
|
|
27
|
+
/** An AbortSignal that may be signalled if the request is to be aborted */
|
|
28
|
+
signal?: AbortSignal;
|
|
29
|
+
/** The decoder pool to use. */
|
|
30
|
+
pool: Pool;
|
|
31
|
+
};
|
|
32
|
+
type GetTileDataResult<DataT> = {
|
|
33
|
+
data: DataT;
|
|
34
|
+
forwardTransform: ReprojectionFns["forwardTransform"];
|
|
35
|
+
inverseTransform: ReprojectionFns["inverseTransform"];
|
|
36
|
+
};
|
|
37
|
+
export interface COGLayerProps<DataT extends MinimalDataT = DefaultDataT> extends CompositeLayerProps {
|
|
38
|
+
/**
|
|
39
|
+
* GeoTIFF input.
|
|
40
|
+
*
|
|
41
|
+
* - URL string pointing to a COG
|
|
42
|
+
* - ArrayBuffer containing the COG data
|
|
43
|
+
* - Blob containing the COG data
|
|
44
|
+
* - An instance of GeoTIFF.js's GeoTIFF class
|
|
45
|
+
* - An instance of GeoTIFF.js's BaseClient for custom fetching
|
|
46
|
+
*/
|
|
47
|
+
geotiff: GeoTIFF | string | ArrayBuffer | Blob | BaseClient;
|
|
48
|
+
/**
|
|
49
|
+
* A function callback for parsing GeoTIFF geo keys to a Proj4 compatible
|
|
50
|
+
* definition.
|
|
51
|
+
*
|
|
52
|
+
* By default, uses epsg.io to resolve EPSG codes found in the GeoTIFF.
|
|
53
|
+
* Alternatively, you may want to use `geotiff-geokeys-to-proj4`, which is
|
|
54
|
+
* more extensive but adds 1.5MB to your bundle size.
|
|
55
|
+
*/
|
|
56
|
+
geoKeysParser?: GeoKeysParser;
|
|
9
57
|
/**
|
|
10
58
|
* GeoTIFF.js Pool for decoding image chunks.
|
|
11
59
|
*
|
|
@@ -19,6 +67,26 @@ export interface COGLayerProps extends CompositeLayerProps {
|
|
|
19
67
|
* @default 0.125
|
|
20
68
|
*/
|
|
21
69
|
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[];
|
|
22
90
|
/**
|
|
23
91
|
* Enable debug visualization showing the triangulation mesh
|
|
24
92
|
* @default false
|
|
@@ -29,25 +97,55 @@ export interface COGLayerProps extends CompositeLayerProps {
|
|
|
29
97
|
* @default 0.5
|
|
30
98
|
*/
|
|
31
99
|
debugOpacity?: number;
|
|
100
|
+
/**
|
|
101
|
+
* Called when the GeoTIFF metadata has been loaded and parsed.
|
|
102
|
+
*
|
|
103
|
+
* @param {GeoTIFF} geotiff
|
|
104
|
+
* @param {ProjectionInfo} projection
|
|
105
|
+
*/
|
|
106
|
+
onGeoTIFFLoad?: (geotiff: GeoTIFF, options: {
|
|
107
|
+
projection: ProjectionInfo;
|
|
108
|
+
/**
|
|
109
|
+
* Bounds of the image in geographic coordinates (WGS84) [minLon, minLat,
|
|
110
|
+
* maxLon, maxLat]
|
|
111
|
+
*/
|
|
112
|
+
geographicBounds: {
|
|
113
|
+
west: number;
|
|
114
|
+
south: number;
|
|
115
|
+
east: number;
|
|
116
|
+
north: number;
|
|
117
|
+
};
|
|
118
|
+
}) => void;
|
|
32
119
|
}
|
|
33
120
|
/**
|
|
34
121
|
* COGLayer renders a COG using a tiled approach with reprojection.
|
|
35
122
|
*/
|
|
36
|
-
export declare class COGLayer extends CompositeLayer<COGLayerProps
|
|
123
|
+
export declare class COGLayer<DataT extends MinimalDataT = DefaultDataT> extends CompositeLayer<COGLayerProps<DataT>> {
|
|
37
124
|
static layerName: string;
|
|
38
|
-
static defaultProps:
|
|
39
|
-
maxError: number;
|
|
40
|
-
};
|
|
125
|
+
static defaultProps: Partial<COGLayerProps<DefaultDataT>>;
|
|
41
126
|
state: {
|
|
42
127
|
forwardReproject?: ReprojectionFns["forwardReproject"];
|
|
43
128
|
inverseReproject?: ReprojectionFns["inverseReproject"];
|
|
44
129
|
metadata?: TileMatrixSet;
|
|
45
130
|
images?: GeoTIFFImage[];
|
|
131
|
+
defaultGetTileData?: COGLayerProps<TextureDataT>["getTileData"];
|
|
132
|
+
defaultRenderTile?: COGLayerProps<TextureDataT>["renderTile"];
|
|
46
133
|
};
|
|
47
134
|
initializeState(): void;
|
|
48
135
|
updateState(params: UpdateParameters<this>): void;
|
|
49
136
|
_parseGeoTIFF(): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Inner callback passed in to the underlying TileLayer's `getTileData`.
|
|
139
|
+
*/
|
|
140
|
+
_getTileData(tile: TileLoadProps, images: GeoTIFFImage[], metadata: TileMatrixSet): Promise<GetTileDataResult<DataT>>;
|
|
141
|
+
_renderSubLayers(props: TileLayerProps<GetTileDataResult<DataT>> & {
|
|
142
|
+
id: string;
|
|
143
|
+
data?: GetTileDataResult<DataT>;
|
|
144
|
+
_offset: number;
|
|
145
|
+
tile: Tile2DHeader<GetTileDataResult<DataT>>;
|
|
146
|
+
}, metadata: TileMatrixSet, forwardReproject: ReprojectionFns["forwardReproject"], inverseReproject: ReprojectionFns["inverseReproject"]): Layer | LayersList | null;
|
|
50
147
|
renderTileLayer(metadata: TileMatrixSet, forwardReproject: ReprojectionFns["forwardReproject"], inverseReproject: ReprojectionFns["inverseReproject"], images: GeoTIFFImage[]): TileLayer;
|
|
51
148
|
renderLayers(): TileLayer<any, {}> | null;
|
|
52
149
|
}
|
|
150
|
+
export {};
|
|
53
151
|
//# sourceMappingURL=cog-layer.d.ts.map
|
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,
|
|
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,EAChC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,KAAK,EACV,YAAY,EAEZ,aAAa,EACd,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAQvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAGjE,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAO/D;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;A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G;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,QAAQ,EAAE,aAAa,EACvB,gBAAgB,EAAE,eAAe,CAAC,kBAAkB,CAAC,EACrD,gBAAgB,EAAE,eAAe,CAAC,kBAAkB,CAAC,GACpD,KAAK,GAAG,UAAU,GAAG,IAAI;IA8E5B,eAAe,CACb,QAAQ,EAAE,aAAa,EACvB,gBAAgB,EAAE,eAAe,CAAC,kBAAkB,CAAC,EACrD,gBAAgB,EAAE,eAAe,CAAC,kBAAkB,CAAC,EACrD,MAAM,EAAE,YAAY,EAAE,GACrB,SAAS;IAsBZ,YAAY;CAiBb"}
|
package/dist/cog-layer.js
CHANGED
|
@@ -4,11 +4,14 @@ import { PathLayer } from "@deck.gl/layers";
|
|
|
4
4
|
import { RasterLayer, RasterTileset2D } from "@developmentseed/deck.gl-raster";
|
|
5
5
|
import proj4 from "proj4";
|
|
6
6
|
import { parseCOGTileMatrixSet } from "./cog-tile-matrix-set.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
7
|
+
import { defaultPool, fetchGeoTIFF, getGeographicBounds, } from "./geotiff/geotiff.js";
|
|
8
|
+
import { inferRenderPipeline } from "./geotiff/render-pipeline.js";
|
|
9
|
+
import { fromGeoTransform } from "./geotiff-reprojection.js";
|
|
10
|
+
import { epsgIoGeoKeyParser } from "./proj.js";
|
|
10
11
|
const defaultProps = {
|
|
11
|
-
|
|
12
|
+
geoKeysParser: epsgIoGeoKeyParser,
|
|
13
|
+
debug: false,
|
|
14
|
+
debugOpacity: 0.5,
|
|
12
15
|
};
|
|
13
16
|
/**
|
|
14
17
|
* COGLayer renders a COG using a tiled approach with reprojection.
|
|
@@ -28,30 +31,138 @@ export class COGLayer extends CompositeLayer {
|
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
async _parseGeoTIFF() {
|
|
31
|
-
const
|
|
32
|
-
const
|
|
34
|
+
const geotiff = await fetchGeoTIFF(this.props.geotiff);
|
|
35
|
+
const geoKeysParser = this.props.geoKeysParser;
|
|
36
|
+
const metadata = await parseCOGTileMatrixSet(geotiff, geoKeysParser);
|
|
33
37
|
const image = await geotiff.getImage();
|
|
34
38
|
const imageCount = await geotiff.getImageCount();
|
|
35
39
|
const images = [];
|
|
36
40
|
for (let imageIdx = 0; imageIdx < imageCount; imageIdx++) {
|
|
37
41
|
images.push(await geotiff.getImage(imageIdx));
|
|
38
42
|
}
|
|
39
|
-
const sourceProjection = await
|
|
43
|
+
const sourceProjection = await geoKeysParser(image.getGeoKeys());
|
|
40
44
|
if (!sourceProjection) {
|
|
41
45
|
throw new Error("Could not determine source projection from GeoTIFF geo keys");
|
|
42
46
|
}
|
|
43
|
-
const converter = proj4(sourceProjection, "EPSG:4326");
|
|
47
|
+
const converter = proj4(sourceProjection.def, "EPSG:4326");
|
|
44
48
|
const forwardReproject = (x, y) => converter.forward([x, y], false);
|
|
45
49
|
const inverseReproject = (x, y) => converter.inverse([x, y], false);
|
|
50
|
+
if (this.props.onGeoTIFFLoad) {
|
|
51
|
+
const geographicBounds = getGeographicBounds(image, converter);
|
|
52
|
+
this.props.onGeoTIFFLoad(geotiff, {
|
|
53
|
+
projection: sourceProjection,
|
|
54
|
+
geographicBounds,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const { getTileData: defaultGetTileData, renderTile: defaultRenderTile } = inferRenderPipeline(image.fileDirectory, this.context.device);
|
|
46
58
|
this.setState({
|
|
47
59
|
metadata,
|
|
48
60
|
forwardReproject,
|
|
49
61
|
inverseReproject,
|
|
50
62
|
images,
|
|
63
|
+
defaultGetTileData,
|
|
64
|
+
defaultRenderTile,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Inner callback passed in to the underlying TileLayer's `getTileData`.
|
|
69
|
+
*/
|
|
70
|
+
async _getTileData(tile, images, metadata) {
|
|
71
|
+
const { signal } = tile;
|
|
72
|
+
const { x, y, z } = tile.index;
|
|
73
|
+
// Select overview image
|
|
74
|
+
const geotiffImage = images[images.length - 1 - z];
|
|
75
|
+
const imageHeight = geotiffImage.getHeight();
|
|
76
|
+
const imageWidth = geotiffImage.getWidth();
|
|
77
|
+
const tileMatrix = metadata.tileMatrices[z];
|
|
78
|
+
const { tileWidth, tileHeight } = tileMatrix;
|
|
79
|
+
const tileGeotransform = computeTileGeotransform(x, y, tileMatrix);
|
|
80
|
+
const { forwardTransform, inverseTransform } = fromGeoTransform(tileGeotransform);
|
|
81
|
+
const window = [
|
|
82
|
+
x * tileWidth,
|
|
83
|
+
y * tileHeight,
|
|
84
|
+
Math.min((x + 1) * tileWidth, imageWidth),
|
|
85
|
+
Math.min((y + 1) * tileHeight, imageHeight),
|
|
86
|
+
];
|
|
87
|
+
const getTileData = this.props.getTileData || this.state.defaultGetTileData;
|
|
88
|
+
const data = await getTileData(geotiffImage, {
|
|
89
|
+
device: this.context.device,
|
|
90
|
+
window,
|
|
91
|
+
signal,
|
|
92
|
+
pool: this.props.pool || defaultPool(),
|
|
51
93
|
});
|
|
94
|
+
return {
|
|
95
|
+
// @ts-expect-error type mismatch when using provided getTileData
|
|
96
|
+
data,
|
|
97
|
+
forwardTransform,
|
|
98
|
+
inverseTransform,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
_renderSubLayers(
|
|
102
|
+
// TODO: it would be nice to have a cleaner type here
|
|
103
|
+
// this is copy-pasted from the upstream tile layer definition for props.
|
|
104
|
+
props, metadata, forwardReproject, inverseReproject) {
|
|
105
|
+
const { maxError, debug, debugOpacity } = this.props;
|
|
106
|
+
const { tile } = props;
|
|
107
|
+
if (!props.data) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
const { data, forwardTransform, inverseTransform } = props.data;
|
|
111
|
+
const layers = [];
|
|
112
|
+
if (data) {
|
|
113
|
+
const { height, width } = data;
|
|
114
|
+
const renderTile = this.props.renderTile || this.state.defaultRenderTile;
|
|
115
|
+
layers.push(new RasterLayer({
|
|
116
|
+
id: `${props.id}-raster`,
|
|
117
|
+
width,
|
|
118
|
+
height,
|
|
119
|
+
renderPipeline: renderTile(data),
|
|
120
|
+
maxError,
|
|
121
|
+
reprojectionFns: {
|
|
122
|
+
forwardTransform,
|
|
123
|
+
inverseTransform,
|
|
124
|
+
forwardReproject,
|
|
125
|
+
inverseReproject,
|
|
126
|
+
},
|
|
127
|
+
debug,
|
|
128
|
+
debugOpacity,
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
if (debug) {
|
|
132
|
+
// Get projected bounds from tile data
|
|
133
|
+
// getTileMetadata returns data that includes projectedBounds
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
135
|
+
const projectedBounds = tile?.projectedBounds;
|
|
136
|
+
if (!projectedBounds || !metadata) {
|
|
137
|
+
return [];
|
|
138
|
+
}
|
|
139
|
+
// Project bounds from image CRS to WGS84
|
|
140
|
+
const { topLeft, topRight, bottomLeft, bottomRight } = projectedBounds;
|
|
141
|
+
const topLeftWgs84 = metadata.projectToWgs84(topLeft);
|
|
142
|
+
const topRightWgs84 = metadata.projectToWgs84(topRight);
|
|
143
|
+
const bottomRightWgs84 = metadata.projectToWgs84(bottomRight);
|
|
144
|
+
const bottomLeftWgs84 = metadata.projectToWgs84(bottomLeft);
|
|
145
|
+
// Create a closed path around the tile bounds
|
|
146
|
+
const path = [
|
|
147
|
+
topLeftWgs84,
|
|
148
|
+
topRightWgs84,
|
|
149
|
+
bottomRightWgs84,
|
|
150
|
+
bottomLeftWgs84,
|
|
151
|
+
topLeftWgs84, // Close the path
|
|
152
|
+
];
|
|
153
|
+
layers.push(new PathLayer({
|
|
154
|
+
id: `${tile.id}-bounds`,
|
|
155
|
+
data: [{ path }],
|
|
156
|
+
getPath: (d) => d.path,
|
|
157
|
+
getColor: [255, 0, 0, 255], // Red
|
|
158
|
+
getWidth: 2,
|
|
159
|
+
widthUnits: "pixels",
|
|
160
|
+
pickable: false,
|
|
161
|
+
}));
|
|
162
|
+
}
|
|
163
|
+
return layers;
|
|
52
164
|
}
|
|
53
165
|
renderTileLayer(metadata, forwardReproject, inverseReproject, images) {
|
|
54
|
-
const { maxError, debug = false, debugOpacity = 0.5 } = this.props;
|
|
55
166
|
// Create a factory class that wraps COGTileset2D with the metadata
|
|
56
167
|
class RasterTileset2DFactory extends RasterTileset2D {
|
|
57
168
|
constructor(opts) {
|
|
@@ -61,92 +172,8 @@ export class COGLayer extends CompositeLayer {
|
|
|
61
172
|
return new TileLayer({
|
|
62
173
|
id: `cog-tile-layer-${this.id}`,
|
|
63
174
|
TilesetClass: RasterTileset2DFactory,
|
|
64
|
-
getTileData: async (tile) =>
|
|
65
|
-
|
|
66
|
-
const { x, y, z } = tile.index;
|
|
67
|
-
// Select overview image
|
|
68
|
-
const geotiffImage = images[images.length - 1 - z];
|
|
69
|
-
const imageHeight = geotiffImage.getHeight();
|
|
70
|
-
const imageWidth = geotiffImage.getWidth();
|
|
71
|
-
const tileMatrix = metadata.tileMatrices[z];
|
|
72
|
-
const { tileWidth, tileHeight } = tileMatrix;
|
|
73
|
-
const tileGeotransform = computeTileGeotransform(x, y, tileMatrix);
|
|
74
|
-
const { pixelToInputCRS, inputCRSToPixel } = fromGeoTransform(tileGeotransform);
|
|
75
|
-
const window = [
|
|
76
|
-
x * tileWidth,
|
|
77
|
-
y * tileHeight,
|
|
78
|
-
Math.min((x + 1) * tileWidth, imageWidth),
|
|
79
|
-
Math.min((y + 1) * tileHeight, imageHeight),
|
|
80
|
-
];
|
|
81
|
-
const { imageData, height, width } = await loadRgbImage(geotiffImage, {
|
|
82
|
-
window,
|
|
83
|
-
signal,
|
|
84
|
-
pool: this.props.pool || defaultPool(),
|
|
85
|
-
});
|
|
86
|
-
return {
|
|
87
|
-
image: imageData,
|
|
88
|
-
height,
|
|
89
|
-
width,
|
|
90
|
-
pixelToInputCRS,
|
|
91
|
-
inputCRSToPixel,
|
|
92
|
-
};
|
|
93
|
-
},
|
|
94
|
-
renderSubLayers: (props) => {
|
|
95
|
-
const { tile, data } = props;
|
|
96
|
-
const layers = [];
|
|
97
|
-
if (data) {
|
|
98
|
-
const { image, height, width, pixelToInputCRS, inputCRSToPixel, } = data;
|
|
99
|
-
const rasterLayer = new RasterLayer({
|
|
100
|
-
id: `${props.id}-raster`,
|
|
101
|
-
width,
|
|
102
|
-
height,
|
|
103
|
-
texture: image,
|
|
104
|
-
maxError,
|
|
105
|
-
reprojectionFns: {
|
|
106
|
-
pixelToInputCRS,
|
|
107
|
-
inputCRSToPixel,
|
|
108
|
-
forwardReproject,
|
|
109
|
-
inverseReproject,
|
|
110
|
-
},
|
|
111
|
-
debug,
|
|
112
|
-
debugOpacity,
|
|
113
|
-
});
|
|
114
|
-
layers.push(rasterLayer);
|
|
115
|
-
}
|
|
116
|
-
if (debug) {
|
|
117
|
-
// Get projected bounds from tile data
|
|
118
|
-
// getTileMetadata returns data that includes projectedBounds
|
|
119
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
120
|
-
const projectedBounds = tile?.projectedBounds;
|
|
121
|
-
if (!projectedBounds || !metadata) {
|
|
122
|
-
return [];
|
|
123
|
-
}
|
|
124
|
-
// Project bounds from image CRS to WGS84
|
|
125
|
-
const { topLeft, topRight, bottomLeft, bottomRight } = projectedBounds;
|
|
126
|
-
const topLeftWgs84 = metadata.projectToWgs84(topLeft);
|
|
127
|
-
const topRightWgs84 = metadata.projectToWgs84(topRight);
|
|
128
|
-
const bottomRightWgs84 = metadata.projectToWgs84(bottomRight);
|
|
129
|
-
const bottomLeftWgs84 = metadata.projectToWgs84(bottomLeft);
|
|
130
|
-
// Create a closed path around the tile bounds
|
|
131
|
-
const path = [
|
|
132
|
-
topLeftWgs84,
|
|
133
|
-
topRightWgs84,
|
|
134
|
-
bottomRightWgs84,
|
|
135
|
-
bottomLeftWgs84,
|
|
136
|
-
topLeftWgs84, // Close the path
|
|
137
|
-
];
|
|
138
|
-
layers.push(new PathLayer({
|
|
139
|
-
id: `${tile.id}-bounds`,
|
|
140
|
-
data: [{ path }],
|
|
141
|
-
getPath: (d) => d.path,
|
|
142
|
-
getColor: [255, 0, 0, 255], // Red
|
|
143
|
-
getWidth: 2,
|
|
144
|
-
widthUnits: "pixels",
|
|
145
|
-
pickable: false,
|
|
146
|
-
}));
|
|
147
|
-
}
|
|
148
|
-
return layers;
|
|
149
|
-
},
|
|
175
|
+
getTileData: async (tile) => this._getTileData(tile, images, metadata),
|
|
176
|
+
renderSubLayers: (props) => this._renderSubLayers(props, metadata, forwardReproject, inverseReproject),
|
|
150
177
|
});
|
|
151
178
|
}
|
|
152
179
|
renderLayers() {
|
package/dist/cog-layer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cog-layer.js","sourceRoot":"","sources":["../src/cog-layer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cog-layer.js","sourceRoot":"","sources":["../src/cog-layer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAM/C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAM5C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAI/E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EACL,WAAW,EACX,YAAY,EACZ,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAA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AG,CAAC,GAAG,YAAY,GAAG,CAAC,CAAC;IAE7D,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TileMatrixSet } from "@developmentseed/deck.gl-raster";
|
|
2
2
|
import type { GeoTIFF } from "geotiff";
|
|
3
|
+
import type { GeoKeysParser } from "./proj";
|
|
3
4
|
/**
|
|
4
5
|
*
|
|
5
6
|
* Ported from Vincent's work here:
|
|
@@ -7,5 +8,5 @@ import type { GeoTIFF } from "geotiff";
|
|
|
7
8
|
*
|
|
8
9
|
* @return {TileMatrixSet}[return description]
|
|
9
10
|
*/
|
|
10
|
-
export declare function parseCOGTileMatrixSet(tiff: GeoTIFF): Promise<TileMatrixSet>;
|
|
11
|
+
export declare function parseCOGTileMatrixSet(tiff: GeoTIFF, geoKeysParser: GeoKeysParser): Promise<TileMatrixSet>;
|
|
11
12
|
//# sourceMappingURL=cog-tile-matrix-set.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cog-tile-matrix-set.d.ts","sourceRoot":"","sources":["../src/cog-tile-matrix-set.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EAEd,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"cog-tile-matrix-set.d.ts","sourceRoot":"","sources":["../src/cog-tile-matrix-set.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EAEd,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,SAAS,CAAC;AAIrD,OAAO,KAAK,EAAE,aAAa,EAAoC,MAAM,QAAQ,CAAC;AAM9E;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,OAAO,EACb,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,aAAa,CAAC,CAyFxB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { extractGeotransform, getGeoTIFFProjection, } from "./geotiff-reprojection";
|
|
2
1
|
import proj4 from "proj4";
|
|
3
2
|
import Ellipsoid from "./ellipsoids.js";
|
|
3
|
+
import { extractGeotransform } from "./geotiff-reprojection";
|
|
4
4
|
// 0.28 mm per pixel
|
|
5
5
|
// https://docs.ogc.org/is/17-083r4/17-083r4.html#toc15
|
|
6
6
|
const SCREEN_PIXEL_SIZE = 0.00028;
|
|
@@ -11,7 +11,7 @@ const SCREEN_PIXEL_SIZE = 0.00028;
|
|
|
11
11
|
*
|
|
12
12
|
* @return {TileMatrixSet}[return description]
|
|
13
13
|
*/
|
|
14
|
-
export async function parseCOGTileMatrixSet(tiff) {
|
|
14
|
+
export async function parseCOGTileMatrixSet(tiff, geoKeysParser) {
|
|
15
15
|
const fullResImage = await tiff.getImage();
|
|
16
16
|
if (!fullResImage.isTiled) {
|
|
17
17
|
throw new Error("COG TileMatrixSet requires a tiled GeoTIFF");
|
|
@@ -20,13 +20,12 @@ export async function parseCOGTileMatrixSet(tiff) {
|
|
|
20
20
|
const bbox = fullResImage.getBoundingBox();
|
|
21
21
|
const fullImageWidth = fullResImage.getWidth();
|
|
22
22
|
const fullImageHeight = fullResImage.getHeight();
|
|
23
|
-
const crs = await
|
|
23
|
+
const crs = await geoKeysParser(fullResImage.getGeoKeys());
|
|
24
24
|
if (crs === null) {
|
|
25
25
|
throw new Error("Could not determine coordinate reference system from GeoTIFF geo keys");
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const projectTo3857 = proj4(crs, "EPSG:3857").forward;
|
|
27
|
+
const projectToWgs84 = proj4(crs.def, "EPSG:4326").forward;
|
|
28
|
+
const projectTo3857 = proj4(crs.def, "EPSG:3857").forward;
|
|
30
29
|
const boundingBox = {
|
|
31
30
|
lowerLeft: [bbox[0], bbox[1]],
|
|
32
31
|
upperRight: [bbox[2], bbox[3]],
|
|
@@ -43,7 +42,8 @@ export async function parseCOGTileMatrixSet(tiff) {
|
|
|
43
42
|
{
|
|
44
43
|
// Set as highest resolution / finest level
|
|
45
44
|
id: String(imageCount - 1),
|
|
46
|
-
scaleDenominator: (cellSize * metersPerUnit(
|
|
45
|
+
scaleDenominator: (cellSize * metersPerUnit(crs.parsed, crs.coordinatesUnits)) /
|
|
46
|
+
SCREEN_PIXEL_SIZE,
|
|
47
47
|
cellSize,
|
|
48
48
|
pointOfOrigin: [transform[2], transform[5]],
|
|
49
49
|
tileWidth: fullResImage.getTileWidth(),
|
|
@@ -65,7 +65,7 @@ export async function parseCOGTileMatrixSet(tiff) {
|
|
|
65
65
|
fullWidth: fullImageWidth,
|
|
66
66
|
fullHeight: fullImageHeight,
|
|
67
67
|
baseTransform: transform,
|
|
68
|
-
|
|
68
|
+
crs,
|
|
69
69
|
});
|
|
70
70
|
tileMatrices.push(tileMatrix);
|
|
71
71
|
}
|
|
@@ -89,10 +89,15 @@ export async function parseCOGTileMatrixSet(tiff) {
|
|
|
89
89
|
* > If the CRS uses meters as units of measure for the horizontal dimensions,
|
|
90
90
|
* > then metersPerUnit=1; if it has degrees, then metersPerUnit=2pa/360
|
|
91
91
|
* > (a is the Earth maximum radius of the ellipsoid).
|
|
92
|
+
*
|
|
93
|
+
* If `crsUnit` is provided, it takes precedence over the unit defined in the
|
|
94
|
+
* CRS. This exists because sometimes the parsed CRS from
|
|
95
|
+
* `geotiff-geokeys-to-proj4` doesn't have a unit defined.
|
|
92
96
|
*/
|
|
93
97
|
// https://github.com/developmentseed/morecantile/blob/7c95a11c491303700d6e33e9c1607f2719584dec/morecantile/utils.py#L67-L90
|
|
94
|
-
function metersPerUnit(parsedCrs) {
|
|
95
|
-
|
|
98
|
+
function metersPerUnit(parsedCrs, crsUnit) {
|
|
99
|
+
const unit = crsUnit || parsedCrs.units;
|
|
100
|
+
switch (unit) {
|
|
96
101
|
case "metre":
|
|
97
102
|
case "meter":
|
|
98
103
|
case "meters":
|
|
@@ -102,17 +107,17 @@ function metersPerUnit(parsedCrs) {
|
|
|
102
107
|
case "US survey foot":
|
|
103
108
|
return 1200 / 3937;
|
|
104
109
|
}
|
|
105
|
-
if (
|
|
110
|
+
if (unit === "degree") {
|
|
106
111
|
// 2 * π * ellipsoid semi-major-axis / 360
|
|
107
112
|
const { a } = Ellipsoid[parsedCrs.ellps];
|
|
108
113
|
return (2 * Math.PI * a) / 360;
|
|
109
114
|
}
|
|
110
|
-
throw new Error(`Unsupported CRS units: ${
|
|
115
|
+
throw new Error(`Unsupported CRS units: ${unit}`);
|
|
111
116
|
}
|
|
112
117
|
/**
|
|
113
118
|
* Create tile matrix for COG overview
|
|
114
119
|
*/
|
|
115
|
-
function createOverviewTileMatrix({ id, image, fullWidth, baseTransform,
|
|
120
|
+
function createOverviewTileMatrix({ id, image, fullWidth, baseTransform, crs, }) {
|
|
116
121
|
const width = image.getWidth();
|
|
117
122
|
const height = image.getHeight();
|
|
118
123
|
// For now, just use scaleX
|
|
@@ -136,7 +141,8 @@ function createOverviewTileMatrix({ id, image, fullWidth, baseTransform, parsedC
|
|
|
136
141
|
const tileHeight = image.getTileHeight();
|
|
137
142
|
return {
|
|
138
143
|
id,
|
|
139
|
-
scaleDenominator: (cellSize * metersPerUnit(
|
|
144
|
+
scaleDenominator: (cellSize * metersPerUnit(crs.parsed, crs.coordinatesUnits)) /
|
|
145
|
+
SCREEN_PIXEL_SIZE,
|
|
140
146
|
cellSize,
|
|
141
147
|
pointOfOrigin: [geotransform[2], geotransform[5]],
|
|
142
148
|
tileWidth,
|
|
@@ -146,15 +152,6 @@ function createOverviewTileMatrix({ id, image, fullWidth, baseTransform, parsedC
|
|
|
146
152
|
geotransform,
|
|
147
153
|
};
|
|
148
154
|
}
|
|
149
|
-
function parseCrs(crs) {
|
|
150
|
-
// If you pass proj4.defs a projjson, it doesn't parse it; it just returns the
|
|
151
|
-
// input.
|
|
152
|
-
//
|
|
153
|
-
// Instead, you need to assign it to an alias and then retrieve it.
|
|
154
|
-
const key = "__deck.gl-geotiff-internal__";
|
|
155
|
-
proj4.defs(key, crs);
|
|
156
|
-
return proj4.defs(key);
|
|
157
|
-
}
|
|
158
155
|
function computeWgs84BoundingBox(boundingBox, projectToWgs84) {
|
|
159
156
|
const lowerLeftWgs84 = projectToWgs84(boundingBox.lowerLeft);
|
|
160
157
|
const lowerRightWgs84 = projectToWgs84([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cog-tile-matrix-set.js","sourceRoot":"","sources":["../src/cog-tile-matrix-set.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"cog-tile-matrix-set.js","sourceRoot":"","sources":["../src/cog-tile-matrix-set.ts"],"names":[],"mappings":"AAMA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAG7D,oBAAoB;AACpB,uDAAuD;AACvD,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAElC;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,IAAa,EACb,aAA4B;IAE5B,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;IAE3C,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;IAC9C,MAAM,IAAI,GAAG,YAAY,CAAC,cAAc,EAAE,CAAC;IAC3C,MAAM,cAAc,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;IAC/C,MAAM,eAAe,GAAG,YAAY,CAAC,SAAS,EAAE,CAAC;IAEjD,MAAM,GAAG,GAAG,MAAM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,cAAc,CAAC,CAAC,CAAC,CAClB,CAAC;IACF,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CACrB,cAAc,CAAC,CAAC,CAAC,EACjB,eAAe,CAAC,CAAC,CAAC,EAClB,eAAe,CAAC,CAAC,CAAC,EAClB,cAAc,CAAC,CAAC,CAAC,CAClB,CAAC;IACF,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CACrB,cAAc,CAAC,CAAC,CAAC,EACjB,eAAe,CAAC,CAAC,CAAC,EAClB,eAAe,CAAC,CAAC,CAAC,EAClB,cAAc,CAAC,CAAC,CAAC,CAClB,CAAC;IACF,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CACrB,cAAc,CAAC,CAAC,CAAC,EACjB,eAAe,CAAC,CAAC,CAAC,EAClB,eAAe,CAAC,CAAC,CAAC,EAClB,cAAc,CAAC,CAAC,CAAC,CAClB,CAAC;IAEF,OAAO;QACL,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;QAC3B,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;KAC7B,CAAC;AACJ,CAAC"}
|
package/dist/ellipsoids.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Vendored and edited from proj4.js.
|
|
3
3
|
*
|
|
4
|
-
* In the implementation of metersPerUnit while
|
|
4
|
+
* In the implementation of metersPerUnit while generating a COG TileMatrixSet,
|
|
5
5
|
* we need to know the size of the semi major axis in the case the CRS is in
|
|
6
6
|
* degrees.
|
|
7
7
|
*
|
package/dist/ellipsoids.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Vendored and edited from proj4.js.
|
|
3
3
|
*
|
|
4
|
-
* In the implementation of metersPerUnit while
|
|
4
|
+
* In the implementation of metersPerUnit while generating a COG TileMatrixSet,
|
|
5
5
|
* we need to know the size of the semi major axis in the case the CRS is in
|
|
6
6
|
* degrees.
|
|
7
7
|
*
|