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