@versatiles/versatiles-rs 4.9.0 → 4.10.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/index.cjs +55 -54
- package/index.d.ts +24 -3
- package/index.js +56 -55
- package/package.json +13 -13
- package/vpl.d.ts +398 -170
- package/vpl.js +44 -36
package/vpl.d.ts
CHANGED
|
@@ -100,386 +100,614 @@ export declare function parseCstResult(vpl: string): CstParseResult;
|
|
|
100
100
|
export declare function parseCst(vpl: string): CstFile;
|
|
101
101
|
/** Write a lossless syntax tree back out as VPL text. */
|
|
102
102
|
export declare function stringifyCst(cst: CstFile): string;
|
|
103
|
+
/**
|
|
104
|
+
* Reformat a syntax tree, keeping its comments.
|
|
105
|
+
*
|
|
106
|
+
* Whitespace and nothing else is rewritten: parameters keep the order they were written in
|
|
107
|
+
* and values keep the quotes the author chose. Every comment keeps the token it was attached
|
|
108
|
+
* to and takes that token's line and indentation. The returned tree carries fresh spans.
|
|
109
|
+
*/
|
|
110
|
+
export declare function formatCst(cst: CstFile): CstFile;
|
|
103
111
|
export interface FromColorOptions {
|
|
104
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* Hex colour, `RRGGBB` or `RRGGBBAA`. Defaults to `000000`.
|
|
114
|
+
*
|
|
115
|
+
* @default 000000
|
|
116
|
+
*/
|
|
105
117
|
color?: string;
|
|
106
|
-
/**
|
|
118
|
+
/**
|
|
119
|
+
* Tile size in pixels, `256` or `512`. Defaults to `512`.
|
|
120
|
+
*
|
|
121
|
+
* @default 512
|
|
122
|
+
*/
|
|
107
123
|
size?: number;
|
|
108
|
-
/**
|
|
109
|
-
|
|
124
|
+
/**
|
|
125
|
+
* Format to encode the tiles in. Defaults to `png`.
|
|
126
|
+
*
|
|
127
|
+
* @default png
|
|
128
|
+
*/
|
|
129
|
+
format?: "avif" | "jpg" | "png" | "webp";
|
|
110
130
|
}
|
|
111
131
|
export interface FromContainerOptions {
|
|
112
|
-
/**
|
|
132
|
+
/** Path to the container, or an `http`, `https` or `sftp` URL. */
|
|
113
133
|
filename: string;
|
|
114
|
-
/**
|
|
134
|
+
/** Private key for this one `sftp://` source. Defaults to the global setting. */
|
|
115
135
|
sshIdentity?: string;
|
|
116
136
|
}
|
|
117
137
|
export interface FromCsvOptions {
|
|
118
|
-
/**
|
|
138
|
+
/** Path to the CSV file. */
|
|
119
139
|
filename: string;
|
|
120
|
-
/**
|
|
140
|
+
/** Column holding the longitude, in WGS84 degrees. */
|
|
121
141
|
lonColumn: string;
|
|
122
|
-
/**
|
|
142
|
+
/** Column holding the latitude, in WGS84 degrees. */
|
|
123
143
|
latColumn: string;
|
|
124
|
-
/**
|
|
144
|
+
/** Column to expose as the feature id. Defaults to emitting no id. */
|
|
125
145
|
idColumn?: string;
|
|
126
|
-
/**
|
|
146
|
+
/**
|
|
147
|
+
* Character separating a row's fields. Defaults to `,`.
|
|
148
|
+
*
|
|
149
|
+
* @default ,
|
|
150
|
+
*/
|
|
127
151
|
delimiter?: string;
|
|
128
|
-
/**
|
|
152
|
+
/**
|
|
153
|
+
* Whether the first row holds column names; `false` is not supported yet. Defaults to `true`.
|
|
154
|
+
*
|
|
155
|
+
* @default true
|
|
156
|
+
*/
|
|
129
157
|
hasHeader?: boolean;
|
|
130
|
-
/** Name of the
|
|
158
|
+
/** Name of the layer to write into. Defaults to the file's stem. */
|
|
131
159
|
layerName?: string;
|
|
132
|
-
/**
|
|
160
|
+
/**
|
|
161
|
+
* Lowest zoom level to emit. Defaults to `0`.
|
|
162
|
+
*
|
|
163
|
+
* @default 0
|
|
164
|
+
*/
|
|
133
165
|
minZoom?: number;
|
|
134
|
-
/** Highest zoom level
|
|
166
|
+
/** Highest zoom level to emit. Defaults to a heuristic capped at `14`. */
|
|
135
167
|
maxZoom?: number;
|
|
136
|
-
/**
|
|
168
|
+
/** Area to restrict the output to, in WGS84 degrees. Defaults to the input's extent. */
|
|
137
169
|
bbox?: [number, number, number, number];
|
|
138
|
-
/**
|
|
170
|
+
/** Columns to keep as properties. Mutually exclusive with `properties_exclude`. Defaults to all. */
|
|
139
171
|
propertiesInclude?: unknown;
|
|
140
|
-
/**
|
|
172
|
+
/** Columns to drop. Mutually exclusive with `properties_include`. Defaults to none. */
|
|
141
173
|
propertiesExclude?: unknown;
|
|
142
|
-
/**
|
|
174
|
+
/**
|
|
175
|
+
* How to thin out points too close to distinguish. Defaults to `min_distance`.
|
|
176
|
+
*
|
|
177
|
+
* @default min_distance
|
|
178
|
+
*/
|
|
143
179
|
pointReduction?: "none" | "drop_rate" | "min_distance";
|
|
144
|
-
/**
|
|
180
|
+
/** Distance in tile-pixels for `min_distance`, keep-fraction for `drop_rate`. Defaults to `16`/`0.5`. */
|
|
145
181
|
pointReductionValue?: number;
|
|
146
|
-
/**
|
|
182
|
+
/**
|
|
183
|
+
* Compression applied before the tiles leave. Defaults to `gzip`.
|
|
184
|
+
*
|
|
185
|
+
* @default gzip
|
|
186
|
+
*/
|
|
147
187
|
compression?: "none" | "gzip" | "brotli" | "zstd";
|
|
148
|
-
/**
|
|
188
|
+
/**
|
|
189
|
+
* Size in bytes above which a tile counts as broken. Defaults to `1048576`.
|
|
190
|
+
*
|
|
191
|
+
* @default 1048576
|
|
192
|
+
*/
|
|
149
193
|
maxTileBytes?: number | "none";
|
|
150
194
|
}
|
|
151
195
|
export interface FromDebugOptions {
|
|
152
|
-
/**
|
|
153
|
-
|
|
196
|
+
/**
|
|
197
|
+
* Format to generate the tiles in. Defaults to `mvt`.
|
|
198
|
+
*
|
|
199
|
+
* @default mvt
|
|
200
|
+
*/
|
|
201
|
+
format?: "mvt" | "avif" | "jpg" | "png" | "webp";
|
|
154
202
|
}
|
|
155
203
|
export interface FromGeoOptions {
|
|
156
|
-
/**
|
|
204
|
+
/** Path to the input file; its format comes from the extension. */
|
|
157
205
|
filename: string;
|
|
158
|
-
/** Name of the
|
|
206
|
+
/** Name of the layer to write into. Defaults to the file's stem. */
|
|
159
207
|
layerName?: string;
|
|
160
|
-
/**
|
|
208
|
+
/**
|
|
209
|
+
* Lowest zoom level to emit. Defaults to `0`.
|
|
210
|
+
*
|
|
211
|
+
* @default 0
|
|
212
|
+
*/
|
|
161
213
|
minZoom?: number;
|
|
162
|
-
/** Highest zoom level
|
|
214
|
+
/** Highest zoom level to emit. Defaults to a heuristic capped at `14`. */
|
|
163
215
|
maxZoom?: number;
|
|
164
|
-
/**
|
|
216
|
+
/** Area to restrict the output to, in WGS84 degrees. Defaults to the input's extent. */
|
|
165
217
|
bbox?: [number, number, number, number];
|
|
166
|
-
/**
|
|
218
|
+
/** Properties to keep. Mutually exclusive with `properties_exclude`. Defaults to all. */
|
|
167
219
|
propertiesInclude?: unknown;
|
|
168
|
-
/**
|
|
220
|
+
/** Properties to drop. Mutually exclusive with `properties_include`. Defaults to none. */
|
|
169
221
|
propertiesExclude?: unknown;
|
|
170
|
-
/**
|
|
222
|
+
/**
|
|
223
|
+
* Area in square tile-pixels below which a polygon is dropped. Defaults to `4`.
|
|
224
|
+
*
|
|
225
|
+
* @default 4
|
|
226
|
+
*/
|
|
171
227
|
polygonMinArea?: number;
|
|
172
|
-
/**
|
|
228
|
+
/**
|
|
229
|
+
* Douglas-Peucker tolerance for polygons, in tile-pixels. Defaults to `4`.
|
|
230
|
+
*
|
|
231
|
+
* @default 4
|
|
232
|
+
*/
|
|
173
233
|
polygonSimplify?: number;
|
|
174
|
-
/**
|
|
234
|
+
/**
|
|
235
|
+
* Length in tile-pixels below which a line is dropped. Defaults to `4`.
|
|
236
|
+
*
|
|
237
|
+
* @default 4
|
|
238
|
+
*/
|
|
175
239
|
lineMinLength?: number;
|
|
176
|
-
/**
|
|
240
|
+
/**
|
|
241
|
+
* Douglas-Peucker tolerance for lines, in tile-pixels. Defaults to `4`.
|
|
242
|
+
*
|
|
243
|
+
* @default 4
|
|
244
|
+
*/
|
|
177
245
|
lineSimplify?: number;
|
|
178
|
-
/**
|
|
246
|
+
/**
|
|
247
|
+
* How to thin out points too close to distinguish. Defaults to `min_distance`.
|
|
248
|
+
*
|
|
249
|
+
* @default min_distance
|
|
250
|
+
*/
|
|
179
251
|
pointReduction?: "none" | "drop_rate" | "min_distance";
|
|
180
|
-
/**
|
|
252
|
+
/** Distance in tile-pixels for `min_distance`, keep-fraction for `drop_rate`. Defaults to `16`/`0.5`. */
|
|
181
253
|
pointReductionValue?: number;
|
|
182
|
-
/**
|
|
254
|
+
/**
|
|
255
|
+
* Compression applied before the tiles leave. Defaults to `gzip`.
|
|
256
|
+
*
|
|
257
|
+
* @default gzip
|
|
258
|
+
*/
|
|
183
259
|
compression?: "none" | "gzip" | "brotli" | "zstd";
|
|
184
|
-
/**
|
|
260
|
+
/**
|
|
261
|
+
* Size in bytes above which a tile counts as broken. Defaults to `1048576`.
|
|
262
|
+
*
|
|
263
|
+
* @default 1048576
|
|
264
|
+
*/
|
|
185
265
|
maxTileBytes?: number | "none";
|
|
186
|
-
/**
|
|
266
|
+
/**
|
|
267
|
+
* Whether to drop each feature's `id` before encoding. Defaults to `false`.
|
|
268
|
+
*
|
|
269
|
+
* @default false
|
|
270
|
+
*/
|
|
187
271
|
ignoreId?: boolean;
|
|
188
272
|
}
|
|
189
273
|
export interface FromGridOptions {
|
|
190
|
-
/** EPSG code of the grid's coordinate reference system.
|
|
274
|
+
/** EPSG code of the grid's coordinate reference system. */
|
|
191
275
|
epsg: number;
|
|
192
|
-
/** Edge length of a cell, in the CRS's
|
|
276
|
+
/** Edge length of a cell, in the CRS's units — meters, or degrees for `epsg=4326`. */
|
|
193
277
|
size: number;
|
|
194
|
-
/**
|
|
278
|
+
/** Area to cover, as `[west, south, east, north]` in WGS84 degrees. */
|
|
195
279
|
bbox: [number, number, number, number];
|
|
196
|
-
/**
|
|
280
|
+
/**
|
|
281
|
+
* Lower-left corner of cell `(0, 0)`, in CRS units. Defaults to `[0,0]`.
|
|
282
|
+
*
|
|
283
|
+
* @default [0,0]
|
|
284
|
+
*/
|
|
197
285
|
offset?: unknown;
|
|
198
|
-
/**
|
|
286
|
+
/**
|
|
287
|
+
* Roughly how many cells one tile may hold. Defaults to `1024`.
|
|
288
|
+
*
|
|
289
|
+
* @default 1024
|
|
290
|
+
*/
|
|
199
291
|
maxCellsPerTile?: number;
|
|
200
|
-
/** Highest zoom level to generate. Defaults to three
|
|
292
|
+
/** Highest zoom level to generate. Defaults to three above the derived minimum. */
|
|
201
293
|
maxZoom?: number;
|
|
202
|
-
/**
|
|
203
|
-
|
|
204
|
-
|
|
294
|
+
/**
|
|
295
|
+
* Ready-made id format. Overridden by `id_template`. Defaults to `inspire`.
|
|
296
|
+
*
|
|
297
|
+
* @default inspire
|
|
298
|
+
*/
|
|
299
|
+
idPreset?: "inspire" | "geostat";
|
|
300
|
+
/** Id format spelled out, with `{x}` and `{y}` for the corner. Defaults to `id_preset`. */
|
|
205
301
|
idTemplate?: string;
|
|
206
|
-
/**
|
|
302
|
+
/**
|
|
303
|
+
* Property holding the cell id. Defaults to `id`.
|
|
304
|
+
*
|
|
305
|
+
* @default id
|
|
306
|
+
*/
|
|
207
307
|
idField?: string;
|
|
208
|
-
/**
|
|
308
|
+
/**
|
|
309
|
+
* Property holding the corner's easting. Defaults to `x`.
|
|
310
|
+
*
|
|
311
|
+
* @default x
|
|
312
|
+
*/
|
|
209
313
|
xField?: string;
|
|
210
|
-
/**
|
|
314
|
+
/**
|
|
315
|
+
* Property holding the corner's northing. Defaults to `y`.
|
|
316
|
+
*
|
|
317
|
+
* @default y
|
|
318
|
+
*/
|
|
211
319
|
yField?: string;
|
|
212
|
-
/**
|
|
320
|
+
/**
|
|
321
|
+
* How far a cell edge may stray from its true curve, in tile pixels. Defaults to `0.5`.
|
|
322
|
+
*
|
|
323
|
+
* @default 0.5
|
|
324
|
+
*/
|
|
213
325
|
densifyTolerance?: number;
|
|
214
|
-
/**
|
|
326
|
+
/**
|
|
327
|
+
* Name of the layer to write into. Defaults to `grid`.
|
|
328
|
+
*
|
|
329
|
+
* @default grid
|
|
330
|
+
*/
|
|
215
331
|
layerName?: string;
|
|
216
332
|
}
|
|
217
333
|
export interface FromH3Options {
|
|
218
|
-
/** H3 resolution, `0` (
|
|
334
|
+
/** H3 resolution, `0` (coarsest) to `15` (finest). */
|
|
219
335
|
resolution: number;
|
|
220
|
-
/**
|
|
336
|
+
/** Area to cover, as `[west, south, east, north]` in WGS84 degrees. */
|
|
221
337
|
bbox: [number, number, number, number];
|
|
222
|
-
/**
|
|
338
|
+
/**
|
|
339
|
+
* Roughly how many cells one tile may hold. Defaults to `1024`.
|
|
340
|
+
*
|
|
341
|
+
* @default 1024
|
|
342
|
+
*/
|
|
223
343
|
maxCellsPerTile?: number;
|
|
224
|
-
/** Highest zoom level to generate. Defaults to three
|
|
344
|
+
/** Highest zoom level to generate. Defaults to three above the derived minimum. */
|
|
225
345
|
maxZoom?: number;
|
|
226
|
-
/**
|
|
346
|
+
/**
|
|
347
|
+
* Name of the layer to write into. Defaults to `grid`.
|
|
348
|
+
*
|
|
349
|
+
* @default grid
|
|
350
|
+
*/
|
|
227
351
|
layerName?: string;
|
|
228
|
-
/**
|
|
352
|
+
/**
|
|
353
|
+
* Property holding the H3 index. Defaults to `h3`.
|
|
354
|
+
*
|
|
355
|
+
* @default h3
|
|
356
|
+
*/
|
|
229
357
|
idField?: string;
|
|
230
358
|
}
|
|
231
359
|
export interface FromStackedRasterOptions {
|
|
232
|
-
/**
|
|
233
|
-
format?: "avif" | "
|
|
234
|
-
/**
|
|
360
|
+
/** Format to encode the blended tiles in. Defaults to the first source's. */
|
|
361
|
+
format?: "avif" | "jpg" | "png" | "webp";
|
|
362
|
+
/**
|
|
363
|
+
* Whether to wrap each source in `raster_overscale`. Defaults to `false`.
|
|
364
|
+
*
|
|
365
|
+
* @default false
|
|
366
|
+
*/
|
|
235
367
|
autoOverscale?: boolean;
|
|
236
368
|
}
|
|
237
369
|
export interface FromTileOptions {
|
|
238
|
-
/**
|
|
370
|
+
/** Path to the tile file; its format comes from the extension. */
|
|
239
371
|
filename: string;
|
|
240
372
|
}
|
|
241
373
|
export interface FromTilejsonOptions {
|
|
242
|
-
/**
|
|
374
|
+
/** URL of the TileJSON endpoint. */
|
|
243
375
|
url: string;
|
|
244
|
-
/**
|
|
376
|
+
/**
|
|
377
|
+
* How often to retry a failed tile request. Defaults to `3`.
|
|
378
|
+
*
|
|
379
|
+
* @default 3
|
|
380
|
+
*/
|
|
245
381
|
maxRetries?: number;
|
|
246
|
-
/**
|
|
382
|
+
/** How many tile requests may be in flight. Defaults to the I/O concurrency limit. */
|
|
247
383
|
maxConcurrentRequests?: number;
|
|
248
384
|
}
|
|
249
385
|
export interface FilterOptions {
|
|
250
|
-
/**
|
|
386
|
+
/** Area to keep, in WGS84 degrees. Defaults to the source's own bounds. */
|
|
251
387
|
bbox?: [number, number, number, number];
|
|
252
|
-
/**
|
|
388
|
+
/**
|
|
389
|
+
* Ring of extra tiles kept around `bbox`, per zoom level. Requires `bbox`. Defaults to `0`.
|
|
390
|
+
*
|
|
391
|
+
* @default 0
|
|
392
|
+
*/
|
|
253
393
|
bboxBorder?: number;
|
|
254
|
-
/**
|
|
394
|
+
/** Lowest zoom level to keep. Defaults to the source's lowest. */
|
|
255
395
|
levelMin?: number;
|
|
256
|
-
/**
|
|
396
|
+
/** Highest zoom level to keep. Defaults to the source's highest. */
|
|
257
397
|
levelMax?: number;
|
|
258
|
-
/**
|
|
398
|
+
/** Tile container whose coordinates act as an allow-list. Defaults to no allow-list. */
|
|
259
399
|
filename?: string;
|
|
260
400
|
}
|
|
261
401
|
export interface MetaUpdateOptions {
|
|
262
|
-
/** Attribution text. */
|
|
402
|
+
/** Attribution text. Defaults to the source's. */
|
|
263
403
|
attribution?: string;
|
|
264
|
-
/**
|
|
404
|
+
/** Area covered, as `[west, south, east, north]` in WGS84 degrees. Defaults to the source's. */
|
|
265
405
|
bounds?: [number, number, number, number];
|
|
266
|
-
/**
|
|
406
|
+
/** Where a client should open the map, as `[lon, lat, zoom]`. Defaults to the source's. */
|
|
267
407
|
center?: [number, number, number];
|
|
268
|
-
/** Description text. */
|
|
408
|
+
/** Description text. Defaults to the source's. */
|
|
269
409
|
description?: string;
|
|
270
|
-
/**
|
|
410
|
+
/** Zoom level from which clients should fill from the parent tile. Defaults to the source's. */
|
|
271
411
|
fillzoom?: number;
|
|
272
|
-
/** Legend text. */
|
|
412
|
+
/** Legend text. Defaults to the source's. */
|
|
273
413
|
legend?: string;
|
|
274
|
-
/** Name
|
|
414
|
+
/** Name of the tileset. Defaults to the source's. */
|
|
275
415
|
name?: string;
|
|
276
|
-
/**
|
|
416
|
+
/** What the tiles contain. Defaults to the source's. */
|
|
277
417
|
schema?: "rgb" | "rgba" | "dem/mapbox" | "dem/terrarium" | "dem/versatiles" | "openmaptiles" | "shortbread@1.0" | "other";
|
|
278
|
-
/**
|
|
418
|
+
/** Complete TileJSON document, as a JSON string. Defaults to the source's metadata. */
|
|
279
419
|
tilejson?: string;
|
|
280
|
-
/** Path to a file
|
|
420
|
+
/** Path to a file holding a complete TileJSON document. Defaults to the source's metadata. */
|
|
281
421
|
tilejsonFile?: string;
|
|
282
|
-
/**
|
|
422
|
+
/** Partial TileJSON document to merge on, as a JSON string. Defaults to merging nothing. */
|
|
283
423
|
tilejsonUpdate?: string;
|
|
284
|
-
/** Path to a file
|
|
424
|
+
/** Path to a file holding a partial TileJSON document. Defaults to merging nothing. */
|
|
285
425
|
tilejsonUpdateFile?: string;
|
|
286
|
-
/** The `vector_layers` array as a JSON string.
|
|
426
|
+
/** The `vector_layers` array as a JSON string. Defaults to the source's. */
|
|
287
427
|
vectorLayers?: string;
|
|
288
|
-
/** Path to a file
|
|
428
|
+
/** Path to a file holding the `vector_layers` array as JSON. Defaults to the source's. */
|
|
289
429
|
vectorLayersFile?: string;
|
|
290
430
|
}
|
|
291
431
|
export interface RemapCoordsOptions {
|
|
292
|
-
/**
|
|
432
|
+
/**
|
|
433
|
+
* Whether to mirror horizontally, so `x` becomes `2^z - 1 - x`. Defaults to `false`.
|
|
434
|
+
*
|
|
435
|
+
* @default false
|
|
436
|
+
*/
|
|
293
437
|
flipX?: boolean;
|
|
294
|
-
/**
|
|
438
|
+
/**
|
|
439
|
+
* Whether to mirror vertically, so `y` becomes `2^z - 1 - y`. Defaults to `false`.
|
|
440
|
+
*
|
|
441
|
+
* @default false
|
|
442
|
+
*/
|
|
295
443
|
flipY?: boolean;
|
|
296
|
-
/**
|
|
444
|
+
/**
|
|
445
|
+
* Whether to exchange the axes, so `(x, y)` becomes `(y, x)`. Defaults to `false`.
|
|
446
|
+
*
|
|
447
|
+
* @default false
|
|
448
|
+
*/
|
|
297
449
|
swapXy?: boolean;
|
|
298
450
|
}
|
|
299
451
|
export interface DemOverviewOptions {
|
|
300
|
-
/**
|
|
452
|
+
/** Zoom level to build the overview from. Defaults to the source's highest. */
|
|
301
453
|
level?: number;
|
|
302
|
-
/**
|
|
303
|
-
encoding?:
|
|
454
|
+
/** DEM encoding of the source. Defaults to the encoding its tile schema implies. */
|
|
455
|
+
encoding?: "mapbox" | "terrarium";
|
|
304
456
|
}
|
|
305
457
|
export interface DemQuantizeOptions {
|
|
306
|
-
/**
|
|
458
|
+
/**
|
|
459
|
+
* Allowed elevation error as a fraction of the pixel's ground size. Defaults to `0.1`.
|
|
460
|
+
*
|
|
461
|
+
* @default 0.1
|
|
462
|
+
*/
|
|
307
463
|
elevationError?: number;
|
|
308
|
-
/**
|
|
464
|
+
/**
|
|
465
|
+
* Largest slope change in degrees that quantization may introduce. Defaults to `1.0`.
|
|
466
|
+
*
|
|
467
|
+
* @default 1.0
|
|
468
|
+
*/
|
|
309
469
|
slopeError?: number;
|
|
310
|
-
/**
|
|
311
|
-
encoding?:
|
|
470
|
+
/** DEM encoding of the source. Defaults to the encoding its tile schema implies. */
|
|
471
|
+
encoding?: "mapbox" | "terrarium";
|
|
312
472
|
}
|
|
313
473
|
export interface DemTileResizeOptions {
|
|
314
|
-
/** Target tile size in pixels
|
|
315
|
-
tileSize
|
|
316
|
-
/**
|
|
317
|
-
encoding?:
|
|
474
|
+
/** Target tile size in pixels, `256` or `512`, and it must differ from the source's. */
|
|
475
|
+
tileSize: number;
|
|
476
|
+
/** DEM encoding of the source. Defaults to the encoding its tile schema implies. */
|
|
477
|
+
encoding?: "mapbox" | "terrarium";
|
|
318
478
|
}
|
|
319
479
|
export interface RasterFlattenOptions {
|
|
320
|
-
/**
|
|
480
|
+
/** Background colour, as `[r, g, b]`. Defaults to white. */
|
|
321
481
|
color?: [number, number, number];
|
|
322
482
|
}
|
|
323
483
|
export interface RasterFormatOptions {
|
|
324
|
-
/**
|
|
484
|
+
/** Format to encode the tiles into. Defaults to the source's. */
|
|
325
485
|
format?: "avif" | "jpg" | "png" | "webp";
|
|
326
|
-
/**
|
|
486
|
+
/** Encoder quality, `0` (worst) to `100` (lossless). Defaults to the encoder's own. */
|
|
327
487
|
quality?: string;
|
|
328
|
-
/**
|
|
488
|
+
/** Encoder quality for tiles with translucent pixels. Defaults to using `quality` throughout. */
|
|
329
489
|
qualityTranslucent?: string;
|
|
330
|
-
/**
|
|
490
|
+
/** Encoder effort, `0` (fastest) to `100` (smallest). Defaults to the encoder's own. */
|
|
331
491
|
effort?: number;
|
|
332
492
|
}
|
|
333
493
|
export interface RasterLevelsOptions {
|
|
334
|
-
/**
|
|
494
|
+
/**
|
|
495
|
+
* Offset added to every channel, `-255` to `255`. Defaults to `0.0`.
|
|
496
|
+
*
|
|
497
|
+
* @default 0.0
|
|
498
|
+
*/
|
|
335
499
|
brightness?: number;
|
|
336
|
-
/**
|
|
500
|
+
/**
|
|
501
|
+
* Factor applied around mid-grey, above `0`. Defaults to `1.0`.
|
|
502
|
+
*
|
|
503
|
+
* @default 1.0
|
|
504
|
+
*/
|
|
337
505
|
contrast?: number;
|
|
338
|
-
/**
|
|
506
|
+
/**
|
|
507
|
+
* Gamma exponent, above `0`. Defaults to `1.0`.
|
|
508
|
+
*
|
|
509
|
+
* @default 1.0
|
|
510
|
+
*/
|
|
339
511
|
gamma?: number;
|
|
340
512
|
}
|
|
341
513
|
export interface RasterMaskOptions {
|
|
342
|
-
/** Path to GeoJSON file
|
|
514
|
+
/** Path to a GeoJSON file holding a Polygon or MultiPolygon, in EPSG:4326 lon/lat degrees. */
|
|
343
515
|
geojson: string;
|
|
344
|
-
/**
|
|
516
|
+
/**
|
|
517
|
+
* Distance in meters by which to grow the mask, or shrink it when negative. Defaults to `0`.
|
|
518
|
+
*
|
|
519
|
+
* @default 0
|
|
520
|
+
*/
|
|
345
521
|
buffer?: number;
|
|
346
|
-
/**
|
|
522
|
+
/**
|
|
523
|
+
* Width in meters of the soft transition at the mask edge. Defaults to `0`.
|
|
524
|
+
*
|
|
525
|
+
* @default 0
|
|
526
|
+
*/
|
|
347
527
|
blur?: number;
|
|
348
|
-
/**
|
|
349
|
-
|
|
528
|
+
/**
|
|
529
|
+
* Falloff curve across the `blur` band. Defaults to `linear`.
|
|
530
|
+
*
|
|
531
|
+
* @default linear
|
|
532
|
+
*/
|
|
533
|
+
blurFunction?: "linear" | "cosine";
|
|
350
534
|
}
|
|
351
535
|
export interface RasterOverscaleOptions {
|
|
352
|
-
/**
|
|
536
|
+
/** Zoom level to upscale from. Defaults to the source's highest. */
|
|
353
537
|
levelBase?: number;
|
|
354
|
-
/**
|
|
538
|
+
/**
|
|
539
|
+
* Highest zoom level to serve. Defaults to `30`.
|
|
540
|
+
*
|
|
541
|
+
* @default 30
|
|
542
|
+
*/
|
|
355
543
|
levelMax?: number;
|
|
356
|
-
/**
|
|
544
|
+
/**
|
|
545
|
+
* Whether to climb to lower levels when the `level_base` tile is missing. Defaults to `false`.
|
|
546
|
+
*
|
|
547
|
+
* @default false
|
|
548
|
+
*/
|
|
357
549
|
enableClimbing?: boolean;
|
|
358
550
|
}
|
|
359
551
|
export interface RasterOverviewOptions {
|
|
360
|
-
/**
|
|
552
|
+
/** Zoom level to build the overview from. Defaults to the source's highest. */
|
|
361
553
|
level?: number;
|
|
362
554
|
}
|
|
363
555
|
export interface RasterTileResizeOptions {
|
|
364
|
-
/** Target tile size in pixels
|
|
365
|
-
tileSize
|
|
556
|
+
/** Target tile size in pixels, `256` or `512`, and it must differ from the source's. */
|
|
557
|
+
tileSize: number;
|
|
366
558
|
}
|
|
367
559
|
export interface VectorFilterFeaturesOptions {
|
|
368
|
-
/** Layers the expression applies to,
|
|
560
|
+
/** Layers the expression applies to, for example `layer=["poi","place"]`. */
|
|
369
561
|
layer: unknown;
|
|
370
|
-
/** CEL
|
|
562
|
+
/** Boolean CEL expression over the feature's properties. */
|
|
371
563
|
expr: string;
|
|
372
564
|
}
|
|
373
565
|
export interface VectorFilterLayersOptions {
|
|
374
|
-
/** Layer names to remove
|
|
566
|
+
/** Layer names to remove, for example `filter=["pois","ocean"]`. */
|
|
375
567
|
filter: unknown;
|
|
376
|
-
/**
|
|
568
|
+
/**
|
|
569
|
+
* Whether to keep the named layers instead of removing them. Defaults to `false`.
|
|
570
|
+
*
|
|
571
|
+
* @default false
|
|
572
|
+
*/
|
|
377
573
|
invert?: boolean;
|
|
378
574
|
}
|
|
379
575
|
export interface VectorFilterPropertiesOptions {
|
|
380
|
-
/**
|
|
576
|
+
/** Regular expression matched against each property's prefixed name. */
|
|
381
577
|
regex: string;
|
|
382
|
-
/**
|
|
578
|
+
/**
|
|
579
|
+
* Whether to keep the matching properties instead of removing them. Defaults to `false`.
|
|
580
|
+
*
|
|
581
|
+
* @default false
|
|
582
|
+
*/
|
|
383
583
|
invert?: boolean;
|
|
384
584
|
}
|
|
385
585
|
export interface VectorOverzoomOptions {
|
|
386
|
-
/**
|
|
586
|
+
/** Zoom level to overzoom from. Defaults to the source's highest. */
|
|
387
587
|
levelBase?: number;
|
|
388
|
-
/**
|
|
588
|
+
/** Highest zoom level to serve, capped at `30`. Defaults to `level_base + 4`. */
|
|
389
589
|
levelMax?: number;
|
|
390
|
-
/**
|
|
590
|
+
/**
|
|
591
|
+
* Whether to climb to lower levels when the `level_base` tile is missing. Defaults to `false`.
|
|
592
|
+
*
|
|
593
|
+
* @default false
|
|
594
|
+
*/
|
|
391
595
|
enableClimbing?: boolean;
|
|
392
|
-
/**
|
|
596
|
+
/**
|
|
597
|
+
* Clip buffer in tile-extent units, so edge-straddling features survive. Defaults to `80`.
|
|
598
|
+
*
|
|
599
|
+
* @default 80
|
|
600
|
+
*/
|
|
393
601
|
buffer?: number;
|
|
394
602
|
}
|
|
395
603
|
export interface VectorRepairOptions {
|
|
396
|
-
/**
|
|
604
|
+
/**
|
|
605
|
+
* Whether to remove features whose geometry cannot be decoded. Defaults to `false`.
|
|
606
|
+
*
|
|
607
|
+
* @default false
|
|
608
|
+
*/
|
|
397
609
|
dropOffenders?: boolean;
|
|
398
610
|
}
|
|
399
611
|
export interface VectorUpdatePropertiesOptions {
|
|
400
|
-
/** Path to the CSV
|
|
612
|
+
/** Path to the CSV or TSV file, which must have a header row. */
|
|
401
613
|
dataSourcePath: string;
|
|
402
|
-
/** Name of the
|
|
614
|
+
/** Name of the layer whose features are updated. */
|
|
403
615
|
layerName: string;
|
|
404
|
-
/**
|
|
616
|
+
/** Feature property holding the id to match on. */
|
|
405
617
|
idFieldTiles: string;
|
|
406
|
-
/** Column
|
|
618
|
+
/** Column in the data file holding the id to match on. */
|
|
407
619
|
idFieldData: string;
|
|
408
|
-
/**
|
|
620
|
+
/**
|
|
621
|
+
* Whether to replace a feature's properties instead of merging. Defaults to `false`.
|
|
622
|
+
*
|
|
623
|
+
* @default false
|
|
624
|
+
*/
|
|
409
625
|
replaceProperties?: boolean;
|
|
410
|
-
/**
|
|
626
|
+
/**
|
|
627
|
+
* Whether to drop features that have no matching row. Defaults to `false`.
|
|
628
|
+
*
|
|
629
|
+
* @default false
|
|
630
|
+
*/
|
|
411
631
|
removeNonMatching?: boolean;
|
|
412
|
-
/**
|
|
632
|
+
/**
|
|
633
|
+
* Whether to keep the id column among the written properties. Defaults to `false`.
|
|
634
|
+
*
|
|
635
|
+
* @default false
|
|
636
|
+
*/
|
|
413
637
|
includeId?: boolean;
|
|
414
|
-
/**
|
|
638
|
+
/** Character separating a row's fields. Defaults to `,` for `.csv` and a tab for `.tsv`. */
|
|
415
639
|
fieldSeparator?: string;
|
|
416
|
-
/**
|
|
640
|
+
/**
|
|
641
|
+
* Decimal separator for parsing numbers, so `,` reads `1.234,56`. Defaults to `.`.
|
|
642
|
+
*
|
|
643
|
+
* @default .
|
|
644
|
+
*/
|
|
417
645
|
decimalSeparator?: string;
|
|
418
646
|
}
|
|
419
647
|
export declare class VPL {
|
|
420
648
|
private steps;
|
|
421
649
|
private constructor();
|
|
422
|
-
/** Generates
|
|
650
|
+
/** Generates raster tiles of a single solid colour. */
|
|
423
651
|
static fromColor(options?: FromColorOptions): VPL;
|
|
424
652
|
/** Reads a tile container, such as a `*.versatiles`, `*.mbtiles`, `*.pmtiles` or `*.tar` file. */
|
|
425
653
|
static fromContainer(options: FromContainerOptions): VPL;
|
|
426
|
-
/** Reads a CSV file with longitude
|
|
654
|
+
/** Reads a CSV file with longitude and latitude columns and emits MVT point tiles. */
|
|
427
655
|
static fromCsv(options: FromCsvOptions): VPL;
|
|
428
|
-
/** Generates
|
|
656
|
+
/** Generates tiles that draw their own coordinates, for inspecting a pipeline. */
|
|
429
657
|
static fromDebug(options?: FromDebugOptions): VPL;
|
|
430
658
|
/** Reads a GeoJSON or Shapefile and emits MVT vector tiles. */
|
|
431
659
|
static fromGeo(options: FromGeoOptions): VPL;
|
|
432
|
-
/** Generates vector tiles
|
|
660
|
+
/** Generates vector tiles holding the cells of a projected square grid. */
|
|
433
661
|
static fromGrid(options: FromGridOptions): VPL;
|
|
434
|
-
/** Generates vector tiles
|
|
662
|
+
/** Generates vector tiles holding H3 hexagons. */
|
|
435
663
|
static fromH3(options: FromH3Options): VPL;
|
|
436
|
-
/** Merges
|
|
664
|
+
/** Merges several vector tile sources into one, keeping every feature. */
|
|
437
665
|
static fromMergedVector(sources: VPL[]): VPL;
|
|
438
|
-
/**
|
|
666
|
+
/** Blends several raster tile sources into one by alpha-compositing them. */
|
|
439
667
|
static fromStackedRaster(sources: VPL[], options?: Omit<FromStackedRasterOptions, 'sources'>): VPL;
|
|
440
|
-
/** Overlays
|
|
668
|
+
/** Overlays several tile sources, taking each tile from the first source that has it. */
|
|
441
669
|
static fromStacked(sources: VPL[]): VPL;
|
|
442
|
-
/** Reads
|
|
670
|
+
/** Reads one tile file and returns it for every requested coordinate. */
|
|
443
671
|
static fromTile(options: FromTileOptions): VPL;
|
|
444
|
-
/** Reads tiles from a remote tile server
|
|
672
|
+
/** Reads tiles from a remote tile server described by a TileJSON endpoint. */
|
|
445
673
|
static fromTilejson(options: FromTilejsonOptions): VPL;
|
|
446
|
-
/**
|
|
674
|
+
/** Filters tiles by bounding box, zoom range, or the coordinates present in another container. */
|
|
447
675
|
filter(options?: FilterOptions): VPL;
|
|
448
|
-
/**
|
|
676
|
+
/** Overwrites fields of the source's TileJSON metadata. */
|
|
449
677
|
metaUpdate(options?: MetaUpdateOptions): VPL;
|
|
450
|
-
/** Relabels tile coordinates,
|
|
678
|
+
/** Relabels tile coordinates, correcting a source that uses TMS row order or `z/y/x` paths. */
|
|
451
679
|
remapCoords(options?: RemapCoordsOptions): VPL;
|
|
452
|
-
/**
|
|
680
|
+
/** Generates lower-zoom DEM overview tiles by averaging 24-bit elevation values. */
|
|
453
681
|
demOverview(options?: DemOverviewOptions): VPL;
|
|
454
|
-
/**
|
|
682
|
+
/** Quantizes DEM raster tiles by rounding elevations to a per-tile power-of-two step. */
|
|
455
683
|
demQuantize(options?: DemQuantizeOptions): VPL;
|
|
456
|
-
/**
|
|
457
|
-
demTileResize(options
|
|
458
|
-
/**
|
|
684
|
+
/** Converts DEM tiles between 256 and 512 pixels by splitting or merging them. */
|
|
685
|
+
demTileResize(options: DemTileResizeOptions): VPL;
|
|
686
|
+
/** Composites translucent raster tiles onto an opaque background colour. */
|
|
459
687
|
rasterFlatten(options?: RasterFlattenOptions): VPL;
|
|
460
|
-
/**
|
|
688
|
+
/** Re-encodes raster tiles into another image format, quality or effort setting. */
|
|
461
689
|
rasterFormat(options?: RasterFormatOptions): VPL;
|
|
462
|
-
/**
|
|
690
|
+
/** Adjusts the brightness, contrast and gamma of raster tiles. */
|
|
463
691
|
rasterLevels(options?: RasterLevelsOptions): VPL;
|
|
464
|
-
/**
|
|
692
|
+
/** Makes raster pixels outside a GeoJSON polygon transparent. */
|
|
465
693
|
rasterMask(options: RasterMaskOptions): VPL;
|
|
466
|
-
/**
|
|
694
|
+
/** Serves raster tiles above the source's native resolution by upscaling. */
|
|
467
695
|
rasterOverscale(options?: RasterOverscaleOptions): VPL;
|
|
468
|
-
/**
|
|
696
|
+
/** Generates the lower zoom levels of a raster pyramid by downscaling. */
|
|
469
697
|
rasterOverview(options?: RasterOverviewOptions): VPL;
|
|
470
|
-
/**
|
|
471
|
-
rasterTileResize(options
|
|
472
|
-
/** Drops vector features in selected layers that do not satisfy a boolean
|
|
698
|
+
/** Converts raster tiles between 256 and 512 pixels by splitting or merging them. */
|
|
699
|
+
rasterTileResize(options: RasterTileResizeOptions): VPL;
|
|
700
|
+
/** Drops vector features in selected layers that do not satisfy a boolean expression. */
|
|
473
701
|
vectorFilterFeatures(options: VectorFilterFeaturesOptions): VPL;
|
|
474
|
-
/**
|
|
702
|
+
/** Removes whole layers from vector tiles by name. */
|
|
475
703
|
vectorFilterLayers(options: VectorFilterLayersOptions): VPL;
|
|
476
|
-
/**
|
|
704
|
+
/** Removes feature properties from vector tiles by matching their names against a regex. */
|
|
477
705
|
vectorFilterProperties(options: VectorFilterPropertiesOptions): VPL;
|
|
478
|
-
/**
|
|
706
|
+
/** Serves vector tiles above the source's highest zoom level by clipping and rescaling. */
|
|
479
707
|
vectorOverzoom(options?: VectorOverzoomOptions): VPL;
|
|
480
|
-
/** Repairs vector tiles
|
|
708
|
+
/** Repairs vector tiles so that they conform to MVT 2.1. */
|
|
481
709
|
vectorRepair(options?: VectorRepairOptions): VPL;
|
|
482
|
-
/**
|
|
710
|
+
/** Joins tabular data onto vector features, matching on an id column. */
|
|
483
711
|
vectorUpdateProperties(options: VectorUpdatePropertiesOptions): VPL;
|
|
484
712
|
/** Serialize this VPL pipeline to a string. */
|
|
485
713
|
toString(): string;
|