@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.
Files changed (6) hide show
  1. package/index.cjs +55 -54
  2. package/index.d.ts +24 -3
  3. package/index.js +56 -55
  4. package/package.json +13 -13
  5. package/vpl.d.ts +398 -170
  6. 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
- /** Hex color in RGB or RGBA format (e.g., "FF5733" or "FF573380"). Defaults to "000000" (black). */
112
+ /**
113
+ * Hex colour, `RRGGBB` or `RRGGBBAA`. Defaults to `000000`.
114
+ *
115
+ * @default 000000
116
+ */
105
117
  color?: string;
106
- /** Tile size in pixels (256 or 512). Defaults to 512. */
118
+ /**
119
+ * Tile size in pixels, `256` or `512`. Defaults to `512`.
120
+ *
121
+ * @default 512
122
+ */
107
123
  size?: number;
108
- /** Tile format: one of "avif", "jpg", "png", or "webp". Defaults to "png". */
109
- format?: "avif" | "bin" | "geojson" | "jpg" | "json" | "mvt" | "png" | "svg" | "topojson" | "webp";
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
- /** The filename of the tile container (relative to the VPL file path), or a URL (`http`, `https`, or `sftp`). For example: `filename="world.versatiles"` or `filename="https://example.com/world.versatiles"`. See `versatiles help source` for URL and authentication details. */
132
+ /** Path to the container, or an `http`, `https` or `sftp` URL. */
113
133
  filename: string;
114
- /** The private key file to authenticate this `sftp://` source with, for example `ssh_identity="/home/deploy/.ssh/id_ed25519"`. A relative path resolves against the VPL file, like `filename`. It applies to this source alone and overrides `--ssh-identity` and `VERSATILES_SSH_IDENTITY`, which apply to every source — so one pipeline can read from two SFTP hosts that need different keys. Ignored for other schemes. Note that naming a key makes the VPL file specific to machines that have it. */
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
- /** Filename of the CSV file (relative to the VPL file path). */
138
+ /** Path to the CSV file. */
119
139
  filename: string;
120
- /** Header column name holding the longitude (degrees, WGS84). Required. */
140
+ /** Column holding the longitude, in WGS84 degrees. */
121
141
  lonColumn: string;
122
- /** Header column name holding the latitude (degrees, WGS84). Required. */
142
+ /** Column holding the latitude, in WGS84 degrees. */
123
143
  latColumn: string;
124
- /** Optional column to expose as the MVT feature `id` (numeric if it parses as `u64`, else string). */
144
+ /** Column to expose as the feature id. Defaults to emitting no id. */
125
145
  idColumn?: string;
126
- /** Field delimiter as a single ASCII character. Defaults to `,`. */
146
+ /**
147
+ * Character separating a row's fields. Defaults to `,`.
148
+ *
149
+ * @default ,
150
+ */
127
151
  delimiter?: string;
128
- /** Whether row 1 contains column names. Defaults to `true`. Header-less CSVs aren't supported in v1. */
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 MVT layer in the output tiles. Defaults to the filename stem. */
158
+ /** Name of the layer to write into. Defaults to the file's stem. */
131
159
  layerName?: string;
132
- /** Lowest zoom level emitted (default 0). */
160
+ /**
161
+ * Lowest zoom level to emit. Defaults to `0`.
162
+ *
163
+ * @default 0
164
+ */
133
165
  minZoom?: number;
134
- /** Highest zoom level emitted. Defaults to an auto-heuristic (median feature size ≈ 4 tile-pixels, capped at 14). For point-only inputs the heuristic returns 14. */
166
+ /** Highest zoom level to emit. Defaults to a heuristic capped at `14`. */
135
167
  maxZoom?: number;
136
- /** Bounding-box clip in degrees `[w, s, e, n]`. Not supported in v1; setting this errors out. */
168
+ /** Area to restrict the output to, in WGS84 degrees. Defaults to the input's extent. */
137
169
  bbox?: [number, number, number, number];
138
- /** Property whitelist: keep only the named columns as feature properties, drop everything else. Mutually exclusive with `properties_exclude`. (`lon_column` / `lat_column` / `id_column` are consumed earlier by the CSV adapter and aren't affected.) */
170
+ /** Columns to keep as properties. Mutually exclusive with `properties_exclude`. Defaults to all. */
139
171
  propertiesInclude?: unknown;
140
- /** Property blacklist: drop the named properties, keep everything else. Mutually exclusive with `properties_include`. */
172
+ /** Columns to drop. Mutually exclusive with `properties_include`. Defaults to none. */
141
173
  propertiesExclude?: unknown;
142
- /** Point reduction strategy: `none` / `drop_rate` / `min_distance` (default `min_distance`). */
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
- /** Numeric value whose meaning depends on `point_reduction`: - `min_distance` (default): minimum distance between kept points, in tile-pixels at the current zoom. Defaults to 16. - `drop_rate`: per-zoom keep-fraction in `[0, 1]`. Defaults to 0.5. - `none`: ignored. */
180
+ /** Distance in tile-pixels for `min_distance`, keep-fraction for `drop_rate`. Defaults to `16`/`0.5`. */
145
181
  pointReductionValue?: number;
146
- /** Tile-compression applied before the tiles leave this operation: `gzip` (default), `brotli`, `zstd`, or `none`. */
182
+ /**
183
+ * Compression applied before the tiles leave. Defaults to `gzip`.
184
+ *
185
+ * @default gzip
186
+ */
147
187
  compression?: "none" | "gzip" | "brotli" | "zstd";
148
- /** Maximum encoded tile size in bytes before a tile is considered broken and dropped (streaming path) / errors out (single-tile path). Defaults to 1048576 (1 MiB). Raise it when a legitimate low-zoom tile exceeds the default (e.g. `max_tile_bytes=2097152` for 2 MiB), or set `max_tile_bytes=none` to emit tiles at any size. The soft-cap warning threshold (200 KB at the default cap) scales with this value. */
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
- /** Target tile format: one of `"mvt"` (default), `"avif"`, `"jpg"`, `"png"` or `"webp"` */
153
- format?: "avif" | "bin" | "geojson" | "jpg" | "json" | "mvt" | "png" | "svg" | "topojson" | "webp";
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
- /** Filename of the input (relative to the VPL file path). Format is detected from the extension: - `.geojson` / `.json` — GeoJSON `FeatureCollection` - `.ndjson` / `.geojsonl` / `.ndgeojson` / `.geojsonseq` — line-delimited GeoJSON (one feature per line; `.geojsonseq` may use the RFC 8142 record-separator prefix `U+001E`) - `.shp` — Esri Shapefile */
204
+ /** Path to the input file; its format comes from the extension. */
157
205
  filename: string;
158
- /** Name of the MVT layer in the output tiles. Defaults to the filename stem. */
206
+ /** Name of the layer to write into. Defaults to the file's stem. */
159
207
  layerName?: string;
160
- /** Lowest zoom level emitted (default 0). */
208
+ /**
209
+ * Lowest zoom level to emit. Defaults to `0`.
210
+ *
211
+ * @default 0
212
+ */
161
213
  minZoom?: number;
162
- /** Highest zoom level emitted. Defaults to an auto-heuristic (median feature size ≈ 4 tile-pixels, capped at 14). */
214
+ /** Highest zoom level to emit. Defaults to a heuristic capped at `14`. */
163
215
  maxZoom?: number;
164
- /** Bounding-box clip in degrees `[w, s, e, n]`. Not supported in v1; setting this errors out. */
216
+ /** Area to restrict the output to, in WGS84 degrees. Defaults to the input's extent. */
165
217
  bbox?: [number, number, number, number];
166
- /** Property whitelist: keep only the named properties, drop everything else. Mutually exclusive with `properties_exclude`. */
218
+ /** Properties to keep. Mutually exclusive with `properties_exclude`. Defaults to all. */
167
219
  propertiesInclude?: unknown;
168
- /** Property blacklist: drop the named properties, keep everything else. Mutually exclusive with `properties_include`. */
220
+ /** Properties to drop. Mutually exclusive with `properties_include`. Defaults to none. */
169
221
  propertiesExclude?: unknown;
170
- /** Drop polygons whose area is below this many tile-pixels² (default 4). */
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
- /** Douglas-Peucker tolerance for polygons, in tile-pixels (default 4). */
228
+ /**
229
+ * Douglas-Peucker tolerance for polygons, in tile-pixels. Defaults to `4`.
230
+ *
231
+ * @default 4
232
+ */
173
233
  polygonSimplify?: number;
174
- /** Drop lines whose length is below this many tile-pixels (default 4). */
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
- /** Douglas-Peucker tolerance for lines, in tile-pixels (default 4). */
240
+ /**
241
+ * Douglas-Peucker tolerance for lines, in tile-pixels. Defaults to `4`.
242
+ *
243
+ * @default 4
244
+ */
177
245
  lineSimplify?: number;
178
- /** Point reduction strategy: `none` / `drop_rate` / `min_distance` (default `min_distance`). */
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
- /** Numeric value whose meaning depends on `point_reduction`: - `min_distance` (default): minimum distance between kept points, in tile-pixels at the current zoom. Defaults to 16. - `drop_rate`: per-zoom keep-fraction in `[0, 1]`. Defaults to 0.5. - `none`: ignored. */
252
+ /** Distance in tile-pixels for `min_distance`, keep-fraction for `drop_rate`. Defaults to `16`/`0.5`. */
181
253
  pointReductionValue?: number;
182
- /** Tile-compression applied before the tiles leave this operation: `gzip` (default), `brotli`, `zstd`, or `none`. */
254
+ /**
255
+ * Compression applied before the tiles leave. Defaults to `gzip`.
256
+ *
257
+ * @default gzip
258
+ */
183
259
  compression?: "none" | "gzip" | "brotli" | "zstd";
184
- /** Maximum encoded tile size in bytes before a tile is considered broken and dropped (streaming path) / errors out (single-tile path). Defaults to 1048576 (1 MiB). Raise it when a legitimate low-zoom tile exceeds the default (e.g. `max_tile_bytes=2097152` for 2 MiB), or set `max_tile_bytes=none` to emit tiles at any size. The soft-cap warning threshold (200 KB at the default cap) scales with this value. */
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
- /** If `true`, drop the GeoJSON / Shapefile `id` field from every feature before encoding. Useful for sources where the id is a string (e.g. USGS earthquakes — those would be silently dropped at MVT encode anyway, since MVT requires `uint64` ids), or when the id is just noise. Defaults to `false` — keep the id when it's a non-negative integer. */
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. Without GDAL: `3035` (ETRS89-LAEA, what European gridded statistics use), `3857` (web mercator) and `4326` (WGS84 lon/lat). */
274
+ /** EPSG code of the grid's coordinate reference system. */
191
275
  epsg: number;
192
- /** Edge length of a cell, in the CRS's own units — meters for a projected CRS, degrees for `epsg=4326`. For example: `size=1000` for the 1 km grid Eurostat publishes. */
276
+ /** Edge length of a cell, in the CRS's units — meters, or degrees for `epsg=4326`. */
193
277
  size: number;
194
- /** The area to cover, as `[west, south, east, north]` in WGS84 degrees. Required: an unbounded grid has no pyramid to derive, and at most cell sizes it is more tiles than can be written. */
278
+ /** Area to cover, as `[west, south, east, north]` in WGS84 degrees. */
195
279
  bbox: [number, number, number, number];
196
- /** Where the cell with index `(0, 0)` has its lower-left corner, in CRS units. Default: `[0,0]`, which is what published grids align to. */
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
- /** Roughly how many cells one tile may hold. Decides the lowest zoom level this source offers. Default: `1024`. */
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 levels above the derived minimum, since further levels repeat the same cells. */
292
+ /** Highest zoom level to generate. Defaults to three above the derived minimum. */
201
293
  maxZoom?: number;
202
- /** Ready-made id format. Either `"inspire"` (default), which produces `CRS3035RES1000mN2691000E4341000`, or `"geostat"`, which produces `1kmN2689E4337`. */
203
- idPreset?: string;
204
- /** Id format spelled out, for a grid whose publisher uses neither preset. `{x}` and `{y}` are the lower-left corner, each taking an optional divisor and zero-padded width: `E{x/100:04}N{y/100:04}` produces `E0643N4567`, the form Dutch grid statistics use. Overrides `id_preset`. */
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
- /** Name of the string property holding the cell id. Default: `"id"`. */
302
+ /**
303
+ * Property holding the cell id. Defaults to `id`.
304
+ *
305
+ * @default id
306
+ */
207
307
  idField?: string;
208
- /** Names of the number properties holding the lower-left corner. Defaults: `"x"` and `"y"`, mirroring the `X_LLC` / `Y_LLC` columns Eurostat ships beside its ids. */
308
+ /**
309
+ * Property holding the corner's easting. Defaults to `x`.
310
+ *
311
+ * @default x
312
+ */
209
313
  xField?: string;
210
- /** See `x_field`. */
314
+ /**
315
+ * Property holding the corner's northing. Defaults to `y`.
316
+ *
317
+ * @default y
318
+ */
211
319
  yField?: string;
212
- /** How far a cell edge may stray from its true curve, in tile pixels. Only matters for a CRS whose straight lines bend in mercator; in `3857` and `4326` no vertices are added whatever this says. Default: `0.5`. */
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
- /** Name of the layer in the generated tiles. Default: `"grid"`. */
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` (cells of ~4,250,000 km²) to `15` (~0.9 m²). For example: `resolution=8` for cells of roughly 0.7 km². See <https://h3geo.org/docs/core-library/restable/> for the full table. */
334
+ /** H3 resolution, `0` (coarsest) to `15` (finest). */
219
335
  resolution: number;
220
- /** The area to cover, as `[west, south, east, north]` in WGS84 degrees. For example: `bbox=[13.0,52.3,13.8,52.7]` for Berlin. Required: a grid without bounds would be generated for the whole planet, which at most resolutions is more tiles than can be written. */
336
+ /** Area to cover, as `[west, south, east, north]` in WGS84 degrees. */
221
337
  bbox: [number, number, number, number];
222
- /** Roughly how many cells one tile may hold. Decides the lowest zoom level this source offers: below it a single tile would carry more cells than a tile can usefully hold. Default: `1024`. */
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 levels above the derived minimum, since further levels repeat the same cells. */
344
+ /** Highest zoom level to generate. Defaults to three above the derived minimum. */
225
345
  maxZoom?: number;
226
- /** Name of the layer in the generated tiles. Default: `"grid"`. */
346
+ /**
347
+ * Name of the layer to write into. Defaults to `grid`.
348
+ *
349
+ * @default grid
350
+ */
227
351
  layerName?: string;
228
- /** Name of the string property holding the H3 index, e.g. `"8928308280fffff"`. Default: `"h3"`, matching how H3 datasets usually name the column. */
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
- /** The tile format to use for the output tiles. Default: format of the first source. */
233
- format?: "avif" | "bin" | "geojson" | "jpg" | "json" | "mvt" | "png" | "svg" | "topojson" | "webp";
234
- /** Whether to automatically wrap each source with `raster_overscale` so that sources missing native tiles at the requested zoom level still contribute via upscaled tiles. When all sources overlapping a requested bbox are overscaled (none have native data), this operation returns an empty stream. Place a `raster_overscale` *after* `from_stacked_raster` in the pipeline to cover those tiles — it is more efficient to upscale one blended tile than N individual tiles. Default: `false`. */
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
- /** The filename of the tile. Supported formats: png, jpg/jpeg, webp, avif, pbf/mvt. The format is automatically detected from the file extension. */
370
+ /** Path to the tile file; its format comes from the extension. */
239
371
  filename: string;
240
372
  }
241
373
  export interface FromTilejsonOptions {
242
- /** The URL of the TileJSON endpoint. For example: `url="https://example.com/tiles.json"`. */
374
+ /** URL of the TileJSON endpoint. */
243
375
  url: string;
244
- /** Maximum number of retries per tile request (default: 3). */
376
+ /**
377
+ * How often to retry a failed tile request. Defaults to `3`.
378
+ *
379
+ * @default 3
380
+ */
245
381
  maxRetries?: number;
246
- /** Maximum number of concurrent tile requests (default: io_bound concurrency limit). */
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
- /** Bounding box in WGS84: [min lng, min lat, max lng, max lat]. */
386
+ /** Area to keep, in WGS84 degrees. Defaults to the source's own bounds. */
251
387
  bbox?: [number, number, number, number];
252
- /** Ring of extra tiles to keep around `bbox`, in tiles per zoom level. Note that this is the one parameter here that *widens*: every other parameter narrows the tile set, but `bbox_border=2` keeps tiles the bbox alone would have dropped. Those tiles lie outside the crop, so the advertised bounds are extended to cover them and a client actually requests them. This matters wherever a cropped tileset is rendered rather than just stored: without a border, labels and geometry near the edge have no neighbouring tiles to be laid out against. Requires `bbox`; setting it alone is an error rather than a no-op. */
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
- /** minimal zoom level */
394
+ /** Lowest zoom level to keep. Defaults to the source's lowest. */
255
395
  levelMin?: number;
256
- /** maximal zoom level */
396
+ /** Highest zoom level to keep. Defaults to the source's highest. */
257
397
  levelMax?: number;
258
- /** Path to a tile container used as a coordinate allow-list. Only tiles whose coordinates exist in this container are passed through. Accepts the same path/URL syntax as `from_container`. Note: opening the container and building the allow-list requires I/O at pipeline build time. */
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
- /** Geographic bounding box [west, south, east, north]. */
404
+ /** Area covered, as `[west, south, east, north]` in WGS84 degrees. Defaults to the source's. */
265
405
  bounds?: [number, number, number, number];
266
- /** Default center [longitude, latitude, zoom]. */
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
- /** Fill zoom level. */
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 text. */
414
+ /** Name of the tileset. Defaults to the source's. */
275
415
  name?: string;
276
- /** Tile schema, allowed values: "rgb", "rgba", "dem/mapbox", "dem/terrarium", "dem/versatiles", "openmaptiles", "shortbread@1.0", "other", "unknown" */
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
- /** A complete TileJSON document (JSON string) used as the basis for the new metadata. When given, the new metadata starts from this document instead of the source's; the other parameters then override individual fields on top of it. */
418
+ /** Complete TileJSON document, as a JSON string. Defaults to the source's metadata. */
279
419
  tilejson?: string;
280
- /** Path to a file containing a complete TileJSON document, resolved relative to the VPL file. Use instead of `tilejson` to avoid inline JSON quoting. Mutually exclusive with `tilejson`. */
420
+ /** Path to a file holding a complete TileJSON document. Defaults to the source's metadata. */
281
421
  tilejsonFile?: string;
282
- /** A partial TileJSON document (JSON string) merged onto the current metadata. Scalar fields (e.g. `name`, `attribution`) and `vector_layers` overwrite; `bounds` and the zoom range are widened to the union. The individual parameters still take precedence. */
422
+ /** Partial TileJSON document to merge on, as a JSON string. Defaults to merging nothing. */
283
423
  tilejsonUpdate?: string;
284
- /** Path to a file containing a partial TileJSON document, resolved relative to the VPL file. Use instead of `tilejson_update`. Mutually exclusive with `tilejson_update`. */
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. It is parsed and validated against the TileJSON spec before replacing the source's `vector_layers`. */
426
+ /** The `vector_layers` array as a JSON string. Defaults to the source's. */
287
427
  vectorLayers?: string;
288
- /** Path to a file containing the `vector_layers` array as JSON, resolved relative to the VPL file. Use instead of `vector_layers`. Mutually exclusive with `vector_layers`. */
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
- /** Mirror horizontally within each zoom level: `x` becomes `2^z - 1 - x`. No tile scheme uses this on its own; it is what makes the rotations reachable. Defaults to `false`. */
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
- /** Mirror vertically within each zoom level: `y` becomes `2^z - 1 - y`. This is the TMS ↔ XYZ correction. Defaults to `false`. */
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
- /** Exchange the axes: `(x, y)` becomes `(y, x)`, for sources laid out as `z/y/x`. Applied after the flips. Defaults to `false`. */
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
- /** Use this zoom level to build the overview. Defaults to the maximum zoom level of the source. */
452
+ /** Zoom level to build the overview from. Defaults to the source's highest. */
301
453
  level?: number;
302
- /** Override auto-detection of DEM encoding. Values: "mapbox", "terrarium". */
303
- encoding?: string;
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
- /** Allowed elevation error as fraction of pixel ground size. E.g. 0.1 means for a 10 m pixel, allow up to 1 m elevation error. Defaults to 0.1. */
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
- /** Maximum allowed slope change in degrees due to quantization. Defaults to 1.0. */
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
- /** Override auto-detection of DEM encoding. Values: "mapbox", "terrarium". */
311
- encoding?: string;
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. Must be 256 or 512. */
315
- tileSize?: number;
316
- /** Override auto-detection of DEM encoding. Values: "mapbox", "terrarium". */
317
- encoding?: string;
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
- /** background color to use for the flattened tiles, in RGB format. Defaults to white. */
480
+ /** Background colour, as `[r, g, b]`. Defaults to white. */
321
481
  color?: [number, number, number];
322
482
  }
323
483
  export interface RasterFormatOptions {
324
- /** The desired tile format. Allowed values are: AVIF, JPG, PNG or WEBP. If not specified, the source format will be used. */
484
+ /** Format to encode the tiles into. Defaults to the source's. */
325
485
  format?: "avif" | "jpg" | "png" | "webp";
326
- /** Quality level for the tile compression (only AVIF, JPG or WEBP), between 0 (worst) and 100 (lossless). To allow different quality levels for different zoom levels, this can also be a comma-separated list like this: "70,14:50,15:20", where the first value is the default quality, and the other values specify the quality for the specified zoom level (and higher). */
486
+ /** Encoder quality, `0` (worst) to `100` (lossless). Defaults to the encoder's own. */
327
487
  quality?: string;
328
- /** Quality level for translucent (semi-transparent) tiles, using the same zoom-dependent syntax as quality. When set, tiles are checked for opacity: opaque tiles use the normal quality setting, while translucent tiles use this value (typically 100 for lossless). */
488
+ /** Encoder quality for tiles with translucent pixels. Defaults to using `quality` throughout. */
329
489
  qualityTranslucent?: string;
330
- /** Compression effort, between 0 (fastest) and 100 (slowest/best). */
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
- /** Brightness adjustment, between -255 and 255. Defaults to 0.0 (no change). */
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
- /** Contrast adjustment, between 0 and infinity. Defaults to 1.0 (no change). */
500
+ /**
501
+ * Factor applied around mid-grey, above `0`. Defaults to `1.0`.
502
+ *
503
+ * @default 1.0
504
+ */
337
505
  contrast?: number;
338
- /** Gamma adjustment, between 0 and infinity. Defaults to 1.0 (no change). */
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 with Polygon or MultiPolygon geometry. */
514
+ /** Path to a GeoJSON file holding a Polygon or MultiPolygon, in EPSG:4326 lon/lat degrees. */
343
515
  geojson: string;
344
- /** Buffer distance in meters. Positive values expand the mask, negative values shrink it. Default: 0 */
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
- /** Edge blur distance in meters. Creates a soft transition at the mask edge. Default: 0 */
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
- /** Blur falloff function: "linear" or "cosine". Default: "linear" */
349
- blurFunction?: string;
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
- /** The zoom level to use as the source for overscaling. Tiles at this level and below are passed through unchanged. Tiles above this level are generated by extracting and upscaling from this level. Defaults to the maximum zoom level of the source. */
536
+ /** Zoom level to upscale from. Defaults to the source's highest. */
353
537
  levelBase?: number;
354
- /** The maximum zoom level to support. Defaults to 30. Requests above this level will not return tiles. */
538
+ /**
539
+ * Highest zoom level to serve. Defaults to `30`.
540
+ *
541
+ * @default 30
542
+ */
355
543
  levelMax?: number;
356
- /** Enable tile climbing when the expected source tile doesn't exist. When true, the operation will search parent tiles at lower zoom levels until it finds an existing tile, then extract and upscale from there. Defaults to false. */
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
- /** use this zoom level to build the overview. Defaults to the maximum zoom level of the source. */
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. A value of `256` expects source tiles of 512px, which will be split into four 256px output tiles at the next higher zoom level. Level 0 is downscaled instead. A value of `512` expects source tiles measuring 256px, which will be merged into 512px output tiles at the next lower zoom level. */
365
- tileSize?: number;
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, as a VPL array of strings. Features in all other layers are left unchanged. Example: `layer=["poi","place"]`. */
560
+ /** Layers the expression applies to, for example `layer=["poi","place"]`. */
369
561
  layer: unknown;
370
- /** CEL (Common Expression Language) boolean expression. Feature properties are available as `props["key"]`; properties whose names are valid CEL identifiers (letters, digits, underscore) are also exposed as top-level identifiers. Missing keys resolve to null; use `name != null` (for identifier-safe keys) or `has(props.key)` (for any key) for explicit presence checks. See `versatiles help` for a CEL operator cheat-sheet. */
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 from the tiles, e.g. `filter=["pois","ocean"]`. */
566
+ /** Layer names to remove, for example `filter=["pois","ocean"]`. */
375
567
  filter: unknown;
376
- /** If set, inverts the filter logic (i.e., keeps only layers matching the filter). */
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
- /** A regular expression pattern that should match property names to be removed from all features. The property names contain the layer name as a prefix, e.g., `layer_name/property_name`, so an expression like `regex="^layer_name/"` will match all properties of that layer or `regex="/name_.*$"` will match all properties starting with `name_` in all layers. */
576
+ /** Regular expression matched against each property's prefixed name. */
381
577
  regex: string;
382
- /** If set, inverts the filter logic (i.e., keeps only properties matching the filter). */
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
- /** The zoom level to use as the source for overzooming. Tiles at this level and below are passed through unchanged. Tiles above this level are generated by clipping and rescaling features from the corresponding parent tile at this level. Defaults to the maximum zoom level of the source. */
586
+ /** Zoom level to overzoom from. Defaults to the source's highest. */
387
587
  levelBase?: number;
388
- /** The maximum zoom level to support. Defaults to `level_base + 4` (each extra level quadruples the tile count, so 4 levels = 256× — usually the sweet spot before the pyramid becomes unwieldy). Set explicitly if you want to overzoom further. Capped at 30. */
588
+ /** Highest zoom level to serve, capped at `30`. Defaults to `level_base + 4`. */
389
589
  levelMax?: number;
390
- /** Enable tile climbing when the expected source tile doesn't exist. When true, the operation will search parent tiles at lower zoom levels until it finds an existing tile, then clip and rescale from there. Defaults to false. */
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
- /** Clip buffer in tile-extent units, applied to the child tile's sub-region so that features straddling tile boundaries (labels, lines) survive intact. Defaults to 80. */
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
- /** Drop features that cannot be decoded rather than leaving them in place. Defaults to false. */
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/TSV data file: The file must have a header row. Each subsequent row will be matched to vector features using the ID fields. */
612
+ /** Path to the CSV or TSV file, which must have a header row. */
401
613
  dataSourcePath: string;
402
- /** Name of the vector layer to update: Only features in this layer will be modified. Other layers pass through unchanged. */
614
+ /** Name of the layer whose features are updated. */
403
615
  layerName: string;
404
- /** Field name in the vector tiles that contains the feature ID: This field is used to match features with rows in the data source. */
616
+ /** Feature property holding the id to match on. */
405
617
  idFieldTiles: string;
406
- /** Column name in the data source that contains the matching ID: This column is used to look up data for each feature. */
618
+ /** Column in the data file holding the id to match on. */
407
619
  idFieldData: string;
408
- /** If `true`, replaces all existing properties with the data source values. If `false` (default), merges new properties with existing ones. */
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
- /** If `true`, removes features that don't have a matching row in the data source. If `false` (default), non-matching features are kept unchanged. */
626
+ /**
627
+ * Whether to drop features that have no matching row. Defaults to `false`.
628
+ *
629
+ * @default false
630
+ */
411
631
  removeNonMatching?: boolean;
412
- /** If `true`, includes the ID field from the data source in the output properties. If `false` (default), the ID field is excluded from the merged properties. */
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
- /** Field separator character for the data file: Default for `.csv` files is `,` (comma). Default for `.tsv` files is `\t` (tab, auto-detected) */
638
+ /** Character separating a row's fields. Defaults to `,` for `.csv` and a tab for `.tsv`. */
415
639
  fieldSeparator?: string;
416
- /** Decimal separator character for parsing numbers: Default is `.` (US/UK format). Use `,` (comma) e.g. for German/European number format like `1.234,56` */
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 solid-color tiles of the specified size and format. */
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/latitude columns and emits MVT point tiles. */
654
+ /** Reads a CSV file with longitude and latitude columns and emits MVT point tiles. */
427
655
  static fromCsv(options: FromCsvOptions): VPL;
428
- /** Generates debug tiles that display their coordinates as text. */
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 containing the cells of a projected square grid, ready to be joined with data keyed on the cell id. */
660
+ /** Generates vector tiles holding the cells of a projected square grid. */
433
661
  static fromGrid(options: FromGridOptions): VPL;
434
- /** Generates vector tiles containing H3 grid cells, ready to be joined with data keyed on the H3 index. */
662
+ /** Generates vector tiles holding H3 hexagons. */
435
663
  static fromH3(options: FromH3Options): VPL;
436
- /** Merges multiple vector tile sources. Each resulting tile will contain all the features and properties from all the sources. */
664
+ /** Merges several vector tile sources into one, keeping every feature. */
437
665
  static fromMergedVector(sources: VPL[]): VPL;
438
- /** Overlays multiple raster tile sources on top of each other. */
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 multiple tile sources, using the tile from the first source that provides it. */
668
+ /** Overlays several tile sources, taking each tile from the first source that has it. */
441
669
  static fromStacked(sources: VPL[]): VPL;
442
- /** Reads a single tile file and uses it as a template for all tile requests. */
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 via a TileJSON endpoint. The TileJSON is fetched from the given URL, and tiles are loaded individually using the URL template from the TileJSON `tiles` array. */
672
+ /** Reads tiles from a remote tile server described by a TileJSON endpoint. */
445
673
  static fromTilejson(options: FromTilejsonOptions): VPL;
446
- /** Filter tiles by bounding box, zoom levels, and/or the tile coordinates present in another container. */
674
+ /** Filters tiles by bounding box, zoom range, or the coordinates present in another container. */
447
675
  filter(options?: FilterOptions): VPL;
448
- /** Update metadata, see also <https://github.com/mapbox/tilejson-spec/tree/master/3.0.0> */
676
+ /** Overwrites fields of the source's TileJSON metadata. */
449
677
  metaUpdate(options?: MetaUpdateOptions): VPL;
450
- /** Relabels tile coordinates, e.g. to correct a source that uses TMS row order or `z/y/x` paths. */
678
+ /** Relabels tile coordinates, correcting a source that uses TMS row order or `z/y/x` paths. */
451
679
  remapCoords(options?: RemapCoordsOptions): VPL;
452
- /** Generate lower-zoom DEM overview tiles by averaging 24-bit elevation values. */
680
+ /** Generates lower-zoom DEM overview tiles by averaging 24-bit elevation values. */
453
681
  demOverview(options?: DemOverviewOptions): VPL;
454
- /** Quantize DEM (elevation) raster tiles by rounding to a per-tile power-of-two step. */
682
+ /** Quantizes DEM raster tiles by rounding elevations to a per-tile power-of-two step. */
455
683
  demQuantize(options?: DemQuantizeOptions): VPL;
456
- /** Convert DEM tile size between 256px and 512px by splitting or merging tiles. */
457
- demTileResize(options?: DemTileResizeOptions): VPL;
458
- /** Flattens (translucent) raster tiles onto a background */
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
- /** Convert raster tiles to a different image format and/or adjust quality/effort settings. */
688
+ /** Re-encodes raster tiles into another image format, quality or effort setting. */
461
689
  rasterFormat(options?: RasterFormatOptions): VPL;
462
- /** Adjust brightness, contrast and gamma of raster tiles. */
690
+ /** Adjusts the brightness, contrast and gamma of raster tiles. */
463
691
  rasterLevels(options?: RasterLevelsOptions): VPL;
464
- /** Apply a polygon mask from GeoJSON to raster tiles. Pixels outside the polygon become transparent. */
692
+ /** Makes raster pixels outside a GeoJSON polygon transparent. */
465
693
  rasterMask(options: RasterMaskOptions): VPL;
466
- /** Raster overscale operation - generates tiles beyond the source's native resolution. */
694
+ /** Serves raster tiles above the source's native resolution by upscaling. */
467
695
  rasterOverscale(options?: RasterOverscaleOptions): VPL;
468
- /** Generate lower-zoom overview tiles by downscaling from a base zoom level. */
696
+ /** Generates the lower zoom levels of a raster pyramid by downscaling. */
469
697
  rasterOverview(options?: RasterOverviewOptions): VPL;
470
- /** Convert the size of tiles by splitting or merging them to a width of 256px or 512px. */
471
- rasterTileResize(options?: RasterTileResizeOptions): VPL;
472
- /** Drops vector features in selected layers that do not satisfy a boolean CEL expression. Features in layers outside `layer` pass through untouched. */
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
- /** Filters vector tile layers by name. */
702
+ /** Removes whole layers from vector tiles by name. */
475
703
  vectorFilterLayers(options: VectorFilterLayersOptions): VPL;
476
- /** Filters properties based on a regular expressions. */
704
+ /** Removes feature properties from vector tiles by matching their names against a regex. */
477
705
  vectorFilterProperties(options: VectorFilterPropertiesOptions): VPL;
478
- /** Vector overzoom operation - generates vector tiles beyond the source's native max zoom. */
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 to conform to MVT 2.1. */
708
+ /** Repairs vector tiles so that they conform to MVT 2.1. */
481
709
  vectorRepair(options?: VectorRepairOptions): VPL;
482
- /** Arguments for the `vector_update_properties` operation. */
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;