@developmentseed/deck.gl-raster 0.6.0-alpha.1 → 0.6.0-beta.1
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/gpu-modules/color/index.d.ts +5 -5
- package/dist/gpu-modules/color/index.d.ts.map +1 -1
- package/dist/gpu-modules/color/index.js +5 -5
- package/dist/gpu-modules/color/index.js.map +1 -1
- package/dist/gpu-modules/colormap.d.ts +3 -1
- package/dist/gpu-modules/colormap.d.ts.map +1 -1
- package/dist/gpu-modules/colormap.js +4 -1
- package/dist/gpu-modules/colormap.js.map +1 -1
- package/dist/gpu-modules/index.d.ts +5 -5
- package/dist/gpu-modules/index.d.ts.map +1 -1
- package/dist/gpu-modules/index.js +4 -4
- package/dist/gpu-modules/index.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/layer-utils.d.ts +1 -1
- package/dist/layer-utils.d.ts.map +1 -1
- package/dist/raster-layer.d.ts +1 -1
- package/dist/raster-layer.d.ts.map +1 -1
- package/dist/raster-layer.js +1 -1
- package/dist/raster-layer.js.map +1 -1
- package/dist/raster-tile-layer/constants.d.ts +11 -0
- package/dist/raster-tile-layer/constants.d.ts.map +1 -0
- package/dist/raster-tile-layer/constants.js +11 -0
- package/dist/raster-tile-layer/constants.js.map +1 -0
- package/dist/raster-tile-layer/index.d.ts +2 -0
- package/dist/raster-tile-layer/index.d.ts.map +1 -0
- package/dist/raster-tile-layer/index.js +2 -0
- package/dist/raster-tile-layer/index.js.map +1 -0
- package/dist/raster-tile-layer/raster-tile-layer.d.ts +154 -0
- package/dist/raster-tile-layer/raster-tile-layer.d.ts.map +1 -0
- package/dist/raster-tile-layer/raster-tile-layer.js +175 -0
- package/dist/raster-tile-layer/raster-tile-layer.js.map +1 -0
- package/dist/raster-tileset/affine-tileset-level.d.ts +56 -0
- package/dist/raster-tileset/affine-tileset-level.d.ts.map +1 -0
- package/dist/raster-tileset/affine-tileset-level.js +101 -0
- package/dist/raster-tileset/affine-tileset-level.js.map +1 -0
- package/dist/raster-tileset/affine-tileset.d.ts +34 -0
- package/dist/raster-tileset/affine-tileset.d.ts.map +1 -0
- package/dist/raster-tileset/affine-tileset.js +26 -0
- package/dist/raster-tileset/affine-tileset.js.map +1 -0
- package/dist/raster-tileset/index.d.ts +4 -0
- package/dist/raster-tileset/index.d.ts.map +1 -1
- package/dist/raster-tileset/index.js +2 -0
- package/dist/raster-tileset/index.js.map +1 -1
- package/dist/raster-tileset/raster-tile-traversal.d.ts +22 -0
- package/dist/raster-tileset/raster-tile-traversal.d.ts.map +1 -1
- package/dist/raster-tileset/raster-tile-traversal.js +76 -15
- package/dist/raster-tileset/raster-tile-traversal.js.map +1 -1
- package/dist/raster-tileset/raster-tileset-2d.d.ts +14 -6
- package/dist/raster-tileset/raster-tileset-2d.d.ts.map +1 -1
- package/dist/raster-tileset/raster-tileset-2d.js +20 -7
- package/dist/raster-tileset/raster-tileset-2d.js.map +1 -1
- package/dist/raster-tileset/tile-matrix-set.d.ts +7 -3
- package/dist/raster-tileset/tile-matrix-set.d.ts.map +1 -1
- package/dist/raster-tileset/tile-matrix-set.js +20 -2
- package/dist/raster-tileset/tile-matrix-set.js.map +1 -1
- package/dist/raster-tileset/tileset-interface.d.ts +28 -0
- package/dist/raster-tileset/tileset-interface.d.ts.map +1 -1
- package/package.json +11 -11
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { CompositeLayer } from "@deck.gl/core";
|
|
2
|
+
import { TileLayer } from "@deck.gl/geo-layers";
|
|
3
|
+
import { renderDebugTileOutline } from "../layer-utils.js";
|
|
4
|
+
import { RasterLayer } from "../raster-layer.js";
|
|
5
|
+
import { RasterTileset2D } from "../raster-tileset/index.js";
|
|
6
|
+
import { TILE_SIZE, WEB_MERCATOR_TO_WORLD_SCALE } from "./constants.js";
|
|
7
|
+
const defaultProps = {
|
|
8
|
+
...TileLayer.defaultProps,
|
|
9
|
+
maxError: 0.125,
|
|
10
|
+
debug: false,
|
|
11
|
+
debugOpacity: 0.5,
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Base layer that renders a tiled raster source driven by a generic
|
|
15
|
+
* {@link TilesetDescriptor}.
|
|
16
|
+
*
|
|
17
|
+
* Usable directly (provide `tilesetDescriptor`, `getTileData`, and `renderTile`
|
|
18
|
+
* as props) or as a base class (override the protected `_tilesetDescriptor`,
|
|
19
|
+
* `_getTileDataCallback`, `_renderTileCallback` accessors to source them from
|
|
20
|
+
* state).
|
|
21
|
+
*
|
|
22
|
+
* The generic `ExtraProps` parameter lets a subclass redeclare any of the
|
|
23
|
+
* overridable fields with a domain-specific signature (e.g. `COGLayer`'s
|
|
24
|
+
* `getTileData(image, options)`).
|
|
25
|
+
*/
|
|
26
|
+
export class RasterTileLayer extends CompositeLayer {
|
|
27
|
+
static layerName = "RasterTileLayer";
|
|
28
|
+
static defaultProps = defaultProps;
|
|
29
|
+
/**
|
|
30
|
+
* The currently effective {@link TilesetDescriptor}.
|
|
31
|
+
*
|
|
32
|
+
* Subclasses override this to return a descriptor built from their own
|
|
33
|
+
* async-parsed state. Returns `undefined` while the source is still
|
|
34
|
+
* loading; `renderLayers()` returns `null` in that case.
|
|
35
|
+
*
|
|
36
|
+
* The inline cast to `RasterTileLayerProps<DataT>` is required because
|
|
37
|
+
* `tilesetDescriptor` is declared on `ExtraProps`, not on the base's
|
|
38
|
+
* `RasterTileLayerBaseProps`. For direct use the default `ExtraProps`
|
|
39
|
+
* brings it in; for subclass use this method is overridden and the cast
|
|
40
|
+
* is never reached.
|
|
41
|
+
*/
|
|
42
|
+
_tilesetDescriptor() {
|
|
43
|
+
return this.props
|
|
44
|
+
.tilesetDescriptor;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The currently effective tile-fetch callback.
|
|
48
|
+
*
|
|
49
|
+
* Subclasses override this to adapt their user-facing `getTileData`
|
|
50
|
+
* signature into the base's `(tile, options) => Promise<DataT>` shape.
|
|
51
|
+
* Returns `undefined` when the callback is not yet available.
|
|
52
|
+
*/
|
|
53
|
+
_getTileDataCallback() {
|
|
54
|
+
return this.props.getTileData;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The currently effective per-tile render callback.
|
|
58
|
+
*
|
|
59
|
+
* Subclasses override this to thread their user-facing `renderTile` and
|
|
60
|
+
* any inferred default. Returns `undefined` when no callback is available.
|
|
61
|
+
*/
|
|
62
|
+
_renderTileCallback() {
|
|
63
|
+
return this.props.renderTile;
|
|
64
|
+
}
|
|
65
|
+
renderLayers() {
|
|
66
|
+
const descriptor = this._tilesetDescriptor();
|
|
67
|
+
const getTileData = this._getTileDataCallback();
|
|
68
|
+
const renderTile = this._renderTileCallback();
|
|
69
|
+
if (!descriptor || !getTileData || !renderTile) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
return this._renderTileLayer(descriptor, getTileData, renderTile);
|
|
73
|
+
}
|
|
74
|
+
_renderTileLayer(descriptor, getTileData, renderTile) {
|
|
75
|
+
class TilesetFactory extends RasterTileset2D {
|
|
76
|
+
constructor(opts) {
|
|
77
|
+
super(opts, descriptor);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const { tileSize, zoomOffset, maxZoom, minZoom, extent, debounceTime, maxCacheSize, maxCacheByteSize, maxRequests, refinementStrategy, updateTriggers, } = this.props;
|
|
81
|
+
return new TileLayer({
|
|
82
|
+
id: `raster-tile-layer-${this.id}`,
|
|
83
|
+
TilesetClass: TilesetFactory,
|
|
84
|
+
getTileData: (tile) => this._wrapGetTileData(tile, getTileData),
|
|
85
|
+
renderSubLayers: (props) => this._renderSubLayers(props, descriptor, renderTile),
|
|
86
|
+
updateTriggers: {
|
|
87
|
+
renderSubLayers: updateTriggers?.renderTile,
|
|
88
|
+
},
|
|
89
|
+
tileSize,
|
|
90
|
+
zoomOffset,
|
|
91
|
+
maxZoom,
|
|
92
|
+
minZoom,
|
|
93
|
+
extent,
|
|
94
|
+
debounceTime,
|
|
95
|
+
maxCacheSize,
|
|
96
|
+
maxCacheByteSize,
|
|
97
|
+
maxRequests,
|
|
98
|
+
refinementStrategy,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
async _wrapGetTileData(tile, getTileData) {
|
|
102
|
+
const { signal: tileSignal } = tile;
|
|
103
|
+
const userSignal = this.props.signal;
|
|
104
|
+
const signal = userSignal && tileSignal
|
|
105
|
+
? AbortSignal.any([userSignal, tileSignal])
|
|
106
|
+
: (userSignal ?? tileSignal);
|
|
107
|
+
const options = {
|
|
108
|
+
device: this.context.device,
|
|
109
|
+
signal,
|
|
110
|
+
};
|
|
111
|
+
return getTileData(tile, options);
|
|
112
|
+
}
|
|
113
|
+
_renderSubLayers(props, descriptor, renderTile) {
|
|
114
|
+
const { maxError, debug, debugOpacity } = this.props;
|
|
115
|
+
const tile = props.tile;
|
|
116
|
+
const layers = [];
|
|
117
|
+
if (debug) {
|
|
118
|
+
layers.push(...renderDebugTileOutline(`${this.id}-${tile.id}-bounds`, tile, descriptor.projectTo4326));
|
|
119
|
+
}
|
|
120
|
+
if (!props.data) {
|
|
121
|
+
return layers;
|
|
122
|
+
}
|
|
123
|
+
const { x, y, z } = tile.index;
|
|
124
|
+
const level = descriptor.levels[z];
|
|
125
|
+
if (!level) {
|
|
126
|
+
return layers;
|
|
127
|
+
}
|
|
128
|
+
const { forwardTransform, inverseTransform } = level.tileTransform(x, y);
|
|
129
|
+
const { image, renderPipeline } = renderTile(props.data);
|
|
130
|
+
const { width, height } = props.data;
|
|
131
|
+
const isGlobe = this.context.viewport.resolution !== undefined;
|
|
132
|
+
const reprojectionFns = isGlobe
|
|
133
|
+
? {
|
|
134
|
+
forwardTransform,
|
|
135
|
+
inverseTransform,
|
|
136
|
+
forwardReproject: descriptor.projectTo4326,
|
|
137
|
+
inverseReproject: descriptor.projectFrom4326,
|
|
138
|
+
}
|
|
139
|
+
: {
|
|
140
|
+
forwardTransform,
|
|
141
|
+
inverseTransform,
|
|
142
|
+
forwardReproject: descriptor.projectTo3857,
|
|
143
|
+
inverseReproject: descriptor.projectFrom3857,
|
|
144
|
+
};
|
|
145
|
+
const deckProjectionProps = isGlobe
|
|
146
|
+
? {}
|
|
147
|
+
: {
|
|
148
|
+
coordinateSystem: "cartesian",
|
|
149
|
+
coordinateOrigin: [TILE_SIZE / 2, TILE_SIZE / 2, 0],
|
|
150
|
+
// biome-ignore format: array
|
|
151
|
+
modelMatrix: [
|
|
152
|
+
WEB_MERCATOR_TO_WORLD_SCALE, 0, 0, 0,
|
|
153
|
+
0, WEB_MERCATOR_TO_WORLD_SCALE, 0, 0,
|
|
154
|
+
0, 0, 1, 0,
|
|
155
|
+
0, 0, 0, 1,
|
|
156
|
+
],
|
|
157
|
+
};
|
|
158
|
+
const rasterLayer = new RasterLayer(this.getSubLayerProps({
|
|
159
|
+
id: `${props.id}-raster`,
|
|
160
|
+
width,
|
|
161
|
+
height,
|
|
162
|
+
// Passing `image: undefined` explicitly would trip isAsyncPropLoading
|
|
163
|
+
// and cause a transient black flash (see issue #376).
|
|
164
|
+
...(image !== undefined && { image }),
|
|
165
|
+
renderPipeline,
|
|
166
|
+
maxError,
|
|
167
|
+
reprojectionFns,
|
|
168
|
+
debug,
|
|
169
|
+
debugOpacity,
|
|
170
|
+
...deckProjectionProps,
|
|
171
|
+
}));
|
|
172
|
+
return [rasterLayer, ...layers];
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=raster-tile-layer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raster-tile-layer.js","sourceRoot":"","sources":["../../src/raster-tile-layer/raster-tile-layer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAO/C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAm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gBAAgB;gBAChB,gBAAgB,EAAE,UAAU,CAAC,aAAa;gBAC1C,gBAAgB,EAAE,UAAU,CAAC,eAAe;aAC7C;YACH,CAAC,CAAC;gBACE,gBAAgB;gBAChB,gBAAgB;gBAChB,gBAAgB,EAAE,UAAU,CAAC,aAAa;gBAC1C,gBAAgB,EAAE,UAAU,CAAC,eAAe;aAC7C,CAAC;QACN,MAAM,mBAAmB,GAAwB,OAAO;YACtD,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC;gBACE,gBAAgB,EAAE,WAAW;gBAC7B,gBAAgB,EAAE,CAAC,SAAS,GAAG,CAAC,EAAE,SAAS,GAAG,CAAC,EAAE,CAAC,CAAC;gBACnD,6BAA6B;gBAC7B,WAAW,EAAE;oBACX,2BAA2B,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;oBACpC,CAAC,EAAE,2BAA2B,EAAE,CAAC,EAAE,CAAC;oBACpC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;oBACV,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;iBACX;aACF,CAAC;QAEN,MAAM,WAAW,GAAG,IAAI,WAAW,CACjC,IAAI,CAAC,gBAAgB,CAAC;YACpB,EAAE,EAAE,GAAG,KAAK,CAAC,EAAE,SAAS;YACxB,KAAK;YACL,MAAM;YACN,sEAAsE;YACtE,sDAAsD;YACtD,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC;YACrC,cAAc;YACd,QAAQ;YACR,eAAe;YACf,KAAK;YACL,YAAY;YACZ,GAAG,mBAAmB;SACvB,CAAC,CACH,CAAC;QACF,OAAO,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,CAAC;IAClC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Affine } from "@developmentseed/affine";
|
|
2
|
+
import type { TilesetLevel } from "./tileset-interface.js";
|
|
3
|
+
import type { Bounds, Corners } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Constructor options for {@link AffineTilesetLevel}.
|
|
6
|
+
*/
|
|
7
|
+
export interface AffineTilesetLevelOptions {
|
|
8
|
+
/** Pixel → CRS affine transform for this resolution level. */
|
|
9
|
+
affine: Affine;
|
|
10
|
+
/** Full level width, in pixels. */
|
|
11
|
+
arrayWidth: number;
|
|
12
|
+
/** Full level height, in pixels. */
|
|
13
|
+
arrayHeight: number;
|
|
14
|
+
/** Tile width, in pixels. */
|
|
15
|
+
tileWidth: number;
|
|
16
|
+
/** Tile height, in pixels. */
|
|
17
|
+
tileHeight: number;
|
|
18
|
+
/** Meters per CRS unit (1 for metric CRSes, ≈111000 for WGS84). */
|
|
19
|
+
mpu: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A {@link TilesetLevel} described by a single affine transform plus tile and
|
|
23
|
+
* array sizes.
|
|
24
|
+
*
|
|
25
|
+
* This handles axis-aligned, rotated, skewed, and non-square-pixel grids
|
|
26
|
+
* uniformly. Sources that fit this shape (tiled GeoTIFF overviews, GeoZarr
|
|
27
|
+
* multiscales) can construct one of these per resolution level instead of
|
|
28
|
+
* implementing {@link TilesetLevel} manually.
|
|
29
|
+
*/
|
|
30
|
+
export declare class AffineTilesetLevel implements TilesetLevel {
|
|
31
|
+
readonly tileWidth: number;
|
|
32
|
+
readonly tileHeight: number;
|
|
33
|
+
readonly matrixWidth: number;
|
|
34
|
+
readonly matrixHeight: number;
|
|
35
|
+
readonly metersPerPixel: number;
|
|
36
|
+
/**
|
|
37
|
+
* Source-CRS bounding box of the level's array `[minX, minY, maxX, maxY]`.
|
|
38
|
+
* Computed from the affine applied to the four array corners.
|
|
39
|
+
*/
|
|
40
|
+
readonly projectedBounds: Bounds;
|
|
41
|
+
private readonly _affine;
|
|
42
|
+
private readonly _invAffine;
|
|
43
|
+
constructor(options: AffineTilesetLevelOptions);
|
|
44
|
+
projectedTileCorners(col: number, row: number): Corners;
|
|
45
|
+
tileTransform(col: number, row: number): {
|
|
46
|
+
forwardTransform: (x: number, y: number) => [number, number];
|
|
47
|
+
inverseTransform: (x: number, y: number) => [number, number];
|
|
48
|
+
};
|
|
49
|
+
crsBoundsToTileRange(projectedMinX: number, projectedMinY: number, projectedMaxX: number, projectedMaxY: number): {
|
|
50
|
+
minCol: number;
|
|
51
|
+
maxCol: number;
|
|
52
|
+
minRow: number;
|
|
53
|
+
maxRow: number;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=affine-tileset-level.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affine-tileset-level.d.ts","sourceRoot":"","sources":["../../src/raster-tileset/affine-tileset-level.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;GAQG;AACH,qBAAa,kBAAmB,YAAW,YAAY;IACrD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IAEjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAExB,OAAO,EAAE,yBAAyB;IA6B9C,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IAavD,aAAa,CACX,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV;QACD,gBAAgB,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC7D,gBAAgB,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC9D;IAaD,oBAAoB,CAClB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,GACpB;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;CAmCtE"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import * as affine from "@developmentseed/affine";
|
|
2
|
+
/**
|
|
3
|
+
* A {@link TilesetLevel} described by a single affine transform plus tile and
|
|
4
|
+
* array sizes.
|
|
5
|
+
*
|
|
6
|
+
* This handles axis-aligned, rotated, skewed, and non-square-pixel grids
|
|
7
|
+
* uniformly. Sources that fit this shape (tiled GeoTIFF overviews, GeoZarr
|
|
8
|
+
* multiscales) can construct one of these per resolution level instead of
|
|
9
|
+
* implementing {@link TilesetLevel} manually.
|
|
10
|
+
*/
|
|
11
|
+
export class AffineTilesetLevel {
|
|
12
|
+
tileWidth;
|
|
13
|
+
tileHeight;
|
|
14
|
+
matrixWidth;
|
|
15
|
+
matrixHeight;
|
|
16
|
+
metersPerPixel;
|
|
17
|
+
/**
|
|
18
|
+
* Source-CRS bounding box of the level's array `[minX, minY, maxX, maxY]`.
|
|
19
|
+
* Computed from the affine applied to the four array corners.
|
|
20
|
+
*/
|
|
21
|
+
projectedBounds;
|
|
22
|
+
_affine;
|
|
23
|
+
_invAffine;
|
|
24
|
+
constructor(options) {
|
|
25
|
+
this._affine = options.affine;
|
|
26
|
+
this._invAffine = affine.invert(options.affine);
|
|
27
|
+
this.tileWidth = options.tileWidth;
|
|
28
|
+
this.tileHeight = options.tileHeight;
|
|
29
|
+
this.matrixWidth = Math.ceil(options.arrayWidth / options.tileWidth);
|
|
30
|
+
this.matrixHeight = Math.ceil(options.arrayHeight / options.tileHeight);
|
|
31
|
+
// Geometric mean of the two pixel-edge scales handles non-square pixels.
|
|
32
|
+
const a = affine.a(options.affine);
|
|
33
|
+
const e = affine.e(options.affine);
|
|
34
|
+
this.metersPerPixel = Math.sqrt(Math.abs(a * e)) * options.mpu;
|
|
35
|
+
const corners = [
|
|
36
|
+
affine.apply(options.affine, 0, 0),
|
|
37
|
+
affine.apply(options.affine, options.arrayWidth, 0),
|
|
38
|
+
affine.apply(options.affine, 0, options.arrayHeight),
|
|
39
|
+
affine.apply(options.affine, options.arrayWidth, options.arrayHeight),
|
|
40
|
+
];
|
|
41
|
+
const xs = corners.map(([x]) => x);
|
|
42
|
+
const ys = corners.map(([, y]) => y);
|
|
43
|
+
this.projectedBounds = [
|
|
44
|
+
Math.min(...xs),
|
|
45
|
+
Math.min(...ys),
|
|
46
|
+
Math.max(...xs),
|
|
47
|
+
Math.max(...ys),
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
projectedTileCorners(col, row) {
|
|
51
|
+
const tw = this.tileWidth;
|
|
52
|
+
const th = this.tileHeight;
|
|
53
|
+
const af = this._affine;
|
|
54
|
+
return {
|
|
55
|
+
topLeft: affine.apply(af, col * tw, row * th),
|
|
56
|
+
topRight: affine.apply(af, (col + 1) * tw, row * th),
|
|
57
|
+
bottomLeft: affine.apply(af, col * tw, (row + 1) * th),
|
|
58
|
+
bottomRight: affine.apply(af, (col + 1) * tw, (row + 1) * th),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
tileTransform(col, row) {
|
|
62
|
+
const tileOffset = affine.translation(col * this.tileWidth, row * this.tileHeight);
|
|
63
|
+
const tileAffine = affine.compose(this._affine, tileOffset);
|
|
64
|
+
const invTileAffine = affine.invert(tileAffine);
|
|
65
|
+
return {
|
|
66
|
+
forwardTransform: (x, y) => affine.apply(tileAffine, x, y),
|
|
67
|
+
inverseTransform: (x, y) => affine.apply(invTileAffine, x, y),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
crsBoundsToTileRange(projectedMinX, projectedMinY, projectedMaxX, projectedMaxY) {
|
|
71
|
+
// Map all four CRS corners through the inverse affine to get pixel coords,
|
|
72
|
+
// then take the bbox in pixel space (handles rotation correctly).
|
|
73
|
+
const inv = this._invAffine;
|
|
74
|
+
const pixelCorners = [
|
|
75
|
+
affine.apply(inv, projectedMinX, projectedMinY),
|
|
76
|
+
affine.apply(inv, projectedMaxX, projectedMinY),
|
|
77
|
+
affine.apply(inv, projectedMinX, projectedMaxY),
|
|
78
|
+
affine.apply(inv, projectedMaxX, projectedMaxY),
|
|
79
|
+
];
|
|
80
|
+
const xs = pixelCorners.map(([px]) => px);
|
|
81
|
+
const ys = pixelCorners.map(([, py]) => py);
|
|
82
|
+
const pixMinX = Math.min(...xs);
|
|
83
|
+
const pixMaxX = Math.max(...xs);
|
|
84
|
+
const pixMinY = Math.min(...ys);
|
|
85
|
+
const pixMaxY = Math.max(...ys);
|
|
86
|
+
const tw = this.tileWidth;
|
|
87
|
+
const th = this.tileHeight;
|
|
88
|
+
const maxColIdx = this.matrixWidth - 1;
|
|
89
|
+
const maxRowIdx = this.matrixHeight - 1;
|
|
90
|
+
// Asymmetric clamping: only clamp minCol/minRow up from below and
|
|
91
|
+
// maxCol/maxRow down from above. If the bbox lies entirely outside the
|
|
92
|
+
// array, this produces an empty range (min > max) so the consumer's
|
|
93
|
+
// `for (i = min; i <= max; i++)` loop does nothing.
|
|
94
|
+
const minCol = Math.max(0, Math.floor(pixMinX / tw));
|
|
95
|
+
const maxCol = Math.min(maxColIdx, Math.floor(pixMaxX / tw));
|
|
96
|
+
const minRow = Math.max(0, Math.floor(pixMinY / th));
|
|
97
|
+
const maxRow = Math.min(maxRowIdx, Math.floor(pixMaxY / th));
|
|
98
|
+
return { minCol, maxCol, minRow, maxRow };
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=affine-tileset-level.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affine-tileset-level.js","sourceRoot":"","sources":["../../src/raster-tileset/affine-tileset-level.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,yBAAyB,CAAC;AAsBlD;;;;;;;;GAQG;AACH,MAAM,OAAO,kBAAkB;IACpB,SAAS,CAAS;IAClB,UAAU,CAAS;IACnB,WAAW,CAAS;IACpB,YAAY,CAAS;IACrB,cAAc,CAAS;IAChC;;;OAGG;IACM,eAAe,CAAS;IAEhB,OAAO,CAAS;IAChB,UAAU,CAAS;IAEpC,YAAY,OAAkC;QAC5C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAChD,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QACrE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,OAAO,C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C,CAAC;QAExC,kEAAkE;QAClE,uEAAuE;QACvE,oEAAoE;QACpE,oDAAoD;QACpD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC;QACrD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC;QAC7D,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC;QACrD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC;QAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC5C,CAAC;CACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AffineTilesetLevel } from "./affine-tileset-level.js";
|
|
2
|
+
import type { TilesetDescriptor } from "./tileset-interface.js";
|
|
3
|
+
import type { Bounds, ProjectionFunction } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Constructor options for {@link AffineTileset}.
|
|
6
|
+
*/
|
|
7
|
+
export interface AffineTilesetOptions {
|
|
8
|
+
/** Resolution levels, ordered coarsest first. */
|
|
9
|
+
levels: AffineTilesetLevel[];
|
|
10
|
+
/** Forward projection function from source CRS to EPSG:3857. */
|
|
11
|
+
projectTo3857: ProjectionFunction;
|
|
12
|
+
/** Inverse projection function from EPSG:3857 to source CRS. */
|
|
13
|
+
projectFrom3857: ProjectionFunction;
|
|
14
|
+
/** Forward projection function from source CRS to EPSG:4326. */
|
|
15
|
+
projectTo4326: ProjectionFunction;
|
|
16
|
+
/** Inverse projection function from EPSG:4326 to source CRS. */
|
|
17
|
+
projectFrom4326: ProjectionFunction;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A {@link TilesetDescriptor} backed by per-level affine transforms.
|
|
21
|
+
*
|
|
22
|
+
* Derives `projectedBounds` from the coarsest level's array. Everything else
|
|
23
|
+
* is passed through from the constructor options.
|
|
24
|
+
*/
|
|
25
|
+
export declare class AffineTileset implements TilesetDescriptor {
|
|
26
|
+
readonly levels: AffineTilesetLevel[];
|
|
27
|
+
readonly projectTo3857: ProjectionFunction;
|
|
28
|
+
readonly projectFrom3857: ProjectionFunction;
|
|
29
|
+
readonly projectTo4326: ProjectionFunction;
|
|
30
|
+
readonly projectFrom4326: ProjectionFunction;
|
|
31
|
+
readonly projectedBounds: Bounds;
|
|
32
|
+
constructor(options: AffineTilesetOptions);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=affine-tileset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affine-tileset.d.ts","sourceRoot":"","sources":["../../src/raster-tileset/affine-tileset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,iDAAiD;IACjD,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,gEAAgE;IAChE,aAAa,EAAE,kBAAkB,CAAC;IAClC,gEAAgE;IAChE,eAAe,EAAE,kBAAkB,CAAC;IACpC,gEAAgE;IAChE,aAAa,EAAE,kBAAkB,CAAC;IAClC,gEAAgE;IAChE,eAAe,EAAE,kBAAkB,CAAC;CACrC;AAED;;;;;GAKG;AACH,qBAAa,aAAc,YAAW,iBAAiB;IACrD,QAAQ,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC;IACtC,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAC;IAC3C,QAAQ,CAAC,eAAe,EAAE,kBAAkB,CAAC;IAC7C,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAC;IAC3C,QAAQ,CAAC,eAAe,EAAE,kBAAkB,CAAC;IAC7C,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;gBAErB,OAAO,EAAE,oBAAoB;CAW1C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A {@link TilesetDescriptor} backed by per-level affine transforms.
|
|
3
|
+
*
|
|
4
|
+
* Derives `projectedBounds` from the coarsest level's array. Everything else
|
|
5
|
+
* is passed through from the constructor options.
|
|
6
|
+
*/
|
|
7
|
+
export class AffineTileset {
|
|
8
|
+
levels;
|
|
9
|
+
projectTo3857;
|
|
10
|
+
projectFrom3857;
|
|
11
|
+
projectTo4326;
|
|
12
|
+
projectFrom4326;
|
|
13
|
+
projectedBounds;
|
|
14
|
+
constructor(options) {
|
|
15
|
+
if (options.levels.length === 0) {
|
|
16
|
+
throw new Error("AffineTileset requires at least one level");
|
|
17
|
+
}
|
|
18
|
+
this.levels = options.levels;
|
|
19
|
+
this.projectTo3857 = options.projectTo3857;
|
|
20
|
+
this.projectFrom3857 = options.projectFrom3857;
|
|
21
|
+
this.projectTo4326 = options.projectTo4326;
|
|
22
|
+
this.projectFrom4326 = options.projectFrom4326;
|
|
23
|
+
this.projectedBounds = options.levels[0].projectedBounds;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=affine-tileset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affine-tileset.js","sourceRoot":"","sources":["../../src/raster-tileset/affine-tileset.ts"],"names":[],"mappings":"AAoBA;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IACf,MAAM,CAAuB;IAC7B,aAAa,CAAqB;IAClC,eAAe,CAAqB;IACpC,aAAa,CAAqB;IAClC,eAAe,CAAqB;IACpC,eAAe,CAAS;IAEjC,YAAY,OAA6B;QACvC,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC3C,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAC/C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC3C,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAC/C,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC,eAAe,CAAC;IAC5D,CAAC;CACF"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export type { AffineTilesetOptions } from "./affine-tileset.js";
|
|
2
|
+
export { AffineTileset } from "./affine-tileset.js";
|
|
3
|
+
export type { AffineTilesetLevelOptions } from "./affine-tileset-level.js";
|
|
4
|
+
export { AffineTilesetLevel } from "./affine-tileset-level.js";
|
|
1
5
|
export type { TileMetadata } from "./raster-tileset-2d.js";
|
|
2
6
|
export { RasterTileset2D } from "./raster-tileset-2d.js";
|
|
3
7
|
export { TileMatrixSetAdaptor } from "./tile-matrix-set.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/raster-tileset/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC9E,YAAY,EACV,MAAM,EACN,YAAY,EACZ,OAAO,EACP,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/raster-tileset/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC9E,YAAY,EACV,MAAM,EACN,YAAY,EACZ,OAAO,EACP,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { AffineTileset } from "./affine-tileset.js";
|
|
2
|
+
export { AffineTilesetLevel } from "./affine-tileset-level.js";
|
|
1
3
|
export { RasterTileset2D } from "./raster-tileset-2d.js";
|
|
2
4
|
export { TileMatrixSetAdaptor } from "./tile-matrix-set.js";
|
|
3
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/raster-tileset/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/raster-tileset/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -139,6 +139,28 @@ export declare class RasterTileNode {
|
|
|
139
139
|
*/
|
|
140
140
|
private _getGenericBoundingVolume;
|
|
141
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Build the list of root (z=0) `RasterTileNode`s for the traversal.
|
|
144
|
+
*
|
|
145
|
+
* Small root matrices (≤ {@link MAX_ROOT_TILES_NO_CULL}) are enumerated
|
|
146
|
+
* directly — traditional pyramids with a 1×1 or 4×5 root grid skip any
|
|
147
|
+
* projection work and keep bit-identical behavior to the pre-optimization
|
|
148
|
+
* traversal.
|
|
149
|
+
*
|
|
150
|
+
* Large root matrices are culled to the intersection of the dataset extent
|
|
151
|
+
* (`datasetWgs84Bounds`) and the viewport's WGS84 bounds, projected into
|
|
152
|
+
* the source CRS via `transformBounds` (which densifies the edges so a
|
|
153
|
+
* curving projection doesn't escape the 4-corner hull). If the viewport
|
|
154
|
+
* and dataset don't overlap, an empty array is returned and the rest of
|
|
155
|
+
* the traversal short-circuits.
|
|
156
|
+
*
|
|
157
|
+
* Exported for unit testing.
|
|
158
|
+
*/
|
|
159
|
+
export declare function createRootTiles(opts: {
|
|
160
|
+
descriptor: TilesetDescriptor;
|
|
161
|
+
viewport: Pick<Viewport, "getBounds">;
|
|
162
|
+
datasetWgs84Bounds: Bounds;
|
|
163
|
+
}): RasterTileNode[];
|
|
142
164
|
/**
|
|
143
165
|
* Get tile indices visible in viewport.
|
|
144
166
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"raster-tile-traversal.d.ts","sourceRoot":"","sources":["../../src/raster-tileset/raster-tile-traversal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;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IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,GACA,SAAS,EAAE,CAqFb"}
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* both OGC TileMatrixSet grids and Zarr multiscale pyramids.
|
|
18
18
|
*/
|
|
19
19
|
import { _GlobeViewport, assert } from "@deck.gl/core";
|
|
20
|
+
import { transformBounds } from "@developmentseed/proj";
|
|
20
21
|
import { CullingVolume, makeOrientedBoundingBoxFromPoints, Plane, } from "@math.gl/culling";
|
|
21
22
|
import { lngLatToWorld, worldToLngLat } from "@math.gl/web-mercator";
|
|
22
23
|
/**
|
|
@@ -316,14 +317,18 @@ export class RasterTileNode {
|
|
|
316
317
|
let maxX = Number.NEGATIVE_INFINITY;
|
|
317
318
|
let maxY = Number.NEGATIVE_INFINITY;
|
|
318
319
|
for (const [x, y] of commonSpacePositions) {
|
|
319
|
-
if (x < minX)
|
|
320
|
+
if (x < minX) {
|
|
320
321
|
minX = x;
|
|
321
|
-
|
|
322
|
+
}
|
|
323
|
+
if (y < minY) {
|
|
322
324
|
minY = y;
|
|
323
|
-
|
|
325
|
+
}
|
|
326
|
+
if (x > maxX) {
|
|
324
327
|
maxX = x;
|
|
325
|
-
|
|
328
|
+
}
|
|
329
|
+
if (y > maxY) {
|
|
326
330
|
maxY = y;
|
|
331
|
+
}
|
|
327
332
|
}
|
|
328
333
|
const commonSpaceBounds = [minX, minY, maxX, maxY];
|
|
329
334
|
return {
|
|
@@ -404,6 +409,68 @@ function rescaleEPSG3857ToCommonSpace([x, y]) {
|
|
|
404
409
|
(clampedY / EPSG_3857_CIRCUMFERENCE + 0.5) * TILE_SIZE,
|
|
405
410
|
];
|
|
406
411
|
}
|
|
412
|
+
/**
|
|
413
|
+
* Above this root-tile count, `createRootTiles` culls to the viewport
|
|
414
|
+
* before instantiation. Below it, every root tile is created and downstream
|
|
415
|
+
* frustum culling filters the unused ones. Typical OGC pyramids have 1–a
|
|
416
|
+
* few dozen tiles at z=0, so they stay on the unchanged path. Large
|
|
417
|
+
* single-level zarr descriptors (e.g. AEF mosaic: ~15000 × 7000 ≈ 100M root
|
|
418
|
+
* tiles) must take the culled path or instantiation hangs the page.
|
|
419
|
+
*/
|
|
420
|
+
const MAX_ROOT_TILES_NO_CULL = 100;
|
|
421
|
+
/**
|
|
422
|
+
* Build the list of root (z=0) `RasterTileNode`s for the traversal.
|
|
423
|
+
*
|
|
424
|
+
* Small root matrices (≤ {@link MAX_ROOT_TILES_NO_CULL}) are enumerated
|
|
425
|
+
* directly — traditional pyramids with a 1×1 or 4×5 root grid skip any
|
|
426
|
+
* projection work and keep bit-identical behavior to the pre-optimization
|
|
427
|
+
* traversal.
|
|
428
|
+
*
|
|
429
|
+
* Large root matrices are culled to the intersection of the dataset extent
|
|
430
|
+
* (`datasetWgs84Bounds`) and the viewport's WGS84 bounds, projected into
|
|
431
|
+
* the source CRS via `transformBounds` (which densifies the edges so a
|
|
432
|
+
* curving projection doesn't escape the 4-corner hull). If the viewport
|
|
433
|
+
* and dataset don't overlap, an empty array is returned and the rest of
|
|
434
|
+
* the traversal short-circuits.
|
|
435
|
+
*
|
|
436
|
+
* Exported for unit testing.
|
|
437
|
+
*/
|
|
438
|
+
export function createRootTiles(opts) {
|
|
439
|
+
const { descriptor, viewport, datasetWgs84Bounds } = opts;
|
|
440
|
+
const rootLevel = descriptor.levels[0];
|
|
441
|
+
const roots = [];
|
|
442
|
+
const rootTileCount = rootLevel.matrixWidth * rootLevel.matrixHeight;
|
|
443
|
+
if (rootTileCount <= MAX_ROOT_TILES_NO_CULL) {
|
|
444
|
+
// Small root matrix → enumerate every tile; downstream frustum culling
|
|
445
|
+
// handles the small amount of waste.
|
|
446
|
+
for (let y = 0; y < rootLevel.matrixHeight; y++) {
|
|
447
|
+
for (let x = 0; x < rootLevel.matrixWidth; x++) {
|
|
448
|
+
roots.push(new RasterTileNode(x, y, 0, { descriptor }));
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
return roots;
|
|
452
|
+
}
|
|
453
|
+
// Large root matrix → intersect dataset extent with viewport, project
|
|
454
|
+
// to source CRS, use the root level's tile-range helper.
|
|
455
|
+
const vpBounds = viewport.getBounds();
|
|
456
|
+
const cullBounds = [
|
|
457
|
+
Math.max(datasetWgs84Bounds[0], vpBounds[0]),
|
|
458
|
+
Math.max(datasetWgs84Bounds[1], vpBounds[1]),
|
|
459
|
+
Math.min(datasetWgs84Bounds[2], vpBounds[2]),
|
|
460
|
+
Math.min(datasetWgs84Bounds[3], vpBounds[3]),
|
|
461
|
+
];
|
|
462
|
+
if (cullBounds[0] > cullBounds[2] || cullBounds[1] > cullBounds[3]) {
|
|
463
|
+
return roots;
|
|
464
|
+
}
|
|
465
|
+
const [minX, minY, maxX, maxY] = transformBounds(descriptor.projectFrom4326, cullBounds[0], cullBounds[1], cullBounds[2], cullBounds[3]);
|
|
466
|
+
const rootRange = rootLevel.crsBoundsToTileRange(minX, minY, maxX, maxY);
|
|
467
|
+
for (let y = rootRange.minRow; y <= rootRange.maxRow; y++) {
|
|
468
|
+
for (let x = rootRange.minCol; x <= rootRange.maxCol; x++) {
|
|
469
|
+
roots.push(new RasterTileNode(x, y, 0, { descriptor }));
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
return roots;
|
|
473
|
+
}
|
|
407
474
|
/**
|
|
408
475
|
* Get tile indices visible in viewport.
|
|
409
476
|
*
|
|
@@ -460,17 +527,11 @@ export function getTileIndices(descriptor, opts) {
|
|
|
460
527
|
topRight[0],
|
|
461
528
|
topRight[1],
|
|
462
529
|
];
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
const roots = [];
|
|
469
|
-
for (let y = 0; y < rootLevel.matrixHeight; y++) {
|
|
470
|
-
for (let x = 0; x < rootLevel.matrixWidth; x++) {
|
|
471
|
-
roots.push(new RasterTileNode(x, y, 0, { descriptor }));
|
|
472
|
-
}
|
|
473
|
-
}
|
|
530
|
+
const roots = createRootTiles({
|
|
531
|
+
descriptor,
|
|
532
|
+
viewport,
|
|
533
|
+
datasetWgs84Bounds: wgs84Bounds,
|
|
534
|
+
});
|
|
474
535
|
// Traverse and update visibility
|
|
475
536
|
const traversalParams = {
|
|
476
537
|
viewport,
|