@basemaps/config-loader 7.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 +21 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +3 -0
- package/build/index.js.map +1 -0
- package/build/json/__tests__/config.loader.test.d.ts +1 -0
- package/build/json/__tests__/config.loader.test.js +105 -0
- package/build/json/__tests__/config.loader.test.js.map +1 -0
- package/build/json/__tests__/tiff.config.test.d.ts +1 -0
- package/build/json/__tests__/tiff.config.test.js +53 -0
- package/build/json/__tests__/tiff.config.test.js.map +1 -0
- package/build/json/__tests__/tiff.load.test.d.ts +1 -0
- package/build/json/__tests__/tiff.load.test.js +143 -0
- package/build/json/__tests__/tiff.load.test.js.map +1 -0
- package/build/json/imagery.config.cache.d.ts +7 -0
- package/build/json/imagery.config.cache.js +45 -0
- package/build/json/imagery.config.cache.js.map +1 -0
- package/build/json/json.config.d.ts +39 -0
- package/build/json/json.config.js +319 -0
- package/build/json/json.config.js.map +1 -0
- package/build/json/log.d.ts +17 -0
- package/build/json/log.js +2 -0
- package/build/json/log.js.map +1 -0
- package/build/json/parse.provider.d.ts +149 -0
- package/build/json/parse.provider.js +31 -0
- package/build/json/parse.provider.js.map +1 -0
- package/build/json/parse.style.d.ts +30 -0
- package/build/json/parse.style.js +13 -0
- package/build/json/parse.style.js.map +1 -0
- package/build/json/parse.tile.set.d.ts +252 -0
- package/build/json/parse.tile.set.js +47 -0
- package/build/json/parse.tile.set.js.map +1 -0
- package/build/json/tiff.config.d.ts +113 -0
- package/build/json/tiff.config.js +430 -0
- package/build/json/tiff.config.js.map +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import { DefaultColorRampOutput, DefaultTerrainRgbOutput, sha256base58, TileSetType, } from '@basemaps/config';
|
|
2
|
+
import { Bounds, EpsgCode, Nztm2000QuadTms, TileMatrixSets } from '@basemaps/geo';
|
|
3
|
+
import { fsa, Tiff, TiffTag } from '@basemaps/shared';
|
|
4
|
+
import { SampleFormat } from '@cogeotiff/core';
|
|
5
|
+
import pLimit from 'p-limit';
|
|
6
|
+
import { basename } from 'path';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
import { getCachedImageryConfig, writeCachedImageryConfig } from './imagery.config.cache.js';
|
|
9
|
+
import { ConfigJson, isEmptyTiff } from './json.config.js';
|
|
10
|
+
/** Does a file look like a tiff, ending in .tif or .tiff */
|
|
11
|
+
function isTiff(f) {
|
|
12
|
+
const lowered = f.pathname.toLocaleLowerCase();
|
|
13
|
+
return lowered.endsWith('.tif') || lowered.endsWith('.tiff');
|
|
14
|
+
}
|
|
15
|
+
function getDataType(i) {
|
|
16
|
+
switch (i) {
|
|
17
|
+
case SampleFormat.Uint:
|
|
18
|
+
return 'uint';
|
|
19
|
+
case SampleFormat.Int:
|
|
20
|
+
return 'int';
|
|
21
|
+
case SampleFormat.Float:
|
|
22
|
+
return 'float';
|
|
23
|
+
case SampleFormat.Void:
|
|
24
|
+
return 'void';
|
|
25
|
+
case SampleFormat.ComplexFloat:
|
|
26
|
+
return 'cfloat';
|
|
27
|
+
case SampleFormat.ComplexInt:
|
|
28
|
+
return 'cint';
|
|
29
|
+
default:
|
|
30
|
+
return 'unknown';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Convert a degree (lat,lon) into a approximate metres
|
|
35
|
+
*
|
|
36
|
+
* @param deg Number of degrees per pixel
|
|
37
|
+
*
|
|
38
|
+
* @returns very rough approximation of the number of meters per degree
|
|
39
|
+
*/
|
|
40
|
+
function approxDegreeToMeter(deg) {
|
|
41
|
+
return deg * 111139;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Validate that the bands inside this tiff are similar to the exiting bands
|
|
45
|
+
*
|
|
46
|
+
* if no existing bands are found return the new bands
|
|
47
|
+
*
|
|
48
|
+
* This is not a exhaustive comparision
|
|
49
|
+
*
|
|
50
|
+
* @param tiff
|
|
51
|
+
* @param existingBands
|
|
52
|
+
* @param newBands
|
|
53
|
+
*/
|
|
54
|
+
function ensureBandsSimilar(tiff, existingBands, newBands) {
|
|
55
|
+
// no bands to compare
|
|
56
|
+
if (existingBands == null)
|
|
57
|
+
return newBands;
|
|
58
|
+
const maxBands = Math.max(existingBands.length, newBands.length);
|
|
59
|
+
for (let i = 0; i < maxBands; i++) {
|
|
60
|
+
const bA = existingBands[i];
|
|
61
|
+
const bB = newBands[i];
|
|
62
|
+
if (bA == null || bB == null)
|
|
63
|
+
continue;
|
|
64
|
+
if (bA !== bB) {
|
|
65
|
+
throw new Error(`Band:${i} datatype mismatch: ${tiff.source.url.href} ${bA} vs ${bB}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (existingBands.length >= newBands.length)
|
|
69
|
+
return existingBands;
|
|
70
|
+
return newBands;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Read all tiffs from a target path and ensure all tiffs contain the same GSD and EPSG code,
|
|
74
|
+
* while computing bounding boxes for the entire imagery set
|
|
75
|
+
*
|
|
76
|
+
* @throws if any of the tiffs have differing EPSG or GSD
|
|
77
|
+
**/
|
|
78
|
+
async function computeTiffSummary(target, tiffs) {
|
|
79
|
+
const res = { files: [] };
|
|
80
|
+
const targetPath = target;
|
|
81
|
+
let bounds;
|
|
82
|
+
for (const tiff of tiffs) {
|
|
83
|
+
const firstImage = tiff.images[0];
|
|
84
|
+
const epsg = firstImage.epsg;
|
|
85
|
+
if (epsg == null)
|
|
86
|
+
throw new Error(`No ESPG projection found. source:` + tiff.source.url);
|
|
87
|
+
// Validate all EPSG codes are the same for each imagery set
|
|
88
|
+
if (res.projection == null)
|
|
89
|
+
res.projection = epsg;
|
|
90
|
+
else if (res.projection !== epsg) {
|
|
91
|
+
throw new Error(`ESPG projection mismatch on imagery ${res.projection} vs ${epsg} source:` + tiff.source.url);
|
|
92
|
+
}
|
|
93
|
+
// Validate the bands and data types of the tiff are somewhat consistent
|
|
94
|
+
const [dataType, bitsPerSample, noData] = await Promise.all([
|
|
95
|
+
/** firstImage.fetch(TiffTag.Photometric), **/ // TODO enable RGB detection
|
|
96
|
+
firstImage.fetch(TiffTag.SampleFormat),
|
|
97
|
+
firstImage.fetch(TiffTag.BitsPerSample),
|
|
98
|
+
firstImage.fetch(TiffTag.GdalNoData),
|
|
99
|
+
]);
|
|
100
|
+
if (dataType == null || bitsPerSample == null) {
|
|
101
|
+
throw new Error('Failed to extract band information from : ' + tiff.source.url);
|
|
102
|
+
}
|
|
103
|
+
if (dataType.length !== bitsPerSample.length) {
|
|
104
|
+
throw new Error('Datatype and bits per sample miss match: ' + tiff.source.url);
|
|
105
|
+
}
|
|
106
|
+
const imageBands = [];
|
|
107
|
+
for (let i = 0; i < dataType.length; i++) {
|
|
108
|
+
const type = getDataType(dataType[i]);
|
|
109
|
+
const bits = bitsPerSample[i];
|
|
110
|
+
imageBands.push(`${type}${bits}`);
|
|
111
|
+
}
|
|
112
|
+
res.bands = ensureBandsSimilar(tiff, res.bands, imageBands);
|
|
113
|
+
// Validate NoData value is consistent across entire
|
|
114
|
+
const imageNoData = noData ? Number(noData) : null;
|
|
115
|
+
if (res.noData != null && imageNoData !== res.noData) {
|
|
116
|
+
throw new Error(`NoData mismatch on ${imageNoData} vs ${res.noData} from: ${tiff.source.url.href}`);
|
|
117
|
+
}
|
|
118
|
+
if (imageNoData != null) {
|
|
119
|
+
res.noData = imageNoData;
|
|
120
|
+
}
|
|
121
|
+
// Validate image resolution
|
|
122
|
+
const gsd = firstImage.resolution[0];
|
|
123
|
+
if (res.gsd == null)
|
|
124
|
+
res.gsd = gsd;
|
|
125
|
+
else {
|
|
126
|
+
const gsdDiff = Math.abs(res.gsd - gsd);
|
|
127
|
+
if (gsdDiff > 0.001)
|
|
128
|
+
throw new Error(`GSD mismatch on imagery ${res.gsd} vs ${gsd} from: ${tiff.source.url}`);
|
|
129
|
+
}
|
|
130
|
+
const gsdRound = Math.floor(gsd * 100) / 10000;
|
|
131
|
+
const bbox = firstImage.bbox.map((f) => {
|
|
132
|
+
// prevent dividing by zero
|
|
133
|
+
if (f === 0 || gsdRound === 0)
|
|
134
|
+
return f;
|
|
135
|
+
return Math.floor(f / gsdRound) * gsdRound;
|
|
136
|
+
});
|
|
137
|
+
const imgBounds = Bounds.fromBbox(bbox);
|
|
138
|
+
if (bounds == null)
|
|
139
|
+
bounds = imgBounds;
|
|
140
|
+
else
|
|
141
|
+
bounds = bounds.union(imgBounds);
|
|
142
|
+
if (res.files == null)
|
|
143
|
+
res.files = [];
|
|
144
|
+
const relativePath = toRelative(targetPath, tiff.source.url);
|
|
145
|
+
res.files.push({ name: relativePath, ...imgBounds });
|
|
146
|
+
}
|
|
147
|
+
// If the tiff is in EPSG:4326 then its resolution will be in degrees,
|
|
148
|
+
// We require a GSD in meters for all the math we do so calculate a approx meters
|
|
149
|
+
if (res.projection === 4326)
|
|
150
|
+
res.gsd = res.gsd ? approxDegreeToMeter(res.gsd) : res.gsd;
|
|
151
|
+
res.bounds = bounds?.toJson();
|
|
152
|
+
if (res.bounds == null)
|
|
153
|
+
throw new Error('Failed to extract imagery bounds from:' + target);
|
|
154
|
+
if (res.projection == null)
|
|
155
|
+
throw new Error('Failed to extract imagery epsg from:' + target);
|
|
156
|
+
if (res.files == null || res.files.length === 0)
|
|
157
|
+
throw new Error('Failed to extract imagery from:' + target);
|
|
158
|
+
return res;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Convert a path to a relative path
|
|
162
|
+
*
|
|
163
|
+
* @param base the path to be relative to
|
|
164
|
+
* @param other the path to convert
|
|
165
|
+
*/
|
|
166
|
+
function toRelative(base, other) {
|
|
167
|
+
if (!other.href.startsWith(base.href))
|
|
168
|
+
throw new Error('Paths are not relative');
|
|
169
|
+
const part = urlToString(other).slice(urlToString(base).length);
|
|
170
|
+
if (part.startsWith('/') || part.startsWith('\\'))
|
|
171
|
+
return part.slice(1);
|
|
172
|
+
return part;
|
|
173
|
+
}
|
|
174
|
+
/** Convert a URL to a string using fileUrlToPath if the URL is a file:// */
|
|
175
|
+
function urlToString(u) {
|
|
176
|
+
if (u.protocol === 'file:')
|
|
177
|
+
return fileURLToPath(u);
|
|
178
|
+
return u.href;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Attempt to read a stac collection.json from the target path if it exists or return null if anything goes wrong.
|
|
182
|
+
*/
|
|
183
|
+
export async function loadStacFromURL(target) {
|
|
184
|
+
/**
|
|
185
|
+
* If the target location does not end with a "/" it could be
|
|
186
|
+
*
|
|
187
|
+
* - A mistake "/imagery/otago_2017-2019_0.3m"
|
|
188
|
+
* - A prefix "/imagery/otago_2017-2019_0.3m/CB_"
|
|
189
|
+
*
|
|
190
|
+
* So we need to check for both locations
|
|
191
|
+
*/
|
|
192
|
+
if (!target.pathname.endsWith('/')) {
|
|
193
|
+
const pathWithSlash = new URL('collection.json', target.href + '/');
|
|
194
|
+
const pathWithoutSlash = new URL('collection.json', target.href);
|
|
195
|
+
const [resWithSlash, resWithoutSlash] = await Promise.allSettled([
|
|
196
|
+
fsa.readJson(pathWithSlash),
|
|
197
|
+
fsa.readJson(pathWithoutSlash),
|
|
198
|
+
]);
|
|
199
|
+
// Collection path with the `/` should take priority as it is a more specific location
|
|
200
|
+
if (resWithSlash.status === 'fulfilled')
|
|
201
|
+
return resWithSlash.value;
|
|
202
|
+
if (resWithoutSlash.status === 'fulfilled')
|
|
203
|
+
return resWithoutSlash.value;
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
const collectionPath = new URL('collection.json', target);
|
|
207
|
+
try {
|
|
208
|
+
return await fsa.readJson(collectionPath);
|
|
209
|
+
}
|
|
210
|
+
catch (e) {
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/** When attempting to guess a folder name, try and ignore common imagery types and projection */
|
|
215
|
+
const IgnoredTitles = new Set([
|
|
216
|
+
// Imagery
|
|
217
|
+
'rgb',
|
|
218
|
+
'rgbi',
|
|
219
|
+
// Elevation
|
|
220
|
+
'dem_1m',
|
|
221
|
+
'dsm_1m',
|
|
222
|
+
// Argo folders
|
|
223
|
+
'flat',
|
|
224
|
+
// Projections
|
|
225
|
+
'2193',
|
|
226
|
+
'3857',
|
|
227
|
+
]);
|
|
228
|
+
/**
|
|
229
|
+
* Guess a better imagery name from a target URL
|
|
230
|
+
*
|
|
231
|
+
* A lot of our source paths include the type of imagery eg "rgb", "rgbi" or "dem_1m",
|
|
232
|
+
* these names are not super helpful and often there are better names further up the pathname
|
|
233
|
+
*
|
|
234
|
+
* @example
|
|
235
|
+
* ```typescript
|
|
236
|
+
* getImageryName('s3://linz-imagery/auckland/auckland_sn5600_1979_0.375m/2193/rgb/')
|
|
237
|
+
* // auckland_sn5600_1979_0.375m
|
|
238
|
+
* ```
|
|
239
|
+
*
|
|
240
|
+
* The list of paths ignored are from
|
|
241
|
+
*
|
|
242
|
+
* @see {IgnoredTitles}
|
|
243
|
+
*
|
|
244
|
+
* For common imagery paths see:
|
|
245
|
+
*
|
|
246
|
+
* @see {@link https://github.com/linz/imagery}
|
|
247
|
+
* @see {@link https://github.com/linz/elevation}
|
|
248
|
+
*/
|
|
249
|
+
export function getImageryName(target) {
|
|
250
|
+
const parts = target.pathname.split('/'); // URL folders are always "/"
|
|
251
|
+
for (let i = parts.length - 1; i >= 0; i--) {
|
|
252
|
+
const part = parts[i];
|
|
253
|
+
if (part === '')
|
|
254
|
+
continue;
|
|
255
|
+
if (IgnoredTitles.has(part.toLowerCase()))
|
|
256
|
+
continue;
|
|
257
|
+
return part;
|
|
258
|
+
}
|
|
259
|
+
// Everything is ignored just use basename
|
|
260
|
+
return basename(target.pathname);
|
|
261
|
+
}
|
|
262
|
+
export async function loadTiffsFromPaths(sourceFiles, Q) {
|
|
263
|
+
// Load metadata about all the tiffs ignoring any empty sparse tiffs
|
|
264
|
+
return (await Promise.all(sourceFiles.filter(isTiff).map((c) => Q(async () => {
|
|
265
|
+
const tiff = await new Tiff(fsa.source(c)).init();
|
|
266
|
+
if (await isEmptyTiff(tiff)) {
|
|
267
|
+
await tiff.source.close?.();
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
return tiff;
|
|
271
|
+
})))).filter((f) => f != null);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Attempt to load all imagery inside of a path and create a configuration from it
|
|
275
|
+
*
|
|
276
|
+
* @param target path that contains the imagery
|
|
277
|
+
* @param Q limit the number of requests per second to the imagery
|
|
278
|
+
* @param configCache optional location to cache the configuration objects
|
|
279
|
+
*
|
|
280
|
+
* @returns Imagery configuration generated from the path
|
|
281
|
+
*/
|
|
282
|
+
export async function initImageryFromTiffUrl(target, Q, configCache, log) {
|
|
283
|
+
const sourceFiles = await fsa.toArray(fsa.details(target));
|
|
284
|
+
const prev = await getCachedImageryConfig(sourceFiles, configCache, log);
|
|
285
|
+
if (prev)
|
|
286
|
+
return prev;
|
|
287
|
+
const tiffs = await loadTiffsFromPaths(sourceFiles.map((m) => m.url), Q);
|
|
288
|
+
try {
|
|
289
|
+
const stac = await loadStacFromURL(target);
|
|
290
|
+
if (stac == null)
|
|
291
|
+
log?.warn({ target: target }, 'Tiff:StacNotFound');
|
|
292
|
+
const params = await computeTiffSummary(target, tiffs);
|
|
293
|
+
const imageryName = getImageryName(target);
|
|
294
|
+
const title = stac?.title ?? imageryName;
|
|
295
|
+
const tileMatrix = params.projection === EpsgCode.Nztm2000 ? Nztm2000QuadTms : TileMatrixSets.tryGet(params.projection);
|
|
296
|
+
const imagery = {
|
|
297
|
+
id: `im_${sha256base58(target.href)}`,
|
|
298
|
+
name: imageryName,
|
|
299
|
+
title,
|
|
300
|
+
updatedAt: Date.now(),
|
|
301
|
+
projection: params.projection,
|
|
302
|
+
tileMatrix: tileMatrix?.identifier ?? 'none',
|
|
303
|
+
gsd: params.gsd,
|
|
304
|
+
uri: target.href,
|
|
305
|
+
url: target,
|
|
306
|
+
bounds: params.bounds,
|
|
307
|
+
bands: params.bands,
|
|
308
|
+
noData: params.noData,
|
|
309
|
+
files: params.files,
|
|
310
|
+
collection: stac ?? undefined,
|
|
311
|
+
};
|
|
312
|
+
imagery.overviews = await ConfigJson.findImageryOverviews(imagery);
|
|
313
|
+
log?.info({ title, imageryName, files: imagery.files.length }, 'Tiff:Loaded');
|
|
314
|
+
await writeCachedImageryConfig(sourceFiles, imagery, configCache);
|
|
315
|
+
return imagery;
|
|
316
|
+
}
|
|
317
|
+
finally {
|
|
318
|
+
await Promise.all(tiffs.map((t) => t.source.close?.()));
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Create configuration from a folder full of tiffs or a folder of folders of tiffs
|
|
323
|
+
*
|
|
324
|
+
* Given the following folder structure
|
|
325
|
+
*
|
|
326
|
+
* ```typescript
|
|
327
|
+
* "/imagery/invercargill_2022_0.05m/*.tiff"
|
|
328
|
+
* "/imagery/wellington_2022_0.05/*.tiff"
|
|
329
|
+
* ```
|
|
330
|
+
*
|
|
331
|
+
* A. A single imagery datasets
|
|
332
|
+
*
|
|
333
|
+
* ```typescript
|
|
334
|
+
* target = ["/imagery/invercargill_2022_0.05m/"]
|
|
335
|
+
* ```
|
|
336
|
+
*
|
|
337
|
+
* will load all tiffs from the resulting folder into a single tile set `aerial`
|
|
338
|
+
*
|
|
339
|
+
* B: A tree of imagery datasets
|
|
340
|
+
*
|
|
341
|
+
* ```typescript
|
|
342
|
+
* target = ["/imagery/invercargill_2022_0.05m/*.tiff", "/imagery/wellington_2022_0.05/*.tiff"]
|
|
343
|
+
* ```
|
|
344
|
+
*
|
|
345
|
+
* will load all tiffs from all folders targets into a single tile set "aerial",
|
|
346
|
+
* then load each folder into their own tile set.
|
|
347
|
+
*
|
|
348
|
+
* The rendering order will be the order of the target locations
|
|
349
|
+
*
|
|
350
|
+
* tile sets: aerial, wellington_2022_0.05, invercargill_2022_0.05m
|
|
351
|
+
*
|
|
352
|
+
* @param provider where to store all the configuration generated
|
|
353
|
+
* @param targets the target location
|
|
354
|
+
* @param concurrency number of tiff files to load at a time
|
|
355
|
+
* @returns
|
|
356
|
+
*/
|
|
357
|
+
export async function initConfigFromUrls(provider, targets, concurrency = 25, configCache, log) {
|
|
358
|
+
const q = pLimit(concurrency);
|
|
359
|
+
const imageryConfig = [];
|
|
360
|
+
for (const target of targets)
|
|
361
|
+
imageryConfig.push(initImageryFromTiffUrl(target, q, configCache, log));
|
|
362
|
+
const aerialTileSet = {
|
|
363
|
+
id: 'ts_aerial',
|
|
364
|
+
name: 'aerial',
|
|
365
|
+
title: 'Basemaps',
|
|
366
|
+
category: 'Basemaps',
|
|
367
|
+
type: TileSetType.Raster,
|
|
368
|
+
layers: [],
|
|
369
|
+
};
|
|
370
|
+
const elevationTileSet = {
|
|
371
|
+
id: 'ts_elevation',
|
|
372
|
+
name: 'elevation',
|
|
373
|
+
title: 'Elevation Basemap',
|
|
374
|
+
category: 'Basemaps',
|
|
375
|
+
type: TileSetType.Raster,
|
|
376
|
+
layers: [],
|
|
377
|
+
outputs: [DefaultTerrainRgbOutput, DefaultColorRampOutput],
|
|
378
|
+
};
|
|
379
|
+
provider.put(aerialTileSet);
|
|
380
|
+
const configs = await Promise.all(imageryConfig);
|
|
381
|
+
const tileSets = [aerialTileSet];
|
|
382
|
+
for (const cfg of configs) {
|
|
383
|
+
provider.put(cfg);
|
|
384
|
+
if (isRgbOrRgba(cfg)) {
|
|
385
|
+
let existingLayer = aerialTileSet.layers.find((l) => l.title === cfg.title);
|
|
386
|
+
if (existingLayer == null) {
|
|
387
|
+
existingLayer = { name: cfg.name, title: cfg.title };
|
|
388
|
+
aerialTileSet.layers.push(existingLayer);
|
|
389
|
+
}
|
|
390
|
+
existingLayer[cfg.projection] = cfg.id;
|
|
391
|
+
}
|
|
392
|
+
else if (cfg.bands?.length === 1) {
|
|
393
|
+
let existingLayer = elevationTileSet.layers.find((l) => l.title === cfg.title);
|
|
394
|
+
if (existingLayer == null) {
|
|
395
|
+
existingLayer = { name: cfg.name, title: cfg.title };
|
|
396
|
+
elevationTileSet.layers.push(existingLayer);
|
|
397
|
+
}
|
|
398
|
+
existingLayer[cfg.projection] = cfg.id;
|
|
399
|
+
if (!provider.objects.has(elevationTileSet.id)) {
|
|
400
|
+
provider.put(elevationTileSet);
|
|
401
|
+
tileSets.push(elevationTileSet);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
// FIXME: tileSet should be removed now that we are returning all tilesets
|
|
406
|
+
return { tileSet: aerialTileSet, tileSets, imagery: configs };
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Attempt to guess if this configuration contains RGB or RGBA imagery
|
|
410
|
+
* by validating the image is either 3 or 4 band uint8
|
|
411
|
+
*
|
|
412
|
+
* @param img Imagery to check
|
|
413
|
+
* @returns true if imagery looks like rgb(a), false otherwise
|
|
414
|
+
*/
|
|
415
|
+
export function isRgbOrRgba(img) {
|
|
416
|
+
// If no band information is provided assume its a RGBA image (TODO: is this actually expected)
|
|
417
|
+
if (img.bands == null)
|
|
418
|
+
return true;
|
|
419
|
+
if (img.bands.length < 3)
|
|
420
|
+
return false; // Not enough bands for RGB
|
|
421
|
+
if (img.bands.length > 4)
|
|
422
|
+
return false; // Too many bands for RGBA
|
|
423
|
+
// RGB/RGBA is expected to be 3 or 4 band uint8
|
|
424
|
+
for (const b of img.bands) {
|
|
425
|
+
if (b !== 'uint8')
|
|
426
|
+
return false;
|
|
427
|
+
}
|
|
428
|
+
return true;
|
|
429
|
+
}
|
|
430
|
+
//# sourceMappingURL=tiff.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiff.config.js","sourceRoot":"","sources":["../../src/json/tiff.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,sBAAsB,EACtB,uBAAuB,EAGvB,YAAY,EACZ,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAe,MAAM,EAAE,QAAQ,EAAe,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GAAG,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC;YACvC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,CAAC,EAAE,CAAC;gBAC/C,QAAQ,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;gBAC/B,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;IACH,CAAC;IACD,0EAA0E;IAC1E,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAChE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,GAAkB;IAC5C,+FAA+F;IAC/F,IAAI,GAAG,CAAC,KAAK,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IACnC,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC,CAAC,2BAA2B;IACnE,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC,CAAC,0BAA0B;IAElE,+CAA+C;IAC/C,KAAK,MAAM,CAAC,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;QAC1B,IAAI,CAAC,KAAK,OAAO;YAAE,OAAO,KAAK,CAAC;IAClC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@basemaps/config-loader",
|
|
3
|
+
"version": "7.1.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/linz/basemaps.git",
|
|
7
|
+
"directory": "packages/config-loader"
|
|
8
|
+
},
|
|
9
|
+
"author": {
|
|
10
|
+
"name": "Land Information New Zealand",
|
|
11
|
+
"url": "https://linz.govt.nz",
|
|
12
|
+
"organization": true
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=16.0.0"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"main": "./build/index.js",
|
|
20
|
+
"types": "./build/index.d.ts",
|
|
21
|
+
"scripts": {
|
|
22
|
+
"test": "node --test"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"build/"
|
|
29
|
+
],
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@basemaps/config": "^7.1.0",
|
|
32
|
+
"@basemaps/geo": "^7.1.0",
|
|
33
|
+
"@basemaps/shared": "^7.1.0"
|
|
34
|
+
},
|
|
35
|
+
"gitHead": "f6f5f37f090c41115a094cb5b9dc5326a0bd30c9"
|
|
36
|
+
}
|