@spacexr/tiles 0.0.0-stage → 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/LICENSE +201 -0
- package/README.md +57 -2
- package/dist/addressing/index.d.ts +16 -0
- package/dist/addressing/index.js +4 -0
- package/dist/addressing/index.js.map +1 -0
- package/dist/bake/index.d.ts +91 -0
- package/dist/bake/index.js +3 -0
- package/dist/bake/index.js.map +1 -0
- package/dist/celestial-dataset-CUIsplKO.d.ts +99 -0
- package/dist/chunk-2HLQXRDD.js +246 -0
- package/dist/chunk-2HLQXRDD.js.map +1 -0
- package/dist/chunk-6YNCRDEE.js +170 -0
- package/dist/chunk-6YNCRDEE.js.map +1 -0
- package/dist/chunk-7AWV2IEK.js +79 -0
- package/dist/chunk-7AWV2IEK.js.map +1 -0
- package/dist/chunk-ESLGXWQR.js +219 -0
- package/dist/chunk-ESLGXWQR.js.map +1 -0
- package/dist/chunk-FB57CZDK.js +312 -0
- package/dist/chunk-FB57CZDK.js.map +1 -0
- package/dist/chunk-GRTG4WNA.js +44 -0
- package/dist/chunk-GRTG4WNA.js.map +1 -0
- package/dist/chunk-HVYN4AIT.js +45 -0
- package/dist/chunk-HVYN4AIT.js.map +1 -0
- package/dist/chunk-IGNRXAW3.js +77 -0
- package/dist/chunk-IGNRXAW3.js.map +1 -0
- package/dist/chunk-QGTREKHS.js +145 -0
- package/dist/chunk-QGTREKHS.js.map +1 -0
- package/dist/chunk-SPDRAY37.js +56 -0
- package/dist/chunk-SPDRAY37.js.map +1 -0
- package/dist/chunk-TA4BEVHL.js +81 -0
- package/dist/chunk-TA4BEVHL.js.map +1 -0
- package/dist/chunk-TGOB5HT5.js +149 -0
- package/dist/chunk-TGOB5HT5.js.map +1 -0
- package/dist/chunk-X6ZJ2PDY.js +104 -0
- package/dist/chunk-X6ZJ2PDY.js.map +1 -0
- package/dist/chunk-XTY4HCPY.js +22 -0
- package/dist/chunk-XTY4HCPY.js.map +1 -0
- package/dist/chunk-Y66PNDG2.js +107 -0
- package/dist/chunk-Y66PNDG2.js.map +1 -0
- package/dist/chunk-YEACOJOC.js +51 -0
- package/dist/chunk-YEACOJOC.js.map +1 -0
- package/dist/cube/index.d.ts +160 -0
- package/dist/cube/index.js +9 -0
- package/dist/cube/index.js.map +1 -0
- package/dist/datasets/index.d.ts +75 -0
- package/dist/datasets/index.js +11 -0
- package/dist/datasets/index.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/mercator/index.d.ts +24 -0
- package/dist/mercator/index.js +8 -0
- package/dist/mercator/index.js.map +1 -0
- package/dist/metrics-HGbzqj6L.d.ts +45 -0
- package/dist/pyramid/index.d.ts +156 -0
- package/dist/pyramid/index.js +4 -0
- package/dist/pyramid/index.js.map +1 -0
- package/dist/raster-registration-CgBxrhDB.d.ts +19 -0
- package/dist/reference-surface-CsTtrNsc.d.ts +49 -0
- package/dist/reprojection/index.d.ts +255 -0
- package/dist/reprojection/index.js +6 -0
- package/dist/reprojection/index.js.map +1 -0
- package/dist/sources/index.d.ts +55 -0
- package/dist/sources/index.js +7 -0
- package/dist/sources/index.js.map +1 -0
- package/dist/surface/index.d.ts +15 -0
- package/dist/surface/index.js +4 -0
- package/dist/surface/index.js.map +1 -0
- package/dist/tile-D-jjIRRA.d.ts +53 -0
- package/dist/tile-address-BkfSftp6.d.ts +66 -0
- package/dist/tile-http-client-BHZOtGX7.d.ts +73 -0
- package/dist/tile-neighbors-LfvV7oiX.d.ts +48 -0
- package/dist/tile-surface-s9Zi6X9_.d.ts +40 -0
- package/dist/tile-topology-B6xHYqPb.d.ts +51 -0
- package/dist/web-mercator-dataset-Dmou8byO.d.ts +125 -0
- package/dist/web-tile-source-DrZDBIm6.d.ts +92 -0
- package/package.json +122 -5
- package/src/addressing/index.ts +8 -0
- package/src/addressing/metrics.ts +48 -0
- package/src/addressing/raster-registration.ts +22 -0
- package/src/addressing/tile-address.ts +130 -0
- package/src/addressing/tile-edge-rotation.ts +13 -0
- package/src/addressing/tile-neighbors.ts +73 -0
- package/src/addressing/tile-surface.ts +44 -0
- package/src/addressing/tile-topology.ts +86 -0
- package/src/addressing/tile.ts +73 -0
- package/src/bake/bake-pyramid.ts +106 -0
- package/src/bake/index.ts +2 -0
- package/src/bake/pyramid-levels.ts +63 -0
- package/src/cube/celestial-dataset.ts +182 -0
- package/src/cube/cube-face.ts +51 -0
- package/src/cube/cube-geometric-error.ts +30 -0
- package/src/cube/cube-mapping.ts +101 -0
- package/src/cube/cube-neighbors.ts +198 -0
- package/src/cube/cube-tile-surface.ts +30 -0
- package/src/cube/index.ts +6 -0
- package/src/datasets/index.ts +1 -0
- package/src/datasets/tile-dataset.ts +121 -0
- package/src/index.ts +9 -0
- package/src/mercator/index.ts +3 -0
- package/src/mercator/web-mercator-dataset.ts +215 -0
- package/src/mercator/web-mercator-tile-metrics.ts +119 -0
- package/src/mercator/web-mercator-tile-surface.ts +52 -0
- package/src/pyramid/index.ts +2 -0
- package/src/pyramid/resident-tiles.ts +81 -0
- package/src/pyramid/tile-pyramid.ts +285 -0
- package/src/reprojection/cube-resampling.ts +159 -0
- package/src/reprojection/index.ts +4 -0
- package/src/reprojection/source-projection.ts +196 -0
- package/src/reprojection/source-tile-matrix.ts +100 -0
- package/src/reprojection/wmts-capabilities.ts +112 -0
- package/src/sources/index.ts +4 -0
- package/src/sources/tile-http-client.ts +154 -0
- package/src/sources/tile-layer-changes.ts +88 -0
- package/src/sources/url-template.ts +96 -0
- package/src/sources/web-tile-source.ts +73 -0
- package/src/surface/directions.ts +27 -0
- package/src/surface/index.ts +2 -0
- package/src/surface/reference-surface.ts +88 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { TileHttpClient, validateTileUrlTemplate, expandTileUrlTemplate } from './chunk-6YNCRDEE.js';
|
|
2
|
+
import { assertRasterRegistration } from './chunk-X6ZJ2PDY.js';
|
|
3
|
+
|
|
4
|
+
// src/sources/web-tile-source.ts
|
|
5
|
+
var WebTileSource = class {
|
|
6
|
+
id;
|
|
7
|
+
urlTemplate;
|
|
8
|
+
metrics;
|
|
9
|
+
registration;
|
|
10
|
+
attribution;
|
|
11
|
+
client;
|
|
12
|
+
templateOptions;
|
|
13
|
+
/** @throws TypeError When `registration` is missing or unknown. */
|
|
14
|
+
constructor(options) {
|
|
15
|
+
assertRasterRegistration(options.registration);
|
|
16
|
+
this.id = options.id ?? "web-tiles";
|
|
17
|
+
this.urlTemplate = options.urlTemplate;
|
|
18
|
+
this.metrics = options.metrics;
|
|
19
|
+
this.registration = options.registration;
|
|
20
|
+
this.attribution = options.attribution;
|
|
21
|
+
this.templateOptions = {
|
|
22
|
+
...options.subdomains ? { subdomains: [...options.subdomains] } : {},
|
|
23
|
+
...options.variables ? { variables: { ...options.variables } } : {}
|
|
24
|
+
};
|
|
25
|
+
this.client = options.client instanceof TileHttpClient ? options.client : new TileHttpClient(options.client);
|
|
26
|
+
validateTileUrlTemplate(this.urlTemplate, this.templateOptions);
|
|
27
|
+
}
|
|
28
|
+
/** Returns `true` when the source serves this level of detail. */
|
|
29
|
+
servesLevel(lod) {
|
|
30
|
+
return Number.isInteger(lod) && lod >= this.metrics.minLOD && lod <= this.metrics.maxLOD;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Returns the URL of a tile.
|
|
34
|
+
*
|
|
35
|
+
* @throws RangeError When the level is not served or the address lies outside its level.
|
|
36
|
+
*/
|
|
37
|
+
urlOf(address) {
|
|
38
|
+
if (!this.servesLevel(address.lod)) {
|
|
39
|
+
throw new RangeError(`Source ${this.id} serves levels ${this.metrics.minLOD} to ${this.metrics.maxLOD}, not ${address.lod}.`);
|
|
40
|
+
}
|
|
41
|
+
return expandTileUrlTemplate(this.urlTemplate, address, this.templateOptions);
|
|
42
|
+
}
|
|
43
|
+
/** Fetches a tile. See {@link TileHttpClient.fetchTile}. */
|
|
44
|
+
fetchTile(address, signal) {
|
|
45
|
+
return this.client.fetchTile(this.urlOf(address), signal);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export { WebTileSource };
|
|
50
|
+
//# sourceMappingURL=chunk-YEACOJOC.js.map
|
|
51
|
+
//# sourceMappingURL=chunk-YEACOJOC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/sources/web-tile-source.ts"],"names":[],"mappings":";;;;AA0BO,IAAM,gBAAN,MAAoB;AAAA,EACP,EAAA;AAAA,EACA,WAAA;AAAA,EACA,OAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,MAAA;AAAA,EACC,eAAA;AAAA;AAAA,EAGV,YAAY,OAAA,EAAgC;AAC/C,IAAA,wBAAA,CAAyB,QAAQ,YAAY,CAAA;AAC7C,IAAA,IAAA,CAAK,EAAA,GAAK,QAAQ,EAAA,IAAM,WAAA;AACxB,IAAA,IAAA,CAAK,cAAc,OAAA,CAAQ,WAAA;AAC3B,IAAA,IAAA,CAAK,UAAU,OAAA,CAAQ,OAAA;AACvB,IAAA,IAAA,CAAK,eAAe,OAAA,CAAQ,YAAA;AAC5B,IAAA,IAAA,CAAK,cAAc,OAAA,CAAQ,WAAA;AAC3B,IAAA,IAAA,CAAK,eAAA,GAAkB;AAAA,MACnB,GAAI,OAAA,CAAQ,UAAA,GAAa,EAAE,UAAA,EAAY,CAAC,GAAG,OAAA,CAAQ,UAAU,CAAA,EAAE,GAAI,EAAC;AAAA,MACpE,GAAI,OAAA,CAAQ,SAAA,GAAY,EAAE,SAAA,EAAW,EAAE,GAAG,OAAA,CAAQ,SAAA,EAAU,EAAE,GAAI;AAAC,KACvE;AACA,IAAA,IAAA,CAAK,MAAA,GAAS,QAAQ,MAAA,YAAkB,cAAA,GAAiB,QAAQ,MAAA,GAAS,IAAI,cAAA,CAAe,OAAA,CAAQ,MAAM,CAAA;AAC3G,IAAA,uBAAA,CAAwB,IAAA,CAAK,WAAA,EAAa,IAAA,CAAK,eAAe,CAAA;AAAA,EAClE;AAAA;AAAA,EAGO,YAAY,GAAA,EAAsB;AACrC,IAAA,OAAO,MAAA,CAAO,SAAA,CAAU,GAAG,CAAA,IAAK,GAAA,IAAO,KAAK,OAAA,CAAQ,MAAA,IAAU,GAAA,IAAO,IAAA,CAAK,OAAA,CAAQ,MAAA;AAAA,EACtF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,MAAM,OAAA,EAA+B;AACxC,IAAA,IAAI,CAAC,IAAA,CAAK,WAAA,CAAY,OAAA,CAAQ,GAAG,CAAA,EAAG;AAChC,MAAA,MAAM,IAAI,UAAA,CAAW,CAAA,OAAA,EAAU,IAAA,CAAK,EAAE,kBAAkB,IAAA,CAAK,OAAA,CAAQ,MAAM,CAAA,IAAA,EAAO,KAAK,OAAA,CAAQ,MAAM,CAAA,MAAA,EAAS,OAAA,CAAQ,GAAG,CAAA,CAAA,CAAG,CAAA;AAAA,IAChI;AACA,IAAA,OAAO,qBAAA,CAAsB,IAAA,CAAK,WAAA,EAAa,OAAA,EAAS,KAAK,eAAe,CAAA;AAAA,EAChF;AAAA;AAAA,EAGO,SAAA,CAAU,SAAuB,MAAA,EAAgD;AACpF,IAAA,OAAO,KAAK,MAAA,CAAO,SAAA,CAAU,KAAK,KAAA,CAAM,OAAO,GAAG,MAAM,CAAA;AAAA,EAC5D;AACJ","file":"chunk-YEACOJOC.js","sourcesContent":["import { assertRasterRegistration, type ITileAddress, type ITileMetrics, type RasterRegistration } from \"../addressing\";\nimport { TileHttpClient, type ITileHttpClientOptions, type TileFetchResult } from \"./tile-http-client\";\nimport { expandTileUrlTemplate, validateTileUrlTemplate, type ITileUrlTemplateOptions } from \"./url-template\";\n\n/** Options of {@link WebTileSource}. */\nexport interface IWebTileSourceOptions extends ITileUrlTemplateOptions {\n id?: string;\n /** URL template, expanded by {@link expandTileUrlTemplate}. */\n urlTemplate: string;\n /** Addressing, tile size and available levels of the source. */\n metrics: ITileMetrics;\n /** Where the samples of the tiles lie, required: `area` for tiles published as images, whatever they hold. */\n registration: RasterRegistration;\n /** Shared client, or options used to create a dedicated one. */\n client?: TileHttpClient | ITileHttpClientOptions;\n /** Attribution text that applications must display with the tiles. */\n attribution?: string;\n}\n\n/**\n * Tile pyramid served over HTTP.\n *\n * The template is validated at construction, so a misspelled variable fails immediately instead of producing\n * invalid URLs. Requests outside `[metrics.minLOD, metrics.maxLOD]` are rejected: deeper levels must be derived\n * from an ancestor by the caller.\n */\nexport class WebTileSource {\n public readonly id: string;\n public readonly urlTemplate: string;\n public readonly metrics: ITileMetrics;\n public readonly registration: RasterRegistration;\n public readonly attribution: string | undefined;\n public readonly client: TileHttpClient;\n private readonly templateOptions: ITileUrlTemplateOptions;\n\n /** @throws TypeError When `registration` is missing or unknown. */\n public constructor(options: IWebTileSourceOptions) {\n assertRasterRegistration(options.registration);\n this.id = options.id ?? \"web-tiles\";\n this.urlTemplate = options.urlTemplate;\n this.metrics = options.metrics;\n this.registration = options.registration;\n this.attribution = options.attribution;\n this.templateOptions = {\n ...(options.subdomains ? { subdomains: [...options.subdomains] } : {}),\n ...(options.variables ? { variables: { ...options.variables } } : {}),\n };\n this.client = options.client instanceof TileHttpClient ? options.client : new TileHttpClient(options.client);\n validateTileUrlTemplate(this.urlTemplate, this.templateOptions);\n }\n\n /** Returns `true` when the source serves this level of detail. */\n public servesLevel(lod: number): boolean {\n return Number.isInteger(lod) && lod >= this.metrics.minLOD && lod <= this.metrics.maxLOD;\n }\n\n /**\n * Returns the URL of a tile.\n *\n * @throws RangeError When the level is not served or the address lies outside its level.\n */\n public urlOf(address: ITileAddress): string {\n if (!this.servesLevel(address.lod)) {\n throw new RangeError(`Source ${this.id} serves levels ${this.metrics.minLOD} to ${this.metrics.maxLOD}, not ${address.lod}.`);\n }\n return expandTileUrlTemplate(this.urlTemplate, address, this.templateOptions);\n }\n\n /** Fetches a tile. See {@link TileHttpClient.fetchTile}. */\n public fetchTile(address: ITileAddress, signal?: AbortSignal): Promise<TileFetchResult> {\n return this.client.fetchTile(this.urlOf(address), signal);\n }\n}\n"]}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
export { C as CELESTIAL_CUBE_SCHEME, a as CelestialTileSource, b as CubeTileSurface, I as ICelestialDataset, c as ICelestialDatasetSubtree, d as ICelestialTileSourceOptions, p as parseCelestialDataset } from '../celestial-dataset-CUIsplKO.js';
|
|
2
|
+
import { ICartesian3 } from '@spacexr/geodesy';
|
|
3
|
+
import { I as ITileAddress } from '../tile-address-BkfSftp6.js';
|
|
4
|
+
import { R as ReferenceSurface } from '../reference-surface-CsTtrNsc.js';
|
|
5
|
+
import { d as TileEdgeNeighbor, c as TileCornerNeighbor, e as TileNeighbor } from '../tile-neighbors-LfvV7oiX.js';
|
|
6
|
+
import { b as ITileTopology, a as ITileAreaAcross } from '../tile-topology-B6xHYqPb.js';
|
|
7
|
+
import '../tile-http-client-BHZOtGX7.js';
|
|
8
|
+
import '../tile-surface-s9Zi6X9_.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Face of the cube index of a celestial body. Equatorial faces are numbered eastward from the prime meridian; the
|
|
12
|
+
* polar faces follow. See the repository document `docs/celestial-tiling.md`.
|
|
13
|
+
*/
|
|
14
|
+
declare enum CubeFace {
|
|
15
|
+
/** Centred on latitude 0, longitude 0, the `+X` axis. */
|
|
16
|
+
PositiveX = 0,
|
|
17
|
+
/** Centred on latitude 0, longitude 90 degrees east, the `+Y` axis. */
|
|
18
|
+
PositiveY = 1,
|
|
19
|
+
/** Centred on latitude 0, longitude 180 degrees, the `-X` axis. */
|
|
20
|
+
NegativeX = 2,
|
|
21
|
+
/** Centred on latitude 0, longitude 90 degrees west, the `-Y` axis. */
|
|
22
|
+
NegativeY = 3,
|
|
23
|
+
/** Centred on the north pole, the `+Z` axis. */
|
|
24
|
+
North = 4,
|
|
25
|
+
/** Centred on the south pole, the `-Z` axis. */
|
|
26
|
+
South = 5
|
|
27
|
+
}
|
|
28
|
+
/** Number of faces of the cube index. */
|
|
29
|
+
declare const CUBE_FACE_COUNT = 6;
|
|
30
|
+
/** Frame of a cube face: its centre and the directions in which its `u` and `v` coordinates grow. */
|
|
31
|
+
interface ICubeFaceFrame {
|
|
32
|
+
readonly center: Readonly<ICartesian3>;
|
|
33
|
+
readonly u: Readonly<ICartesian3>;
|
|
34
|
+
readonly v: Readonly<ICartesian3>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Frames of the six faces, indexed by {@link CubeFace}. On equatorial faces `u` grows eastward and `v` southward; the
|
|
38
|
+
* polar faces continue face 0 without rotation. On every face `u x v = -center`: seen from outside the body, `u` runs
|
|
39
|
+
* to the right and `v` downward, like the columns and rows of an image.
|
|
40
|
+
*/
|
|
41
|
+
declare const CUBE_FACE_FRAMES: readonly ICubeFaceFrame[];
|
|
42
|
+
/** Returns `true` for an integer face of the cube index. */
|
|
43
|
+
declare function isCubeFace(face: number): face is CubeFace;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Geometric error of a terrain tile of the cube index: the longest of its four edges, measured as the chord between
|
|
47
|
+
* its corners on the reference surface, divided by the cells of a tile side. It follows the distortion of the cube
|
|
48
|
+
* instead of assuming one size per level.
|
|
49
|
+
*
|
|
50
|
+
* @param tileSize - Cells per tile side.
|
|
51
|
+
* @throws RangeError When the address is invalid or the tile size is not positive.
|
|
52
|
+
*/
|
|
53
|
+
declare function cubeTileGeometricError(address: ITileAddress, surface: ReferenceSurface, tileSize: number): number;
|
|
54
|
+
|
|
55
|
+
/** Position on a face of the cube index: `u` and `v` in `[0, 1]`, from the north-west corner of the face. */
|
|
56
|
+
interface ICubeFaceCoordinates {
|
|
57
|
+
face: CubeFace;
|
|
58
|
+
u: number;
|
|
59
|
+
v: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Direction of a point of a face, with the equi-angular mapping: `normalize(C + tan(pi/4 (2u - 1)) U + tan(pi/4
|
|
63
|
+
* (2v - 1)) V)`. Coordinates outside `[0, 1]` extend the face plane, up to `-0.5` and `1.5` exclusive.
|
|
64
|
+
*
|
|
65
|
+
* @param face - Face of the cube index.
|
|
66
|
+
* @param u - Coordinate along the face `u` axis, 0 on its west edge.
|
|
67
|
+
* @param v - Coordinate along the face `v` axis, 0 on its north edge.
|
|
68
|
+
* @param target - Receives the unit direction.
|
|
69
|
+
*/
|
|
70
|
+
declare function cubeFaceDirection(face: CubeFace, u: number, v: number, target?: ICartesian3): ICartesian3;
|
|
71
|
+
/**
|
|
72
|
+
* Face of a direction: the face of its largest absolute component, its sign giving the face. Ties go to the first
|
|
73
|
+
* axis in the order `X`, `Y`, `Z`, so a direction on a cube edge belongs to an equatorial face.
|
|
74
|
+
*
|
|
75
|
+
* @param direction - Any non-zero vector; it does not need to be normalized.
|
|
76
|
+
* @throws RangeError When the direction is zero or not finite.
|
|
77
|
+
*/
|
|
78
|
+
declare function cubeFaceOfDirection(direction: Readonly<ICartesian3>): CubeFace;
|
|
79
|
+
/**
|
|
80
|
+
* Face and face coordinates of a direction, the inverse of {@link cubeFaceDirection}.
|
|
81
|
+
*
|
|
82
|
+
* @param direction - Any non-zero vector; it does not need to be normalized.
|
|
83
|
+
* @throws RangeError When the direction is zero or not finite.
|
|
84
|
+
*/
|
|
85
|
+
declare function cubeFaceCoordinates(direction: Readonly<ICartesian3>): ICubeFaceCoordinates;
|
|
86
|
+
/**
|
|
87
|
+
* Tile of a direction at a level of detail: `floor(u * 2^lod)` and `floor(v * 2^lod)` on its face, clamped so that
|
|
88
|
+
* the east and south edges of the face belong to its last tiles.
|
|
89
|
+
*
|
|
90
|
+
* @throws RangeError When the direction is zero or not finite, or the level is invalid.
|
|
91
|
+
*/
|
|
92
|
+
declare function cubeTileOfDirection(direction: Readonly<ICartesian3>, lod: number): ITileAddress;
|
|
93
|
+
/**
|
|
94
|
+
* Direction of a point of a tile.
|
|
95
|
+
*
|
|
96
|
+
* @param address - Tile of the cube index; a missing face means face 0.
|
|
97
|
+
* @param s - Coordinate in the tile, 0 on its west edge and 1 on its east edge.
|
|
98
|
+
* @param t - Coordinate in the tile, 0 on its north edge and 1 on its south edge.
|
|
99
|
+
* @param target - Receives the unit direction.
|
|
100
|
+
* @throws RangeError When the address is invalid.
|
|
101
|
+
*/
|
|
102
|
+
declare function cubeTileDirection(address: ITileAddress, s: number, t: number, target?: ICartesian3): ICartesian3;
|
|
103
|
+
|
|
104
|
+
/** Edge of the neighbouring face met by an edge of a face. */
|
|
105
|
+
interface ICubeEdgeJunction {
|
|
106
|
+
/** Neighbouring face. */
|
|
107
|
+
readonly face: CubeFace;
|
|
108
|
+
/** Edge of the neighbouring face. */
|
|
109
|
+
readonly edge: TileEdgeNeighbor;
|
|
110
|
+
/** `true` when the coordinate along the edge runs the other way on the neighbouring face. */
|
|
111
|
+
readonly reversed: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Quarter turns from the frame of the face to the frame of its neighbour: a direction `d` of the face is
|
|
114
|
+
* `turnTileEdge(d, turns)` on the neighbour. Equatorial faces join with 0.
|
|
115
|
+
*/
|
|
116
|
+
readonly turns: number;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Junctions of the faces of the cube index, indexed by face then edge. The neighbour's edge is the opposite of the
|
|
120
|
+
* face's edge turned by `turns`.
|
|
121
|
+
*/
|
|
122
|
+
declare const CUBE_FACE_EDGES: ReadonlyArray<Readonly<Record<TileEdgeNeighbor, ICubeEdgeJunction>>>;
|
|
123
|
+
/** Neighbour of a tile of the cube index, with the turns from the frame of the tile to the frame of the neighbour. */
|
|
124
|
+
interface ICubeTileNeighbor {
|
|
125
|
+
readonly address: ITileAddress;
|
|
126
|
+
/** Quarter turns, as {@link ICubeEdgeJunction.turns}; 0 on the same face. */
|
|
127
|
+
readonly turns: number;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Neighbour of a tile of the cube index at the same level, across the faces when needed.
|
|
131
|
+
*
|
|
132
|
+
* A corner neighbour is reached by crossing one of its two edges. At the 8 vertices of the cube only 3 tiles meet:
|
|
133
|
+
* the corner neighbour there does not exist and the result is `undefined`.
|
|
134
|
+
*
|
|
135
|
+
* @param address - Tile of the cube index; a missing face means face 0.
|
|
136
|
+
* @param neighbor - Position around the tile; `C` returns the tile itself.
|
|
137
|
+
* @throws RangeError When the address is invalid.
|
|
138
|
+
*/
|
|
139
|
+
declare function cubeTileNeighbor(address: ITileAddress, neighbor: TileNeighbor): ICubeTileNeighbor | undefined;
|
|
140
|
+
/** Returns the nine neighbours in {@link TileNeighbor} order, the tile itself at `TileNeighbor.C`. */
|
|
141
|
+
declare function cubeTileNeighbors(address: ITileAddress): Array<ICubeTileNeighbor | undefined>;
|
|
142
|
+
/**
|
|
143
|
+
* Number of tiles meeting at a corner of a tile: 3 at the vertices of the cube, 4 elsewhere.
|
|
144
|
+
*
|
|
145
|
+
* @throws RangeError When the address is invalid.
|
|
146
|
+
*/
|
|
147
|
+
declare function cubeCornerTileCount(address: ITileAddress, corner: TileCornerNeighbor): 3 | 4;
|
|
148
|
+
/**
|
|
149
|
+
* Area of a tile of the cube index in another tile, across at most one face edge; see {@link ITileAreaAcross}.
|
|
150
|
+
*
|
|
151
|
+
* The neighbouring face is unfolded around the edge the two faces share, a rigid motion, so the points of that edge
|
|
152
|
+
* land exactly on the same directions.
|
|
153
|
+
*
|
|
154
|
+
* @throws RangeError When an address is invalid or the tiles lie on opposite faces.
|
|
155
|
+
*/
|
|
156
|
+
declare function cubeTileAreaIn(address: ITileAddress, other: ITileAddress): ITileAreaAcross;
|
|
157
|
+
/** Topology of the cube index: neighbours across faces, turned, and corners of 3 tiles. */
|
|
158
|
+
declare const CUBE_TILE_TOPOLOGY: ITileTopology;
|
|
159
|
+
|
|
160
|
+
export { CUBE_FACE_COUNT, CUBE_FACE_EDGES, CUBE_FACE_FRAMES, CUBE_TILE_TOPOLOGY, CubeFace, type ICubeEdgeJunction, type ICubeFaceCoordinates, type ICubeFaceFrame, type ICubeTileNeighbor, cubeCornerTileCount, cubeFaceCoordinates, cubeFaceDirection, cubeFaceOfDirection, cubeTileAreaIn, cubeTileDirection, cubeTileGeometricError, cubeTileNeighbor, cubeTileNeighbors, cubeTileOfDirection, isCubeFace };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { CUBE_FACE_EDGES, CUBE_TILE_TOPOLOGY, cubeCornerTileCount, cubeTileAreaIn, cubeTileGeometricError, cubeTileNeighbor, cubeTileNeighbors } from '../chunk-TGOB5HT5.js';
|
|
2
|
+
export { CELESTIAL_CUBE_SCHEME, CelestialTileSource, CubeTileSurface, parseCelestialDataset } from '../chunk-QGTREKHS.js';
|
|
3
|
+
export { CUBE_FACE_COUNT, CUBE_FACE_FRAMES, CubeFace, cubeFaceCoordinates, cubeFaceDirection, cubeFaceOfDirection, cubeTileDirection, cubeTileOfDirection, isCubeFace } from '../chunk-IGNRXAW3.js';
|
|
4
|
+
import '../chunk-6YNCRDEE.js';
|
|
5
|
+
import '../chunk-X6ZJ2PDY.js';
|
|
6
|
+
import '../chunk-7AWV2IEK.js';
|
|
7
|
+
import '../chunk-Y66PNDG2.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { I as ICelestialDataset, a as CelestialTileSource } from '../celestial-dataset-CUIsplKO.js';
|
|
2
|
+
import { b as IWebMercatorDatasetSourceOptions, a as IWebMercatorDataset, d as WebMercatorDatasetSource } from '../web-mercator-dataset-Dmou8byO.js';
|
|
3
|
+
import { F as FetchFunction } from '../tile-http-client-BHZOtGX7.js';
|
|
4
|
+
import '../tile-address-BkfSftp6.js';
|
|
5
|
+
import '@spacexr/geodesy';
|
|
6
|
+
import '../tile-surface-s9Zi6X9_.js';
|
|
7
|
+
import '../reference-surface-CsTtrNsc.js';
|
|
8
|
+
import '../raster-registration-CgBxrhDB.js';
|
|
9
|
+
import '../web-tile-source-DrZDBIm6.js';
|
|
10
|
+
import '../metrics-HGbzqj6L.js';
|
|
11
|
+
|
|
12
|
+
/** A dataset descriptor of a tile service, on any tiling scheme this package knows. */
|
|
13
|
+
type TileDataset = ICelestialDataset | IWebMercatorDataset;
|
|
14
|
+
/** The tile source of a dataset, on its own scheme. */
|
|
15
|
+
type TileDatasetSource = CelestialTileSource | WebMercatorDatasetSource;
|
|
16
|
+
/** Schemes {@link parseTileDataset} reads. */
|
|
17
|
+
declare const TILE_DATASET_SCHEMES: readonly string[];
|
|
18
|
+
/**
|
|
19
|
+
* Checks the JSON value of a dataset descriptor and reads it on its scheme.
|
|
20
|
+
*
|
|
21
|
+
* @throws RangeError When the scheme is unknown, or a member is missing or invalid.
|
|
22
|
+
*/
|
|
23
|
+
declare function parseTileDataset(value: unknown): TileDataset;
|
|
24
|
+
/** Whether a descriptor is on the Web Mercator scheme. */
|
|
25
|
+
declare function isWebMercatorDataset(dataset: TileDataset): dataset is IWebMercatorDataset;
|
|
26
|
+
/** Options of {@link createTileDatasetSource}. */
|
|
27
|
+
type ITileDatasetSourceOptions = IWebMercatorDatasetSourceOptions;
|
|
28
|
+
/** The tile source of a dataset: a cube source or a Web Mercator one, as its scheme says. */
|
|
29
|
+
declare function createTileDatasetSource(dataset: TileDataset | unknown, options?: ITileDatasetSourceOptions): TileDatasetSource;
|
|
30
|
+
/**
|
|
31
|
+
* What a descriptor may be used for, as its optional `usage` member says. `"development"` marks a source whose terms
|
|
32
|
+
* cover development only, such as tiles read straight from a commercial map service: an application must never ship it.
|
|
33
|
+
* Without the member, the descriptor is `"public"`.
|
|
34
|
+
*/
|
|
35
|
+
type TileDatasetUsage = "public" | "development";
|
|
36
|
+
/**
|
|
37
|
+
* The usage a descriptor declares.
|
|
38
|
+
*
|
|
39
|
+
* @throws RangeError When `usage` is neither `"public"` nor `"development"`.
|
|
40
|
+
*/
|
|
41
|
+
declare function tileDatasetUsage(value: unknown): TileDatasetUsage;
|
|
42
|
+
/** The error of a descriptor refused because it is for development only and the application runs in production. */
|
|
43
|
+
declare class DevelopmentDatasetError extends Error {
|
|
44
|
+
readonly url: string;
|
|
45
|
+
constructor(url: string);
|
|
46
|
+
}
|
|
47
|
+
/** Options of {@link loadTileDataset}. */
|
|
48
|
+
interface ILoadTileDatasetOptions {
|
|
49
|
+
/** Whether the application runs in production: a descriptor for development only is then refused. */
|
|
50
|
+
production?: boolean;
|
|
51
|
+
/** The fetch of the host; the global one by default. */
|
|
52
|
+
fetch?: FetchFunction;
|
|
53
|
+
/** Whether a descriptor answered 404 reads as absent instead of failing. */
|
|
54
|
+
optional?: boolean;
|
|
55
|
+
signal?: AbortSignal;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Resolves a relative template against the URL of its descriptor, as a relative URI of 3D Tiles resolves against its
|
|
59
|
+
* tileset: a static bucket can serve `./{z}/{x}/{y}.png` next to its `imagery.json`. Braces stay unescaped.
|
|
60
|
+
*/
|
|
61
|
+
declare function resolveTileTemplate(template: string, descriptorUrl: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Reads a dataset descriptor from a URL: either the descriptor itself (`.../imagery.json`), or a service and the name
|
|
64
|
+
* of its descriptor through {@link tileDatasetUrl}. The tiles template is resolved against the descriptor URL, then
|
|
65
|
+
* the descriptor is checked on its scheme. This is the one loader the applications of SpaceXR share.
|
|
66
|
+
*
|
|
67
|
+
* @returns The descriptor, or `undefined` for a missing optional one.
|
|
68
|
+
* @throws Error When the request fails, RangeError when the descriptor is invalid, {@link DevelopmentDatasetError}
|
|
69
|
+
* when it is for development only and `production` is set.
|
|
70
|
+
*/
|
|
71
|
+
declare function loadTileDataset(url: string, options?: ILoadTileDatasetOptions): Promise<TileDataset | undefined>;
|
|
72
|
+
/** The URL of the descriptor `name.json` of a tile service, such as `elevation` or `imagery`. */
|
|
73
|
+
declare function tileDatasetUrl(service: string, name: string): string;
|
|
74
|
+
|
|
75
|
+
export { DevelopmentDatasetError, type ILoadTileDatasetOptions, type ITileDatasetSourceOptions, TILE_DATASET_SCHEMES, type TileDataset, type TileDatasetSource, type TileDatasetUsage, createTileDatasetSource, isWebMercatorDataset, loadTileDataset, parseTileDataset, resolveTileTemplate, tileDatasetUrl, tileDatasetUsage };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { DevelopmentDatasetError, TILE_DATASET_SCHEMES, createTileDatasetSource, isWebMercatorDataset, loadTileDataset, parseTileDataset, resolveTileTemplate, tileDatasetUrl, tileDatasetUsage } from '../chunk-SPDRAY37.js';
|
|
2
|
+
import '../chunk-QGTREKHS.js';
|
|
3
|
+
import '../chunk-IGNRXAW3.js';
|
|
4
|
+
import '../chunk-ESLGXWQR.js';
|
|
5
|
+
import '../chunk-YEACOJOC.js';
|
|
6
|
+
import '../chunk-6YNCRDEE.js';
|
|
7
|
+
import '../chunk-X6ZJ2PDY.js';
|
|
8
|
+
import '../chunk-7AWV2IEK.js';
|
|
9
|
+
import '../chunk-Y66PNDG2.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { C as CellCoordinateReference, I as ICartesian2, a as IGeographic2, b as ITileMetrics } from './metrics-HGbzqj6L.js';
|
|
2
|
+
export { R as RasterRegistration, a as assertRasterRegistration } from './raster-registration-CgBxrhDB.js';
|
|
3
|
+
export { I as IGeoBounds, a as IPixelBounds, b as ITile, T as Tile, t as tileGeoBounds, c as tilePixelBounds } from './tile-D-jjIRRA.js';
|
|
4
|
+
export { I as ITileAddress, M as MAX_TILE_FACE, a as ancestorTileAddress, b as assertValidTileAddress, c as childTileAddresses, f as formatTileAddress, i as isValidTileAddress, p as parentTileAddress, q as quadkeyToTileAddress, t as tileAddressKey, d as tileAddressToQuadkey, e as tileCount, g as toTmsY } from './tile-address-BkfSftp6.js';
|
|
5
|
+
export { I as ITileNeighborOptions, T as TILE_CORNER_EDGES, a as TILE_CORNER_NEIGHBORS, b as TILE_EDGE_NEIGHBORS, c as TileCornerNeighbor, d as TileEdgeNeighbor, e as TileNeighbor, t as tileNeighborAddress, f as tileNeighborAddresses, g as tileNeighborOffset } from './tile-neighbors-LfvV7oiX.js';
|
|
6
|
+
export { I as ITileShapeFrame, a as ITileSurface } from './tile-surface-s9Zi6X9_.js';
|
|
7
|
+
export { I as IFlatTileTopologyOptions, a as ITileAreaAcross, b as ITileTopology, c as ITileTopologyNeighbor, f as flatTileTopology, t as turnedTileCoordinates } from './tile-topology-B6xHYqPb.js';
|
|
8
|
+
export { oppositeTileEdge, turnTileEdge } from './addressing/index.js';
|
|
9
|
+
export { IBakePyramidOptions, IBakePyramidResult, IBakedRaster, IPyramidLevels, IPyramidLevelsOptions, bakePyramid, bakedTilePath, bakedTileTemplate, isTransparent, pyramidLevels, pyramidTileCount, tilesInBounds } from './bake/index.js';
|
|
10
|
+
export { C as CELESTIAL_CUBE_SCHEME, a as CelestialTileSource, b as CubeTileSurface, I as ICelestialDataset, c as ICelestialDatasetSubtree, d as ICelestialTileSourceOptions, p as parseCelestialDataset } from './celestial-dataset-CUIsplKO.js';
|
|
11
|
+
export { CUBE_FACE_COUNT, CUBE_FACE_EDGES, CUBE_FACE_FRAMES, CUBE_TILE_TOPOLOGY, CubeFace, ICubeEdgeJunction, ICubeFaceCoordinates, ICubeFaceFrame, ICubeTileNeighbor, cubeCornerTileCount, cubeFaceCoordinates, cubeFaceDirection, cubeFaceOfDirection, cubeTileAreaIn, cubeTileDirection, cubeTileGeometricError, cubeTileNeighbor, cubeTileNeighbors, cubeTileOfDirection, isCubeFace } from './cube/index.js';
|
|
12
|
+
export { DevelopmentDatasetError, ILoadTileDatasetOptions, ITileDatasetSourceOptions, TILE_DATASET_SCHEMES, TileDataset, TileDatasetSource, TileDatasetUsage, createTileDatasetSource, isWebMercatorDataset, loadTileDataset, parseTileDataset, resolveTileTemplate, tileDatasetUrl, tileDatasetUsage } from './datasets/index.js';
|
|
13
|
+
export { I as IDatasetBounds, a as IWebMercatorDataset, b as IWebMercatorDatasetSourceOptions, c as IWebMercatorTileMetricsOptions, T as TileDatasetContent, W as WEB_MERCATOR_SCHEME, d as WebMercatorDatasetSource, e as WebMercatorTileMetrics, p as parseWebMercatorDataset, w as webMercatorDatasetDescriptor } from './web-mercator-dataset-Dmou8byO.js';
|
|
14
|
+
export { WebMercatorTileSurface } from './mercator/index.js';
|
|
15
|
+
export { IResidentTileCover, ITileAreaInAncestor, ITilePyramidOptions, ITilePyramidRegion, ResidentTiles, TileContentLoader, TilePyramid, tileAreaInAncestor } from './pyramid/index.js';
|
|
16
|
+
export { GeographicProjection, ICubeSourceLevel, IGeographicProjectionOptions, IMapPosition, IPolarStereographicProjectionOptions, IResampleCubeTileOptions, ISourcePixel, ISourceProjection, ISourceTile, ISourceTileMatrix, IWebMercatorProjectionOptions, IWmtsLayer, PolarStereographicProjection, SourcePixelReader, WebMercatorProjection, capBlendWeight, cubeSourceMatrix, cubeTileSourceTiles, geodeticOfDirection, geographicTileMatrix, parseWmtsCapabilities, rebaseRadialHeight, resampleCubeTile, sourcePixelAt, sourcePixelCoordinates, webMercatorTileMatrix, wmtsTileUrl } from './reprojection/index.js';
|
|
17
|
+
export { F as FetchFunction, I as ITileHttpClientOptions, T as TileFetchResult, a as TileHttpClient, b as TileHttpError } from './tile-http-client-BHZOtGX7.js';
|
|
18
|
+
export { B as BUILT_IN_TILE_URL_VARIABLES, I as ITileUrlTemplateOptions, a as IWebTileSourceOptions, T as TileUrlTemplateError, W as WebTileSource, e as expandTileUrlTemplate, t as tileUrlTemplateVariables, v as validateTileUrlTemplate } from './web-tile-source-DrZDBIm6.js';
|
|
19
|
+
export { ITileLayer, TileInvalidator, TileLayerChange, applyTileLayers, planTileLayerUpdate, tileLayerChange, touchedTileLayers, unionGeoBounds } from './sources/index.js';
|
|
20
|
+
export { R as ReferenceSurface } from './reference-surface-CsTtrNsc.js';
|
|
21
|
+
export { directionToPlanetocentric, planetocentricDirection } from './surface/index.js';
|
|
22
|
+
export { ICartesian3 } from '@spacexr/geodesy';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { GeographicProjection, PolarStereographicProjection, WebMercatorProjection, capBlendWeight, cubeSourceMatrix, cubeTileSourceTiles, geodeticOfDirection, geographicTileMatrix, parseWmtsCapabilities, rebaseRadialHeight, resampleCubeTile, sourcePixelAt, sourcePixelCoordinates, webMercatorTileMatrix, wmtsTileUrl } from './chunk-FB57CZDK.js';
|
|
2
|
+
export { applyTileLayers, planTileLayerUpdate, tileLayerChange, touchedTileLayers, unionGeoBounds } from './chunk-HVYN4AIT.js';
|
|
3
|
+
export { bakePyramid, bakedTilePath, bakedTileTemplate, isTransparent, pyramidLevels, pyramidTileCount, tilesInBounds } from './chunk-TA4BEVHL.js';
|
|
4
|
+
export { CUBE_FACE_EDGES, CUBE_TILE_TOPOLOGY, cubeCornerTileCount, cubeTileAreaIn, cubeTileGeometricError, cubeTileNeighbor, cubeTileNeighbors } from './chunk-TGOB5HT5.js';
|
|
5
|
+
export { DevelopmentDatasetError, TILE_DATASET_SCHEMES, createTileDatasetSource, isWebMercatorDataset, loadTileDataset, parseTileDataset, resolveTileTemplate, tileDatasetUrl, tileDatasetUsage } from './chunk-SPDRAY37.js';
|
|
6
|
+
export { CELESTIAL_CUBE_SCHEME, CelestialTileSource, CubeTileSurface, parseCelestialDataset } from './chunk-QGTREKHS.js';
|
|
7
|
+
export { CUBE_FACE_COUNT, CUBE_FACE_FRAMES, CubeFace, cubeFaceCoordinates, cubeFaceDirection, cubeFaceOfDirection, cubeTileDirection, cubeTileOfDirection, isCubeFace } from './chunk-IGNRXAW3.js';
|
|
8
|
+
export { WebMercatorTileSurface } from './chunk-GRTG4WNA.js';
|
|
9
|
+
export { WEB_MERCATOR_SCHEME, WebMercatorDatasetSource, WebMercatorTileMetrics, parseWebMercatorDataset, webMercatorDatasetDescriptor } from './chunk-ESLGXWQR.js';
|
|
10
|
+
export { WebTileSource } from './chunk-YEACOJOC.js';
|
|
11
|
+
export { BUILT_IN_TILE_URL_VARIABLES, TileHttpClient, TileHttpError, TileUrlTemplateError, expandTileUrlTemplate, tileUrlTemplateVariables, validateTileUrlTemplate } from './chunk-6YNCRDEE.js';
|
|
12
|
+
export { CellCoordinateReference, Tile, assertRasterRegistration, flatTileTopology, oppositeTileEdge, tileGeoBounds, tilePixelBounds, turnTileEdge, turnedTileCoordinates } from './chunk-X6ZJ2PDY.js';
|
|
13
|
+
export { directionToPlanetocentric, planetocentricDirection } from './chunk-XTY4HCPY.js';
|
|
14
|
+
export { ReferenceSurface } from './chunk-7AWV2IEK.js';
|
|
15
|
+
export { ResidentTiles, TilePyramid, tileAreaInAncestor } from './chunk-2HLQXRDD.js';
|
|
16
|
+
export { MAX_TILE_FACE, TILE_CORNER_EDGES, TILE_CORNER_NEIGHBORS, TILE_EDGE_NEIGHBORS, TileNeighbor, ancestorTileAddress, assertValidTileAddress, childTileAddresses, formatTileAddress, isValidTileAddress, parentTileAddress, quadkeyToTileAddress, tileAddressKey, tileAddressToQuadkey, tileCount, tileNeighborAddress, tileNeighborAddresses, tileNeighborOffset, toTmsY } from './chunk-Y66PNDG2.js';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { I as IDatasetBounds, a as IWebMercatorDataset, b as IWebMercatorDatasetSourceOptions, c as IWebMercatorTileMetricsOptions, T as TileDatasetContent, W as WEB_MERCATOR_SCHEME, d as WebMercatorDatasetSource, e as WebMercatorTileMetrics, p as parseWebMercatorDataset, w as webMercatorDatasetDescriptor } from '../web-mercator-dataset-Dmou8byO.js';
|
|
2
|
+
import { GeodeticSystem, ICartesian3 } from '@spacexr/geodesy';
|
|
3
|
+
import { I as ITileAddress } from '../tile-address-BkfSftp6.js';
|
|
4
|
+
import { a as ITileSurface, I as ITileShapeFrame } from '../tile-surface-s9Zi6X9_.js';
|
|
5
|
+
import '../raster-registration-CgBxrhDB.js';
|
|
6
|
+
import '../tile-http-client-BHZOtGX7.js';
|
|
7
|
+
import '../web-tile-source-DrZDBIm6.js';
|
|
8
|
+
import '../metrics-HGbzqj6L.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Tiles of a Web Mercator pyramid on an ellipsoid. Heights are geodetic, along the normal of the ellipsoid. Tiles of
|
|
12
|
+
* one level and row are the same shape turned about the polar axis.
|
|
13
|
+
*/
|
|
14
|
+
declare class WebMercatorTileSurface implements ITileSurface {
|
|
15
|
+
private readonly system;
|
|
16
|
+
/** @param system - Geodetic system of the ellipsoid. Supplied explicitly by the caller. */
|
|
17
|
+
constructor(system: GeodeticSystem);
|
|
18
|
+
point(address: ITileAddress, s: number, t: number, height?: number, target?: ICartesian3): ICartesian3;
|
|
19
|
+
up(address: ITileAddress, s: number, t: number, target?: ICartesian3): ICartesian3;
|
|
20
|
+
shape(address: ITileAddress): ITileShapeFrame;
|
|
21
|
+
private assertAddress;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { WebMercatorTileSurface };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { WebMercatorTileSurface } from '../chunk-GRTG4WNA.js';
|
|
2
|
+
export { WEB_MERCATOR_SCHEME, WebMercatorDatasetSource, WebMercatorTileMetrics, parseWebMercatorDataset, webMercatorDatasetDescriptor } from '../chunk-ESLGXWQR.js';
|
|
3
|
+
import '../chunk-YEACOJOC.js';
|
|
4
|
+
import '../chunk-6YNCRDEE.js';
|
|
5
|
+
import '../chunk-X6ZJ2PDY.js';
|
|
6
|
+
import '../chunk-Y66PNDG2.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
declare enum CellCoordinateReference {
|
|
2
|
+
Center = 0,
|
|
3
|
+
NorthWest = 1,
|
|
4
|
+
NorthEast = 2,
|
|
5
|
+
SouthWest = 3,
|
|
6
|
+
SouthEast = 4
|
|
7
|
+
}
|
|
8
|
+
interface ICartesian2 {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}
|
|
12
|
+
interface IGeographic2 {
|
|
13
|
+
latitude: number;
|
|
14
|
+
longitude: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Describes the addressing, resolution and valid LOD range of a tile source.
|
|
18
|
+
*
|
|
19
|
+
* This is the renderer-neutral counterpart of SpaceXR `ITileMetrics`. Angles
|
|
20
|
+
* are expressed in degrees and sizes in pixels or metres as documented by
|
|
21
|
+
* each method.
|
|
22
|
+
*/
|
|
23
|
+
interface ITileMetrics {
|
|
24
|
+
readonly minLOD: number;
|
|
25
|
+
readonly maxLOD: number;
|
|
26
|
+
readonly minLatitude: number;
|
|
27
|
+
readonly maxLatitude: number;
|
|
28
|
+
readonly minLongitude: number;
|
|
29
|
+
readonly maxLongitude: number;
|
|
30
|
+
readonly tileSize: number;
|
|
31
|
+
readonly cellSize: number;
|
|
32
|
+
readonly cellCoordinateReference: CellCoordinateReference;
|
|
33
|
+
readonly overlap: number;
|
|
34
|
+
mapSize(levelOfDetail: number): number;
|
|
35
|
+
mapScale(latitudeDegrees: number, levelOfDetail: number, pixelsPerUnit: number): number;
|
|
36
|
+
groundResolution(latitudeDegrees: number, levelOfDetail: number): number;
|
|
37
|
+
getLatLonToTileXY(latitudeDegrees: number, longitudeDegrees: number, levelOfDetail: number): ICartesian2;
|
|
38
|
+
getTileXYToLatLon(x: number, y: number, levelOfDetail: number): IGeographic2;
|
|
39
|
+
getLatLonToPointXY(latitudeDegrees: number, longitudeDegrees: number, levelOfDetail: number): ICartesian2;
|
|
40
|
+
getPointXYToLatLon(x: number, y: number, levelOfDetail: number): IGeographic2;
|
|
41
|
+
getTileXYToPointXY(x: number, y: number): ICartesian2;
|
|
42
|
+
getPointXYToTileXY(x: number, y: number): ICartesian2;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { CellCoordinateReference as C, type ICartesian2 as I, type IGeographic2 as a, type ITileMetrics as b };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { I as ITileAddress } from '../tile-address-BkfSftp6.js';
|
|
2
|
+
import { e as TileNeighbor } from '../tile-neighbors-LfvV7oiX.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Loads the content of one tile, or `undefined` when the pyramid has no such tile.
|
|
6
|
+
*
|
|
7
|
+
* @param signal - Aborts when nobody waits for the tile any more. A loader may ignore it.
|
|
8
|
+
*/
|
|
9
|
+
type TileContentLoader<T> = (address: ITileAddress, signal?: AbortSignal) => Promise<T | undefined>;
|
|
10
|
+
/** Part of an ancestor tile covered by a tile, in normalized ancestor coordinates, `west` and `north` from 0. */
|
|
11
|
+
interface ITileAreaInAncestor {
|
|
12
|
+
ancestor: ITileAddress;
|
|
13
|
+
west: number;
|
|
14
|
+
north: number;
|
|
15
|
+
/** Width and height of the area, `1 / 2^levels`. */
|
|
16
|
+
size: number;
|
|
17
|
+
}
|
|
18
|
+
/** The ancestor `levels` levels above a tile and the part of it the tile covers. */
|
|
19
|
+
declare function tileAreaInAncestor(address: ITileAddress, levels: number): ITileAreaInAncestor;
|
|
20
|
+
interface ITilePyramidOptions<T> {
|
|
21
|
+
load: TileContentLoader<T>;
|
|
22
|
+
/** Deepest level of the pyramid; deeper tiles use the sub-area of their ancestor at this level (overzoom). */
|
|
23
|
+
maxLOD: number;
|
|
24
|
+
/**
|
|
25
|
+
* Level of the pyramid tile serving a tile, for a sparse pyramid whose depth varies from place to place. A tile deeper
|
|
26
|
+
* than the data at its place then uses the sub-area of its ancestor there. Defaults to the same level everywhere.
|
|
27
|
+
*/
|
|
28
|
+
servingLevel?: (address: ITileAddress) => number;
|
|
29
|
+
/** Tiles kept in memory. Defaults to 256. */
|
|
30
|
+
cacheEntries?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Time a load nobody waits for any more goes on before it is aborted, so that a tile coming back right away, as when
|
|
33
|
+
* a zoom turns around, does not load twice. Defaults to 0: at once.
|
|
34
|
+
*/
|
|
35
|
+
abortDelayMilliseconds?: number;
|
|
36
|
+
/** Wraps columns around the antimeridian, for pyramids covering every longitude. Defaults to false. */
|
|
37
|
+
wrapX?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Neighbours loaded with every tile, or with a given tile, for contents that need them: `[E, S, SE]` to stitch the
|
|
40
|
+
* extra column and row of a raster, or every position to prepare a move. A missing or failing neighbour is ignored.
|
|
41
|
+
* Defaults to none.
|
|
42
|
+
*/
|
|
43
|
+
prefetch?: readonly TileNeighbor[] | ((address: ITileAddress) => readonly TileNeighbor[]);
|
|
44
|
+
/** Called when the content of a tile is loaded and still cached. */
|
|
45
|
+
onLoad?: (address: ITileAddress, content: T) => void;
|
|
46
|
+
/** Called when a tile leaves the cache. */
|
|
47
|
+
onEvict?: (address: ITileAddress) => void;
|
|
48
|
+
}
|
|
49
|
+
/** Content of the pyramid tile serving a tile, with the part of it the tile covers. */
|
|
50
|
+
interface ITilePyramidRegion<T> extends ITileAreaInAncestor {
|
|
51
|
+
/** Tile requested. */
|
|
52
|
+
address: ITileAddress;
|
|
53
|
+
/** Content of `ancestor`, the tile itself up to `maxLOD`. */
|
|
54
|
+
content: T;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Tiles of a pyramid loaded on demand, whatever their content: rasters, meshes, vector data.
|
|
58
|
+
*
|
|
59
|
+
* Each tile loads once and is shared by every request, including the requests of deeper tiles beyond `maxLOD`, which
|
|
60
|
+
* use a sub-area of their ancestor. The least recently used tiles leave the cache, except the tiles retained by their
|
|
61
|
+
* users, which may exceed its capacity. Neighbours listed in `prefetch` load with every tile.
|
|
62
|
+
*/
|
|
63
|
+
declare class TilePyramid<T> {
|
|
64
|
+
readonly maxLOD: number;
|
|
65
|
+
private readonly options;
|
|
66
|
+
private readonly cacheEntries;
|
|
67
|
+
private readonly entries;
|
|
68
|
+
/** Retain counts of the pyramid tiles that must stay in the cache. */
|
|
69
|
+
private readonly retained;
|
|
70
|
+
constructor(options: ITilePyramidOptions<T>);
|
|
71
|
+
/** Number of tiles in memory, loaded or loading. */
|
|
72
|
+
get size(): number;
|
|
73
|
+
/** Level of the pyramid tile serving a tile level. */
|
|
74
|
+
sourceLevel(lod: number): number;
|
|
75
|
+
/** The pyramid tile serving a tile and the part of it the tile covers. */
|
|
76
|
+
areaOf(address: ITileAddress): ITileAreaInAncestor;
|
|
77
|
+
/** Loaded content of a pyramid tile, without loading it. */
|
|
78
|
+
get(address: ITileAddress): T | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Loads the pyramid tile serving a tile, with its prefetched neighbours.
|
|
81
|
+
*
|
|
82
|
+
* @param signal - Withdraws this request, which then rejects with its reason. A load every request has withdrawn from
|
|
83
|
+
* is aborted and leaves the cache; a load another request still waits for goes on.
|
|
84
|
+
* @returns The content and the part of it the tile covers, or `undefined` when the pyramid has no tile there.
|
|
85
|
+
*/
|
|
86
|
+
load(address: ITileAddress, signal?: AbortSignal): Promise<ITilePyramidRegion<T> | undefined>;
|
|
87
|
+
/**
|
|
88
|
+
* Loads one tile of the pyramid itself, with its prefetched neighbours, whatever tile `servingLevel` would serve at
|
|
89
|
+
* its address: for contents made from other tiles of the pyramid, such as a tile generated from its parent.
|
|
90
|
+
*
|
|
91
|
+
* @param signal - Withdraws this request; see {@link load}.
|
|
92
|
+
* @returns Its content, or `undefined` when the pyramid has no tile there.
|
|
93
|
+
*/
|
|
94
|
+
loadTile(address: ITileAddress, signal?: AbortSignal): Promise<T | undefined>;
|
|
95
|
+
/**
|
|
96
|
+
* Keeps the pyramid tile serving a tile in the cache until it is released as many times, for example while a
|
|
97
|
+
* renderer displays data sampled from it. A retained tile still has to be loaded.
|
|
98
|
+
*/
|
|
99
|
+
retain(address: ITileAddress): void;
|
|
100
|
+
/** Releases a tile retained with {@link retain}; the cache then evicts it like any other once it is full. */
|
|
101
|
+
release(address: ITileAddress): void;
|
|
102
|
+
/** Removes a tile from the cache. */
|
|
103
|
+
delete(address: ITileAddress): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Forgets the tiles whose data changed, such as those meeting an edited area: the next request of each loads it
|
|
106
|
+
* again, the other tiles stay cached. A load under way for one of them still answers its requests, but its content
|
|
107
|
+
* is not kept: it may predate the change.
|
|
108
|
+
*
|
|
109
|
+
* @returns The tiles forgotten.
|
|
110
|
+
*/
|
|
111
|
+
invalidate(affects: (address: ITileAddress) => boolean): ITileAddress[];
|
|
112
|
+
private tile;
|
|
113
|
+
/** Aborts a load and forgets it, unless a request came back or it ended in the meantime. */
|
|
114
|
+
private abortUnwanted;
|
|
115
|
+
/** Waits for a load until the signal withdraws this request: the last one to leave aborts the load. */
|
|
116
|
+
private wait;
|
|
117
|
+
/** Evicts the least recently used tiles that are not retained while the cache exceeds its capacity. */
|
|
118
|
+
private evictOverflow;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Resident tile covering a requested tile, with the part of it the requested tile covers. */
|
|
122
|
+
interface IResidentTileCover<T> extends ITileAreaInAncestor {
|
|
123
|
+
/** Value stored for `ancestor`, the resident tile. */
|
|
124
|
+
value: T;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Tiles currently available to a renderer, such as texture pages or elevation pages, indexed for coverage lookups.
|
|
128
|
+
*
|
|
129
|
+
* A renderer binds the data of one pyramid to the tiles of another: imagery pages to terrain tiles, or elevation
|
|
130
|
+
* pages to imagery tiles. `cover` returns the deepest resident tile containing a requested tile, so that a binding
|
|
131
|
+
* always falls back to coarser data while finer data loads.
|
|
132
|
+
*/
|
|
133
|
+
declare class ResidentTiles<T> {
|
|
134
|
+
private readonly entries;
|
|
135
|
+
get size(): number;
|
|
136
|
+
get(address: ITileAddress): T | undefined;
|
|
137
|
+
has(address: ITileAddress): boolean;
|
|
138
|
+
set(address: ITileAddress, value: T): void;
|
|
139
|
+
delete(address: ITileAddress): boolean;
|
|
140
|
+
/** Addresses of the resident tiles. */
|
|
141
|
+
addresses(): IterableIterator<ITileAddress>;
|
|
142
|
+
/**
|
|
143
|
+
* Deepest resident tile containing a tile, the tile itself included, and the part of it the tile covers.
|
|
144
|
+
*
|
|
145
|
+
* @param minLOD - Coarsest level searched. Defaults to 0.
|
|
146
|
+
* @returns `undefined` when no resident tile contains the tile.
|
|
147
|
+
*/
|
|
148
|
+
cover(address: ITileAddress, minLOD?: number): IResidentTileCover<T> | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* Levels between a tile and the deepest resident tile inside it, at most `maxLevels` below: `0` when only the
|
|
151
|
+
* tile itself is resident, `undefined` when no resident tile lies inside it.
|
|
152
|
+
*/
|
|
153
|
+
depthWithin(address: ITileAddress, maxLevels?: number): number | undefined;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export { type IResidentTileCover, type ITileAreaInAncestor, type ITilePyramidOptions, type ITilePyramidRegion, ResidentTiles, type TileContentLoader, TilePyramid, tileAreaInAncestor };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|