@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
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,58 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @spacexr/tiles
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Renderer-neutral tiling schemes of a body: tile addressing and topology, the Web Mercator and equi-angular cube schemes, reference surfaces, on-demand pyramids, URL templates, HTTP sources and the reprojection of sources toward a scheme. The package has no renderer, no body catalogue and no provider preset.
|
|
4
|
+
|
|
5
|
+
## Configure a source
|
|
6
|
+
|
|
7
|
+
The application supplies its `GeodeticSystem`, normally constructed from the ellipsoid selected in `spacexr-celestial`. No reference body is selected implicitly.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import type { GeodeticSystem } from "@spacexr/geodesy";
|
|
11
|
+
import { WebMercatorTileMetrics, WebTileSource } from "@spacexr/tiles";
|
|
12
|
+
|
|
13
|
+
export function createSource(system: GeodeticSystem, urlTemplate: string) {
|
|
14
|
+
return new WebTileSource({
|
|
15
|
+
id: "application-source",
|
|
16
|
+
urlTemplate,
|
|
17
|
+
metrics: new WebMercatorTileMetrics({ minLOD: 0, maxLOD: 18 }, system),
|
|
18
|
+
registration: "area",
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Describe a dataset
|
|
24
|
+
|
|
25
|
+
A provider is data, never code. A tile service publishes one descriptor per dataset, `elevation.json`, `imagery.json` or `normals.json`, on its tiling scheme: `spacexr-cube-equiangular/1` or `spacexr-web-mercator/1`. `loadTileDataset` reads any of them, resolves a relative `tiles` template against the descriptor URL, and checks it on its scheme; `createTileDatasetSource` gives its tile source. A source never requests a tile its descriptor does not declare.
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"scheme": "spacexr-web-mercator/1",
|
|
30
|
+
"body": "Earth",
|
|
31
|
+
"referenceRadii": [6378137, 6378137, 6356752.314245],
|
|
32
|
+
"content": "imagery",
|
|
33
|
+
"encoding": "png",
|
|
34
|
+
"tileSize": 256,
|
|
35
|
+
"minLOD": 0,
|
|
36
|
+
"maxLOD": 7,
|
|
37
|
+
"bounds": { "west": -180, "south": -85.0511, "east": 180, "north": 85.0511 },
|
|
38
|
+
"tiles": "./{z}/{x}/{y}.png",
|
|
39
|
+
"attribution": "Natural Earth"
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Entry points
|
|
44
|
+
|
|
45
|
+
| Entry point | Contents |
|
|
46
|
+
| -------------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
47
|
+
| `addressing` | Addresses with an optional root `face`, neighbours, edge rotations, `ITileTopology`, `ITileSurface`, `ITileMetrics`, `Tile`. |
|
|
48
|
+
| `surface` | `ReferenceSurface` with triaxial radii and radial heights, planetocentric directions. |
|
|
49
|
+
| `mercator` | `WebMercatorTileMetrics` and `WebMercatorTileSurface`: one root, geodetic heights; the Web Mercator dataset descriptor. |
|
|
50
|
+
| `cube` | The equi-angular cube: faces, mapping, neighbours across faces, `CUBE_TILE_TOPOLOGY`, `CubeTileSurface`, dataset descriptor. |
|
|
51
|
+
| `datasets` | `parseTileDataset`, `loadTileDataset` and `createTileDatasetSource`: the one loader of dataset descriptors, any scheme. |
|
|
52
|
+
| `pyramid` | `TilePyramid`, `ResidentTiles` and ancestor areas. |
|
|
53
|
+
| `sources` | URL templates, `TileHttpClient`, `WebTileSource`. |
|
|
54
|
+
| `reprojection` | Source projections, source tile matrices, WMTS capabilities and the resampling of sources toward the cube. |
|
|
55
|
+
|
|
56
|
+
The root entry point exports all of them. Physical radii and geodetic systems are explicit inputs. Raster registration is always declared: `area` describes pixel areas, `point` describes shared-edge samples. The 3D Tiles runtime composes these primitives with its own wire model; this package never imports it.
|
|
57
|
+
|
|
58
|
+
See [the architecture decision](../../docs/architecture.md).
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
import { d as TileEdgeNeighbor } from '../tile-neighbors-LfvV7oiX.js';
|
|
6
|
+
export { I as ITileNeighborOptions, T as TILE_CORNER_EDGES, a as TILE_CORNER_NEIGHBORS, b as TILE_EDGE_NEIGHBORS, c as TileCornerNeighbor, e as TileNeighbor, t as tileNeighborAddress, f as tileNeighborAddresses, g as tileNeighborOffset } from '../tile-neighbors-LfvV7oiX.js';
|
|
7
|
+
export { I as ITileShapeFrame, a as ITileSurface } from '../tile-surface-s9Zi6X9_.js';
|
|
8
|
+
export { I as IFlatTileTopologyOptions, a as ITileAreaAcross, b as ITileTopology, c as ITileTopologyNeighbor, f as flatTileTopology, t as turnedTileCoordinates } from '../tile-topology-B6xHYqPb.js';
|
|
9
|
+
export { ICartesian3 } from '@spacexr/geodesy';
|
|
10
|
+
|
|
11
|
+
/** Rotate a tile edge in quarter turns within its local frame. */
|
|
12
|
+
declare function turnTileEdge(edge: TileEdgeNeighbor, turns: number): TileEdgeNeighbor;
|
|
13
|
+
/** Edge on the other side of a tile. */
|
|
14
|
+
declare function oppositeTileEdge(edge: TileEdgeNeighbor): TileEdgeNeighbor;
|
|
15
|
+
|
|
16
|
+
export { TileEdgeNeighbor, oppositeTileEdge, turnTileEdge };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { CellCoordinateReference, Tile, assertRasterRegistration, flatTileTopology, oppositeTileEdge, tileGeoBounds, tilePixelBounds, turnTileEdge, turnedTileCoordinates } from '../chunk-X6ZJ2PDY.js';
|
|
2
|
+
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';
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { I as ITileAddress } from '../tile-address-BkfSftp6.js';
|
|
2
|
+
import { e as WebMercatorTileMetrics, I as IDatasetBounds } from '../web-mercator-dataset-Dmou8byO.js';
|
|
3
|
+
import '@spacexr/geodesy';
|
|
4
|
+
import '../raster-registration-CgBxrhDB.js';
|
|
5
|
+
import '../tile-http-client-BHZOtGX7.js';
|
|
6
|
+
import '../web-tile-source-DrZDBIm6.js';
|
|
7
|
+
import '../metrics-HGbzqj6L.js';
|
|
8
|
+
|
|
9
|
+
/** Options of {@link pyramidLevels}. */
|
|
10
|
+
interface IPyramidLevelsOptions {
|
|
11
|
+
/** The deepest level wanted, such as the deepest level of the imagery the pyramid lies on. */
|
|
12
|
+
finest: number;
|
|
13
|
+
/**
|
|
14
|
+
* How many times wider than the bounds a tile may be and still hold the pyramid: from higher up, its content would
|
|
15
|
+
* be a patch of a few pixels. The coarsest level is the first whose tiles are no wider than that.
|
|
16
|
+
*/
|
|
17
|
+
coarsestTileRatio: number;
|
|
18
|
+
/**
|
|
19
|
+
* Ground size of a sample of the source, in metres, for a raster: the pyramid stops at the first level whose pixels
|
|
20
|
+
* are as fine as the source when that level is above `finest`. Absent for a source without a resolution of its own,
|
|
21
|
+
* such as vectors.
|
|
22
|
+
*/
|
|
23
|
+
pixelSize?: number;
|
|
24
|
+
}
|
|
25
|
+
/** The levels of a pyramid, from `minLOD` to `maxLOD`. */
|
|
26
|
+
interface IPyramidLevels {
|
|
27
|
+
readonly minLOD: number;
|
|
28
|
+
readonly maxLOD: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The levels a pyramid over `bounds` is built for: from the first level whose tiles are at most `coarsestTileRatio`
|
|
32
|
+
* times as wide as the bounds, down to `finest`, or to the level of the pixel size of a raster source when it is less
|
|
33
|
+
* deep. The level range of `metrics` bounds both.
|
|
34
|
+
*/
|
|
35
|
+
declare function pyramidLevels(metrics: WebMercatorTileMetrics, bounds: IDatasetBounds, options: IPyramidLevelsOptions): IPyramidLevels;
|
|
36
|
+
/** The tiles of a level that meet `bounds`, row by row from the north-west. */
|
|
37
|
+
declare function tilesInBounds(metrics: WebMercatorTileMetrics, bounds: IDatasetBounds, lod: number): Generator<ITileAddress>;
|
|
38
|
+
|
|
39
|
+
/** An image of a tile: rows from the north, columns from the west, 8 bits per channel. */
|
|
40
|
+
interface IBakedRaster {
|
|
41
|
+
readonly width: number;
|
|
42
|
+
readonly height: number;
|
|
43
|
+
/** 3 for RGB, 4 for RGBA. */
|
|
44
|
+
readonly channels: number;
|
|
45
|
+
readonly data: Uint8Array | Uint8ClampedArray;
|
|
46
|
+
}
|
|
47
|
+
/** Options of {@link bakePyramid}. */
|
|
48
|
+
interface IBakePyramidOptions {
|
|
49
|
+
metrics: WebMercatorTileMetrics;
|
|
50
|
+
bounds: IDatasetBounds;
|
|
51
|
+
levels: IPyramidLevels;
|
|
52
|
+
/** The image of a tile, or nothing where the source has none. */
|
|
53
|
+
source(address: ITileAddress, signal?: AbortSignal): Promise<IBakedRaster | undefined>;
|
|
54
|
+
/** The bytes of an image in the format of the pyramid, such as PNG. */
|
|
55
|
+
encode(raster: IBakedRaster): Promise<Uint8Array>;
|
|
56
|
+
/** Writes the file of a tile, at a path relative to the folder of the pyramid ({@link bakedTilePath}). */
|
|
57
|
+
write(path: string, bytes: Uint8Array): Promise<void>;
|
|
58
|
+
/** Extension of the files of the tiles, such as `png`. */
|
|
59
|
+
extension: string;
|
|
60
|
+
/** Tiles baked at once; one at a time by default. */
|
|
61
|
+
concurrency?: number;
|
|
62
|
+
signal?: AbortSignal;
|
|
63
|
+
/** Called after each tile, baked or skipped. */
|
|
64
|
+
onProgress?(done: number, total: number): void;
|
|
65
|
+
}
|
|
66
|
+
/** What a bake did. */
|
|
67
|
+
interface IBakePyramidResult {
|
|
68
|
+
/** Tiles written. */
|
|
69
|
+
written: number;
|
|
70
|
+
/** Tiles the source had nothing for, or only transparent texels: no file is written for them. */
|
|
71
|
+
empty: number;
|
|
72
|
+
total: number;
|
|
73
|
+
}
|
|
74
|
+
/** The URL template of the tiles of a baked pyramid, relative to its descriptor: `./{z}/{x}/{y}.<extension>`. */
|
|
75
|
+
declare function bakedTileTemplate(extension: string): string;
|
|
76
|
+
/** The path of the file of a tile of a baked pyramid, relative to its folder: `<lod>/<x>/<y>.<extension>`. */
|
|
77
|
+
declare function bakedTilePath(address: ITileAddress, extension: string): string;
|
|
78
|
+
/** Whether every texel of an image is transparent: an image without alpha never is. */
|
|
79
|
+
declare function isTransparent(raster: IBakedRaster): boolean;
|
|
80
|
+
/** The number of tiles of a pyramid over `bounds`, all its levels. */
|
|
81
|
+
declare function pyramidTileCount(metrics: WebMercatorTileMetrics, bounds: IDatasetBounds, levels: IPyramidLevels): number;
|
|
82
|
+
/**
|
|
83
|
+
* Bakes a tile pyramid: asks the source for each tile of `bounds` at each level, encodes it and writes it. A tile the
|
|
84
|
+
* source has nothing for, or only transparent texels, is not written: a reader takes an absent tile as empty. The bake
|
|
85
|
+
* knows no canvas and no file system: the source, the encoder and the writer are given, so it runs in a browser as
|
|
86
|
+
* under Node. Writing the descriptor of the pyramid is left to the caller, after the tiles, so that a pyramid without
|
|
87
|
+
* its descriptor reads as unfinished.
|
|
88
|
+
*/
|
|
89
|
+
declare function bakePyramid(options: IBakePyramidOptions): Promise<IBakePyramidResult>;
|
|
90
|
+
|
|
91
|
+
export { type IBakePyramidOptions, type IBakePyramidResult, type IBakedRaster, type IPyramidLevels, type IPyramidLevelsOptions, bakePyramid, bakedTilePath, bakedTileTemplate, isTransparent, pyramidLevels, pyramidTileCount, tilesInBounds };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { I as ITileAddress } from './tile-address-BkfSftp6.js';
|
|
2
|
+
import { a as TileHttpClient, I as ITileHttpClientOptions, T as TileFetchResult } from './tile-http-client-BHZOtGX7.js';
|
|
3
|
+
import { ICartesian3 } from '@spacexr/geodesy';
|
|
4
|
+
import { a as ITileSurface, I as ITileShapeFrame } from './tile-surface-s9Zi6X9_.js';
|
|
5
|
+
import { R as ReferenceSurface } from './reference-surface-CsTtrNsc.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Tiles of the cube index on a reference surface. Heights are radial: every point lies on the ray of its direction.
|
|
9
|
+
*
|
|
10
|
+
* Each tile has its own shape. The same address on another face is the same shape on a sphere only, and is never in
|
|
11
|
+
* view together with the tile, so sharing would save nothing.
|
|
12
|
+
*/
|
|
13
|
+
declare class CubeTileSurface implements ITileSurface {
|
|
14
|
+
readonly reference: ReferenceSurface;
|
|
15
|
+
/** @param reference - Reference surface of the heights. */
|
|
16
|
+
constructor(reference: ReferenceSurface);
|
|
17
|
+
point(address: ITileAddress, s: number, t: number, height?: number, target?: ICartesian3): ICartesian3;
|
|
18
|
+
up(address: ITileAddress, s: number, t: number, target?: ICartesian3): ICartesian3;
|
|
19
|
+
shape(address: ITileAddress): ITileShapeFrame;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Scheme of the datasets of this version of the specification. */
|
|
23
|
+
declare const CELESTIAL_CUBE_SCHEME = "spacexr-cube-equiangular/1";
|
|
24
|
+
/** A tile below which levels down to its own `maxLOD` are available, such as the polar caps of the Moon. */
|
|
25
|
+
interface ICelestialDatasetSubtree {
|
|
26
|
+
readonly face: number;
|
|
27
|
+
readonly lod: number;
|
|
28
|
+
readonly x: number;
|
|
29
|
+
readonly y: number;
|
|
30
|
+
readonly maxLOD: number;
|
|
31
|
+
}
|
|
32
|
+
/** Descriptor of a dataset of a tile service; see `docs/celestial-tiling.md`. */
|
|
33
|
+
interface ICelestialDataset {
|
|
34
|
+
/** This specification and its version: {@link CELESTIAL_CUBE_SCHEME}. */
|
|
35
|
+
readonly scheme: string;
|
|
36
|
+
/** Catalogue name of the body. */
|
|
37
|
+
readonly body: string;
|
|
38
|
+
/** Body-fixed frame and its version. */
|
|
39
|
+
readonly frame: string;
|
|
40
|
+
/** Radii `a`, `b`, `c` of the reference surface, in metres. */
|
|
41
|
+
readonly referenceRadii: readonly [number, number, number];
|
|
42
|
+
readonly content: "elevation" | "imagery";
|
|
43
|
+
/** Tile format, such as `terrarium` for radial heights or `png`, `jpeg`, `webp` for imagery. */
|
|
44
|
+
readonly encoding: string;
|
|
45
|
+
/** Cells per tile side: tiles hold `tileSize + 1` samples per side. */
|
|
46
|
+
readonly tileSize: number;
|
|
47
|
+
/** Levels available everywhere, from `minLOD` to `maxLOD`. */
|
|
48
|
+
readonly minLOD: number;
|
|
49
|
+
readonly maxLOD: number;
|
|
50
|
+
readonly subtrees: readonly ICelestialDatasetSubtree[];
|
|
51
|
+
/** URL template. */
|
|
52
|
+
readonly tiles: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Checks the JSON value of a dataset descriptor.
|
|
56
|
+
*
|
|
57
|
+
* @returns The descriptor, with an empty `subtrees` when it has none.
|
|
58
|
+
* @throws RangeError When a member is missing or invalid, naming it. A scheme of another version is rejected.
|
|
59
|
+
* @throws TileUrlTemplateError When the URL template uses an unknown variable.
|
|
60
|
+
*/
|
|
61
|
+
declare function parseCelestialDataset(value: unknown): ICelestialDataset;
|
|
62
|
+
/** Options of {@link CelestialTileSource}. */
|
|
63
|
+
interface ICelestialTileSourceOptions {
|
|
64
|
+
/** Shared client, or options used to create a dedicated one. */
|
|
65
|
+
client?: TileHttpClient | ITileHttpClientOptions;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Tiles of a dataset of a tile service, over HTTP. It never requests a tile outside the declared availability, which
|
|
69
|
+
* resolves as absent, so that a sparse pyramid costs no failed request.
|
|
70
|
+
*/
|
|
71
|
+
declare class CelestialTileSource {
|
|
72
|
+
readonly dataset: ICelestialDataset;
|
|
73
|
+
/** Surface of the tiles of the dataset, on its reference surface. */
|
|
74
|
+
readonly surface: CubeTileSurface;
|
|
75
|
+
/** Deepest level available anywhere. */
|
|
76
|
+
readonly deepestLOD: number;
|
|
77
|
+
readonly client: TileHttpClient;
|
|
78
|
+
/** Deepest level of the subtree rooted at each tile. */
|
|
79
|
+
private readonly subtreeDepths;
|
|
80
|
+
/** @param dataset - The descriptor, or its JSON value, checked by {@link parseCelestialDataset}. */
|
|
81
|
+
constructor(dataset: ICelestialDataset | unknown, options?: ICelestialTileSourceOptions);
|
|
82
|
+
/**
|
|
83
|
+
* Deepest level of the dataset at the place of a tile, at most the level of the tile: the level of the tile itself
|
|
84
|
+
* where the dataset declares it, of its deepest declared ancestor elsewhere.
|
|
85
|
+
*/
|
|
86
|
+
servingLevel(address: ITileAddress): number;
|
|
87
|
+
/** Whether the dataset declares a tile. */
|
|
88
|
+
isAvailable(address: ITileAddress): boolean;
|
|
89
|
+
/** Returns the URL of a tile, whether it is available or not. */
|
|
90
|
+
urlOf(address: ITileAddress): string;
|
|
91
|
+
/**
|
|
92
|
+
* Fetches a tile; a tile outside the declared availability resolves as absent, like a 404, without any request.
|
|
93
|
+
*
|
|
94
|
+
* @throws RangeError When the address is invalid.
|
|
95
|
+
*/
|
|
96
|
+
fetchTile(address: ITileAddress, signal?: AbortSignal): Promise<TileFetchResult>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export { CELESTIAL_CUBE_SCHEME as C, type ICelestialDataset as I, CelestialTileSource as a, CubeTileSurface as b, type ICelestialDatasetSubtree as c, type ICelestialTileSourceOptions as d, parseCelestialDataset as p };
|