@versatiles/versatiles-rs 3.8.1 → 4.0.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 (7) hide show
  1. package/README.md +4 -4
  2. package/index.cjs +52 -52
  3. package/index.d.ts +11 -11
  4. package/index.js +52 -52
  5. package/package.json +19 -19
  6. package/vpl.d.ts +112 -22
  7. package/vpl.js +102 -13
package/README.md CHANGED
@@ -58,7 +58,7 @@ console.log(`Server running at http://localhost:${server.port}`);
58
58
  ```javascript
59
59
  import { TileSource } from '@versatiles/versatiles-rs';
60
60
 
61
- const source = await TileSource.open('tiles.mbtiles');
61
+ const source = await TileSource.fromPath('tiles.mbtiles');
62
62
 
63
63
  // Get a single tile
64
64
  const tile = await source.getTile(5, 16, 10);
@@ -81,7 +81,7 @@ console.log('Bounds:', tileJSON.bounds);
81
81
  ```javascript
82
82
  import { TileSource } from '@versatiles/versatiles-rs';
83
83
 
84
- const source = await TileSource.open('tiles.mbtiles');
84
+ const source = await TileSource.fromPath('tiles.mbtiles');
85
85
  const sourceType = source.sourceType();
86
86
  const metadata = source.metadata();
87
87
 
@@ -142,7 +142,7 @@ Convert tiles from one format to another.
142
142
 
143
143
  ### `class TileSource`
144
144
 
145
- #### `TileSource.open(path)`
145
+ #### `TileSource.fromPath(path)`
146
146
 
147
147
  Open a tile container.
148
148
 
@@ -152,7 +152,7 @@ Open a tile container.
152
152
 
153
153
  **Returns:** `Promise<TileSource>`
154
154
 
155
- #### `TileSource.fromVpl(vpl, basePath?)`
155
+ #### `TileSource.openVpl(vpl, basePath?)`
156
156
 
157
157
  Create a tile source from VPL (VersaTiles Pipeline Language).
158
158
 
package/index.cjs CHANGED
@@ -77,8 +77,8 @@ function requireNative() {
77
77
  try {
78
78
  const binding = require('@versatiles/versatiles-rs-android-arm64')
79
79
  const bindingPackageVersion = require('@versatiles/versatiles-rs-android-arm64/package.json').version
80
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
80
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
82
  }
83
83
  return binding
84
84
  } catch (e) {
@@ -93,8 +93,8 @@ function requireNative() {
93
93
  try {
94
94
  const binding = require('@versatiles/versatiles-rs-android-arm-eabi')
95
95
  const bindingPackageVersion = require('@versatiles/versatiles-rs-android-arm-eabi/package.json').version
96
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
96
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
98
  }
99
99
  return binding
100
100
  } catch (e) {
@@ -114,8 +114,8 @@ function requireNative() {
114
114
  try {
115
115
  const binding = require('@versatiles/versatiles-rs-win32-x64-gnu')
116
116
  const bindingPackageVersion = require('@versatiles/versatiles-rs-win32-x64-gnu/package.json').version
117
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
117
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
119
  }
120
120
  return binding
121
121
  } catch (e) {
@@ -130,8 +130,8 @@ function requireNative() {
130
130
  try {
131
131
  const binding = require('@versatiles/versatiles-rs-win32-x64-msvc')
132
132
  const bindingPackageVersion = require('@versatiles/versatiles-rs-win32-x64-msvc/package.json').version
133
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
135
  }
136
136
  return binding
137
137
  } catch (e) {
@@ -147,8 +147,8 @@ function requireNative() {
147
147
  try {
148
148
  const binding = require('@versatiles/versatiles-rs-win32-ia32-msvc')
149
149
  const bindingPackageVersion = require('@versatiles/versatiles-rs-win32-ia32-msvc/package.json').version
150
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
150
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
152
  }
153
153
  return binding
154
154
  } catch (e) {
@@ -163,8 +163,8 @@ function requireNative() {
163
163
  try {
164
164
  const binding = require('@versatiles/versatiles-rs-win32-arm64-msvc')
165
165
  const bindingPackageVersion = require('@versatiles/versatiles-rs-win32-arm64-msvc/package.json').version
166
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
166
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
168
  }
169
169
  return binding
170
170
  } catch (e) {
@@ -182,8 +182,8 @@ function requireNative() {
182
182
  try {
183
183
  const binding = require('@versatiles/versatiles-rs-darwin-universal')
184
184
  const bindingPackageVersion = require('@versatiles/versatiles-rs-darwin-universal/package.json').version
185
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
185
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
187
  }
188
188
  return binding
189
189
  } catch (e) {
@@ -198,8 +198,8 @@ function requireNative() {
198
198
  try {
199
199
  const binding = require('@versatiles/versatiles-rs-darwin-x64')
200
200
  const bindingPackageVersion = require('@versatiles/versatiles-rs-darwin-x64/package.json').version
201
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
201
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
203
  }
204
204
  return binding
205
205
  } catch (e) {
@@ -214,8 +214,8 @@ function requireNative() {
214
214
  try {
215
215
  const binding = require('@versatiles/versatiles-rs-darwin-arm64')
216
216
  const bindingPackageVersion = require('@versatiles/versatiles-rs-darwin-arm64/package.json').version
217
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
217
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
219
  }
220
220
  return binding
221
221
  } catch (e) {
@@ -234,8 +234,8 @@ function requireNative() {
234
234
  try {
235
235
  const binding = require('@versatiles/versatiles-rs-freebsd-x64')
236
236
  const bindingPackageVersion = require('@versatiles/versatiles-rs-freebsd-x64/package.json').version
237
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
237
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
239
  }
240
240
  return binding
241
241
  } catch (e) {
@@ -250,8 +250,8 @@ function requireNative() {
250
250
  try {
251
251
  const binding = require('@versatiles/versatiles-rs-freebsd-arm64')
252
252
  const bindingPackageVersion = require('@versatiles/versatiles-rs-freebsd-arm64/package.json').version
253
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
253
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
255
  }
256
256
  return binding
257
257
  } catch (e) {
@@ -271,8 +271,8 @@ function requireNative() {
271
271
  try {
272
272
  const binding = require('@versatiles/versatiles-rs-linux-x64-musl')
273
273
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-x64-musl/package.json').version
274
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
274
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
276
  }
277
277
  return binding
278
278
  } catch (e) {
@@ -287,8 +287,8 @@ function requireNative() {
287
287
  try {
288
288
  const binding = require('@versatiles/versatiles-rs-linux-x64-gnu')
289
289
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-x64-gnu/package.json').version
290
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
290
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
292
292
  }
293
293
  return binding
294
294
  } catch (e) {
@@ -305,8 +305,8 @@ function requireNative() {
305
305
  try {
306
306
  const binding = require('@versatiles/versatiles-rs-linux-arm64-musl')
307
307
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-arm64-musl/package.json').version
308
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
310
  }
311
311
  return binding
312
312
  } catch (e) {
@@ -321,8 +321,8 @@ function requireNative() {
321
321
  try {
322
322
  const binding = require('@versatiles/versatiles-rs-linux-arm64-gnu')
323
323
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-arm64-gnu/package.json').version
324
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
326
326
  }
327
327
  return binding
328
328
  } catch (e) {
@@ -339,8 +339,8 @@ function requireNative() {
339
339
  try {
340
340
  const binding = require('@versatiles/versatiles-rs-linux-arm-musleabihf')
341
341
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-arm-musleabihf/package.json').version
342
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
344
  }
345
345
  return binding
346
346
  } catch (e) {
@@ -355,8 +355,8 @@ function requireNative() {
355
355
  try {
356
356
  const binding = require('@versatiles/versatiles-rs-linux-arm-gnueabihf')
357
357
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-arm-gnueabihf/package.json').version
358
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
360
360
  }
361
361
  return binding
362
362
  } catch (e) {
@@ -373,8 +373,8 @@ function requireNative() {
373
373
  try {
374
374
  const binding = require('@versatiles/versatiles-rs-linux-loong64-musl')
375
375
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-loong64-musl/package.json').version
376
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
378
  }
379
379
  return binding
380
380
  } catch (e) {
@@ -389,8 +389,8 @@ function requireNative() {
389
389
  try {
390
390
  const binding = require('@versatiles/versatiles-rs-linux-loong64-gnu')
391
391
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-loong64-gnu/package.json').version
392
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
394
  }
395
395
  return binding
396
396
  } catch (e) {
@@ -407,8 +407,8 @@ function requireNative() {
407
407
  try {
408
408
  const binding = require('@versatiles/versatiles-rs-linux-riscv64-musl')
409
409
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-riscv64-musl/package.json').version
410
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
412
  }
413
413
  return binding
414
414
  } catch (e) {
@@ -423,8 +423,8 @@ function requireNative() {
423
423
  try {
424
424
  const binding = require('@versatiles/versatiles-rs-linux-riscv64-gnu')
425
425
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-riscv64-gnu/package.json').version
426
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
428
  }
429
429
  return binding
430
430
  } catch (e) {
@@ -440,8 +440,8 @@ function requireNative() {
440
440
  try {
441
441
  const binding = require('@versatiles/versatiles-rs-linux-ppc64-gnu')
442
442
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-ppc64-gnu/package.json').version
443
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
443
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
445
  }
446
446
  return binding
447
447
  } catch (e) {
@@ -456,8 +456,8 @@ function requireNative() {
456
456
  try {
457
457
  const binding = require('@versatiles/versatiles-rs-linux-s390x-gnu')
458
458
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-s390x-gnu/package.json').version
459
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
459
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
461
  }
462
462
  return binding
463
463
  } catch (e) {
@@ -476,8 +476,8 @@ function requireNative() {
476
476
  try {
477
477
  const binding = require('@versatiles/versatiles-rs-openharmony-arm64')
478
478
  const bindingPackageVersion = require('@versatiles/versatiles-rs-openharmony-arm64/package.json').version
479
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
479
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
481
  }
482
482
  return binding
483
483
  } catch (e) {
@@ -492,8 +492,8 @@ function requireNative() {
492
492
  try {
493
493
  const binding = require('@versatiles/versatiles-rs-openharmony-x64')
494
494
  const bindingPackageVersion = require('@versatiles/versatiles-rs-openharmony-x64/package.json').version
495
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
495
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
497
  }
498
498
  return binding
499
499
  } catch (e) {
@@ -508,8 +508,8 @@ function requireNative() {
508
508
  try {
509
509
  const binding = require('@versatiles/versatiles-rs-openharmony-arm')
510
510
  const bindingPackageVersion = require('@versatiles/versatiles-rs-openharmony-arm/package.json').version
511
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
511
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
513
  }
514
514
  return binding
515
515
  } catch (e) {
package/index.d.ts CHANGED
@@ -76,7 +76,7 @@ export declare class SourceType {
76
76
  * # Example
77
77
  *
78
78
  * ```javascript
79
- * const source = await TileSource.open('tiles.mbtiles');
79
+ * const source = await TileSource.fromPath('tiles.mbtiles');
80
80
  * const type = source.sourceType();
81
81
  * console.log(type.uri); // "/path/to/tiles.mbtiles"
82
82
  * ```
@@ -515,13 +515,13 @@ export declare class TileSource {
515
515
  *
516
516
  * ```javascript
517
517
  * // Open local file
518
- * const reader = await ContainerReader.open('tiles.versatiles');
518
+ * const reader = await ContainerReader.from_path('tiles.versatiles');
519
519
  *
520
520
  * // Open remote file
521
- * const reader = await ContainerReader.open('https://example.com/tiles.pmtiles');
521
+ * const reader = await ContainerReader.from_path('https://example.com/tiles.pmtiles');
522
522
  * ```
523
523
  */
524
- static open(path: string): Promise<TileSource>
524
+ static fromPath(path: string): Promise<TileSource>
525
525
  /**
526
526
  * Create a TileSource from a VPL (VersaTiles Pipeline Language) string
527
527
  *
@@ -651,7 +651,7 @@ export declare class TileSource {
651
651
  * # Examples
652
652
  *
653
653
  * ```javascript
654
- * const source = await TileSource.open('input.mbtiles');
654
+ * const source = await TileSource.fromPath('input.mbtiles');
655
655
  *
656
656
  * // Simple conversion
657
657
  * await source.convertTo('output.versatiles');
@@ -991,7 +991,7 @@ export interface ProbeResult {
991
991
  /** Container type (e.g., "mbtiles", "versatiles") */
992
992
  containerName: string
993
993
  /** TileJSON metadata as JSON string */
994
- tileJson: string
994
+ tileJsonRaw: string
995
995
  /** Reader parameters */
996
996
  parameters: SourceMetadata
997
997
  }
@@ -1048,18 +1048,18 @@ export interface ProgressData {
1048
1048
  * Estimated completion time as JavaScript Date
1049
1049
  *
1050
1050
  * Timestamp in milliseconds since UNIX epoch (January 1, 1970).
1051
- * Can be converted to a JavaScript Date object with `new Date(eta)`.
1051
+ * Can be converted to a JavaScript Date object with `new Date(eta_timestamp)`.
1052
1052
  * Returns `null` if insufficient data to estimate.
1053
1053
  *
1054
1054
  * **Example:**
1055
1055
  * ```javascript
1056
- * if (progress.eta) {
1057
- * const completionTime = new Date(progress.eta);
1056
+ * if (progress.eta_timestamp) {
1057
+ * const completionTime = new Date(progress.eta_timestamp);
1058
1058
  * console.log(`Expected completion: ${completionTime.toLocaleTimeString()}`);
1059
1059
  * }
1060
1060
  * ```
1061
1061
  */
1062
- eta?: number
1062
+ etaTimestamp?: number
1063
1063
  /**
1064
1064
  * Current operation step or status message
1065
1065
  *
@@ -1172,7 +1172,7 @@ export interface SourceMetadata {
1172
1172
  }
1173
1173
 
1174
1174
  export interface TileJSON {
1175
- tilejson: string
1175
+ version: string
1176
1176
  minzoom: number
1177
1177
  maxzoom: number
1178
1178
  /** Geographic bounding box. If `Some`, `[west, south, east, north]`. */
package/index.js CHANGED
@@ -81,8 +81,8 @@ function requireNative() {
81
81
  try {
82
82
  const binding = require('@versatiles/versatiles-rs-android-arm64')
83
83
  const bindingPackageVersion = require('@versatiles/versatiles-rs-android-arm64/package.json').version
84
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
85
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
84
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
85
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
86
86
  }
87
87
  return binding
88
88
  } catch (e) {
@@ -97,8 +97,8 @@ function requireNative() {
97
97
  try {
98
98
  const binding = require('@versatiles/versatiles-rs-android-arm-eabi')
99
99
  const bindingPackageVersion = require('@versatiles/versatiles-rs-android-arm-eabi/package.json').version
100
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
101
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
100
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
101
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
102
102
  }
103
103
  return binding
104
104
  } catch (e) {
@@ -118,8 +118,8 @@ function requireNative() {
118
118
  try {
119
119
  const binding = require('@versatiles/versatiles-rs-win32-x64-gnu')
120
120
  const bindingPackageVersion = require('@versatiles/versatiles-rs-win32-x64-gnu/package.json').version
121
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
122
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
121
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
122
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
123
123
  }
124
124
  return binding
125
125
  } catch (e) {
@@ -134,8 +134,8 @@ function requireNative() {
134
134
  try {
135
135
  const binding = require('@versatiles/versatiles-rs-win32-x64-msvc')
136
136
  const bindingPackageVersion = require('@versatiles/versatiles-rs-win32-x64-msvc/package.json').version
137
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
138
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
137
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
138
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
139
139
  }
140
140
  return binding
141
141
  } catch (e) {
@@ -151,8 +151,8 @@ function requireNative() {
151
151
  try {
152
152
  const binding = require('@versatiles/versatiles-rs-win32-ia32-msvc')
153
153
  const bindingPackageVersion = require('@versatiles/versatiles-rs-win32-ia32-msvc/package.json').version
154
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
155
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
154
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
155
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
156
156
  }
157
157
  return binding
158
158
  } catch (e) {
@@ -167,8 +167,8 @@ function requireNative() {
167
167
  try {
168
168
  const binding = require('@versatiles/versatiles-rs-win32-arm64-msvc')
169
169
  const bindingPackageVersion = require('@versatiles/versatiles-rs-win32-arm64-msvc/package.json').version
170
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
171
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
170
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
171
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
172
172
  }
173
173
  return binding
174
174
  } catch (e) {
@@ -186,8 +186,8 @@ function requireNative() {
186
186
  try {
187
187
  const binding = require('@versatiles/versatiles-rs-darwin-universal')
188
188
  const bindingPackageVersion = require('@versatiles/versatiles-rs-darwin-universal/package.json').version
189
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
190
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
189
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
190
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
191
191
  }
192
192
  return binding
193
193
  } catch (e) {
@@ -202,8 +202,8 @@ function requireNative() {
202
202
  try {
203
203
  const binding = require('@versatiles/versatiles-rs-darwin-x64')
204
204
  const bindingPackageVersion = require('@versatiles/versatiles-rs-darwin-x64/package.json').version
205
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
206
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
205
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
206
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
207
207
  }
208
208
  return binding
209
209
  } catch (e) {
@@ -218,8 +218,8 @@ function requireNative() {
218
218
  try {
219
219
  const binding = require('@versatiles/versatiles-rs-darwin-arm64')
220
220
  const bindingPackageVersion = require('@versatiles/versatiles-rs-darwin-arm64/package.json').version
221
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
222
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
221
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
222
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
223
223
  }
224
224
  return binding
225
225
  } catch (e) {
@@ -238,8 +238,8 @@ function requireNative() {
238
238
  try {
239
239
  const binding = require('@versatiles/versatiles-rs-freebsd-x64')
240
240
  const bindingPackageVersion = require('@versatiles/versatiles-rs-freebsd-x64/package.json').version
241
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
242
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
241
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
242
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
243
243
  }
244
244
  return binding
245
245
  } catch (e) {
@@ -254,8 +254,8 @@ function requireNative() {
254
254
  try {
255
255
  const binding = require('@versatiles/versatiles-rs-freebsd-arm64')
256
256
  const bindingPackageVersion = require('@versatiles/versatiles-rs-freebsd-arm64/package.json').version
257
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
258
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
257
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
258
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
259
259
  }
260
260
  return binding
261
261
  } catch (e) {
@@ -275,8 +275,8 @@ function requireNative() {
275
275
  try {
276
276
  const binding = require('@versatiles/versatiles-rs-linux-x64-musl')
277
277
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-x64-musl/package.json').version
278
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
279
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
278
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
279
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
280
280
  }
281
281
  return binding
282
282
  } catch (e) {
@@ -291,8 +291,8 @@ function requireNative() {
291
291
  try {
292
292
  const binding = require('@versatiles/versatiles-rs-linux-x64-gnu')
293
293
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-x64-gnu/package.json').version
294
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
295
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
294
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
295
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
296
296
  }
297
297
  return binding
298
298
  } catch (e) {
@@ -309,8 +309,8 @@ function requireNative() {
309
309
  try {
310
310
  const binding = require('@versatiles/versatiles-rs-linux-arm64-musl')
311
311
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-arm64-musl/package.json').version
312
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
313
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
312
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
313
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
314
314
  }
315
315
  return binding
316
316
  } catch (e) {
@@ -325,8 +325,8 @@ function requireNative() {
325
325
  try {
326
326
  const binding = require('@versatiles/versatiles-rs-linux-arm64-gnu')
327
327
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-arm64-gnu/package.json').version
328
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
329
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
328
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
329
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
330
330
  }
331
331
  return binding
332
332
  } catch (e) {
@@ -343,8 +343,8 @@ function requireNative() {
343
343
  try {
344
344
  const binding = require('@versatiles/versatiles-rs-linux-arm-musleabihf')
345
345
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-arm-musleabihf/package.json').version
346
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
347
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
346
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
347
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
348
348
  }
349
349
  return binding
350
350
  } catch (e) {
@@ -359,8 +359,8 @@ function requireNative() {
359
359
  try {
360
360
  const binding = require('@versatiles/versatiles-rs-linux-arm-gnueabihf')
361
361
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-arm-gnueabihf/package.json').version
362
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
363
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
362
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
363
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
364
364
  }
365
365
  return binding
366
366
  } catch (e) {
@@ -377,8 +377,8 @@ function requireNative() {
377
377
  try {
378
378
  const binding = require('@versatiles/versatiles-rs-linux-loong64-musl')
379
379
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-loong64-musl/package.json').version
380
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
381
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
380
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
381
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
382
382
  }
383
383
  return binding
384
384
  } catch (e) {
@@ -393,8 +393,8 @@ function requireNative() {
393
393
  try {
394
394
  const binding = require('@versatiles/versatiles-rs-linux-loong64-gnu')
395
395
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-loong64-gnu/package.json').version
396
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
397
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
396
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
397
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
398
398
  }
399
399
  return binding
400
400
  } catch (e) {
@@ -411,8 +411,8 @@ function requireNative() {
411
411
  try {
412
412
  const binding = require('@versatiles/versatiles-rs-linux-riscv64-musl')
413
413
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-riscv64-musl/package.json').version
414
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
415
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
414
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
415
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
416
416
  }
417
417
  return binding
418
418
  } catch (e) {
@@ -427,8 +427,8 @@ function requireNative() {
427
427
  try {
428
428
  const binding = require('@versatiles/versatiles-rs-linux-riscv64-gnu')
429
429
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-riscv64-gnu/package.json').version
430
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
431
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
430
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
431
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
432
432
  }
433
433
  return binding
434
434
  } catch (e) {
@@ -444,8 +444,8 @@ function requireNative() {
444
444
  try {
445
445
  const binding = require('@versatiles/versatiles-rs-linux-ppc64-gnu')
446
446
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-ppc64-gnu/package.json').version
447
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
448
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
447
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
448
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
449
449
  }
450
450
  return binding
451
451
  } catch (e) {
@@ -460,8 +460,8 @@ function requireNative() {
460
460
  try {
461
461
  const binding = require('@versatiles/versatiles-rs-linux-s390x-gnu')
462
462
  const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-s390x-gnu/package.json').version
463
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
464
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
463
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
464
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
465
465
  }
466
466
  return binding
467
467
  } catch (e) {
@@ -480,8 +480,8 @@ function requireNative() {
480
480
  try {
481
481
  const binding = require('@versatiles/versatiles-rs-openharmony-arm64')
482
482
  const bindingPackageVersion = require('@versatiles/versatiles-rs-openharmony-arm64/package.json').version
483
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
484
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
483
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
484
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
485
485
  }
486
486
  return binding
487
487
  } catch (e) {
@@ -496,8 +496,8 @@ function requireNative() {
496
496
  try {
497
497
  const binding = require('@versatiles/versatiles-rs-openharmony-x64')
498
498
  const bindingPackageVersion = require('@versatiles/versatiles-rs-openharmony-x64/package.json').version
499
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
500
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
499
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
500
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
501
501
  }
502
502
  return binding
503
503
  } catch (e) {
@@ -512,8 +512,8 @@ function requireNative() {
512
512
  try {
513
513
  const binding = require('@versatiles/versatiles-rs-openharmony-arm')
514
514
  const bindingPackageVersion = require('@versatiles/versatiles-rs-openharmony-arm/package.json').version
515
- if (bindingPackageVersion !== '3.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
516
- throw new Error(`Native binding package version mismatch, expected 3.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
515
+ if (bindingPackageVersion !== '4.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
516
+ throw new Error(`Native binding package version mismatch, expected 4.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
517
517
  }
518
518
  return binding
519
519
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versatiles/versatiles-rs",
3
- "version": "3.8.1",
3
+ "version": "4.0.0",
4
4
  "description": "Node.js bindings for VersaTiles - convert, serve, and process map tiles",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -87,28 +87,28 @@
87
87
  },
88
88
  "devDependencies": {
89
89
  "@eslint/js": "^10.0.1",
90
- "@napi-rs/cli": "^3.5.1",
91
- "@types/node": "^25.4.0",
92
- "@vitest/ui": "^4.0.18",
90
+ "@napi-rs/cli": "^3.6.2",
91
+ "@types/node": "^25.6.0",
92
+ "@vitest/ui": "^4.1.5",
93
93
  "chalk": "^5.6.2",
94
- "eslint": "^10.0.3",
94
+ "eslint": "^10.3.0",
95
95
  "eslint-config-prettier": "^10.1.8",
96
- "npm-check-updates": "^19.6.3",
97
- "prettier": "^3.8.1",
96
+ "npm-check-updates": "^22.1.0",
97
+ "prettier": "^3.8.3",
98
98
  "tsx": "^4.21.0",
99
- "typedoc": "^0.28.17",
100
- "typescript": "^5.9.3",
101
- "typescript-eslint": "^8.57.0",
102
- "vitest": "^4.0.18"
99
+ "typedoc": "^0.28.19",
100
+ "typescript": "^6.0.3",
101
+ "typescript-eslint": "^8.59.2",
102
+ "vitest": "^4.1.5"
103
103
  },
104
104
  "optionalDependencies": {
105
- "@versatiles/versatiles-rs-darwin-arm64": "3.8.1",
106
- "@versatiles/versatiles-rs-darwin-x64": "3.8.1",
107
- "@versatiles/versatiles-rs-linux-arm64-gnu": "3.8.1",
108
- "@versatiles/versatiles-rs-linux-arm64-musl": "3.8.1",
109
- "@versatiles/versatiles-rs-linux-x64-gnu": "3.8.1",
110
- "@versatiles/versatiles-rs-linux-x64-musl": "3.8.1",
111
- "@versatiles/versatiles-rs-win32-arm64-msvc": "3.8.1",
112
- "@versatiles/versatiles-rs-win32-x64-msvc": "3.8.1"
105
+ "@versatiles/versatiles-rs-darwin-arm64": "4.0.0",
106
+ "@versatiles/versatiles-rs-darwin-x64": "4.0.0",
107
+ "@versatiles/versatiles-rs-linux-arm64-gnu": "4.0.0",
108
+ "@versatiles/versatiles-rs-linux-arm64-musl": "4.0.0",
109
+ "@versatiles/versatiles-rs-linux-x64-gnu": "4.0.0",
110
+ "@versatiles/versatiles-rs-linux-x64-musl": "4.0.0",
111
+ "@versatiles/versatiles-rs-win32-arm64-msvc": "4.0.0",
112
+ "@versatiles/versatiles-rs-win32-x64-msvc": "4.0.0"
113
113
  }
114
114
  }
package/vpl.d.ts CHANGED
@@ -5,20 +5,84 @@ export interface FromColorOptions {
5
5
  /** Tile size in pixels (256 or 512). Defaults to 512. */
6
6
  size?: number;
7
7
  /** Tile format: one of "avif", "jpg", "png", or "webp". Defaults to "png". */
8
- format?: string;
8
+ format?: "avif" | "bin" | "geojson" | "jpg" | "json" | "mvt" | "png" | "svg" | "topojson" | "webp";
9
9
  }
10
10
  export interface FromContainerOptions {
11
11
  /** The filename of the tile container (relative to the VPL file path), or a URL (http/https). For example: `filename="world.versatiles"` or `filename="https://example.com/world.versatiles"`. */
12
12
  filename: string;
13
13
  }
14
+ export interface FromCsvOptions {
15
+ /** Filename of the CSV file (relative to the VPL file path). */
16
+ filename: string;
17
+ /** Header column name holding the longitude (degrees, WGS84). Required. */
18
+ lonColumn: string;
19
+ /** Header column name holding the latitude (degrees, WGS84). Required. */
20
+ latColumn: string;
21
+ /** Optional column to expose as the MVT feature `id` (numeric if it parses as `u64`, else string). */
22
+ idColumn?: string;
23
+ /** Field delimiter as a single ASCII character. Defaults to `,`. */
24
+ delimiter?: string;
25
+ /** Whether row 1 contains column names. Defaults to `true`. Header-less CSVs aren't supported in v1. */
26
+ hasHeader?: boolean;
27
+ /** Name of the MVT layer in the output tiles. Defaults to the filename stem. */
28
+ layerName?: string;
29
+ /** Lowest zoom level emitted (default 0). */
30
+ minZoom?: number;
31
+ /** 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. */
32
+ maxZoom?: number;
33
+ /** Bounding-box clip in degrees `[w, s, e, n]`. Not supported in v1; setting this errors out. */
34
+ bbox?: [number, number, number, number];
35
+ /** 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.) */
36
+ propertiesInclude?: unknown;
37
+ /** Property blacklist: drop the named properties, keep everything else. Mutually exclusive with `properties_include`. */
38
+ propertiesExclude?: unknown;
39
+ /** Point reduction strategy: `none` / `drop_rate` / `min_distance` (default `min_distance`). */
40
+ pointReduction?: "none" | "drop_rate" | "min_distance";
41
+ /** 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. */
42
+ pointReductionValue?: number;
43
+ /** Tile-compression applied before the tiles leave this operation: `gzip` (default), `brotli`, `zstd`, or `none`. */
44
+ compression?: "none" | "gzip" | "brotli" | "zstd";
45
+ }
14
46
  export interface FromDebugOptions {
15
47
  /** Target tile format: one of `"mvt"` (default), `"avif"`, `"jpg"`, `"png"` or `"webp"` */
16
- format?: string;
48
+ format?: "avif" | "bin" | "geojson" | "jpg" | "json" | "mvt" | "png" | "svg" | "topojson" | "webp";
49
+ }
50
+ export interface FromGeoOptions {
51
+ /** 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 */
52
+ filename: string;
53
+ /** Name of the MVT layer in the output tiles. Defaults to the filename stem. */
54
+ layerName?: string;
55
+ /** Lowest zoom level emitted (default 0). */
56
+ minZoom?: number;
57
+ /** Highest zoom level emitted. Defaults to an auto-heuristic (median feature size ≈ 4 tile-pixels, capped at 14). */
58
+ maxZoom?: number;
59
+ /** Bounding-box clip in degrees `[w, s, e, n]`. Not supported in v1; setting this errors out. */
60
+ bbox?: [number, number, number, number];
61
+ /** Property whitelist: keep only the named properties, drop everything else. Mutually exclusive with `properties_exclude`. */
62
+ propertiesInclude?: unknown;
63
+ /** Property blacklist: drop the named properties, keep everything else. Mutually exclusive with `properties_include`. */
64
+ propertiesExclude?: unknown;
65
+ /** Drop polygons whose area is below this many tile-pixels² (default 4). */
66
+ polygonMinArea?: number;
67
+ /** Douglas-Peucker tolerance for polygons, in tile-pixels (default 4). */
68
+ polygonSimplify?: number;
69
+ /** Drop lines whose length is below this many tile-pixels (default 4). */
70
+ lineMinLength?: number;
71
+ /** Douglas-Peucker tolerance for lines, in tile-pixels (default 4). */
72
+ lineSimplify?: number;
73
+ /** Point reduction strategy: `none` / `drop_rate` / `min_distance` (default `min_distance`). */
74
+ pointReduction?: "none" | "drop_rate" | "min_distance";
75
+ /** 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. */
76
+ pointReductionValue?: number;
77
+ /** Tile-compression applied before the tiles leave this operation: `gzip` (default), `brotli`, `zstd`, or `none`. */
78
+ compression?: "none" | "gzip" | "brotli" | "zstd";
79
+ /** 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. */
80
+ ignoreId?: boolean;
17
81
  }
18
82
  export interface FromStackedRasterOptions {
19
83
  /** The tile format to use for the output tiles. Default: format of the first source. */
20
- format?: string;
21
- /** Whether to automatically overscale tiles when a source does not provide tiles at the requested zoom level. Default: `false`. */
84
+ format?: "avif" | "bin" | "geojson" | "jpg" | "json" | "mvt" | "png" | "svg" | "topojson" | "webp";
85
+ /** 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`. */
22
86
  autoOverscale?: boolean;
23
87
  }
24
88
  export interface FromTileOptions {
@@ -40,6 +104,8 @@ export interface FilterOptions {
40
104
  levelMin?: number;
41
105
  /** maximal zoom level */
42
106
  levelMax?: number;
107
+ /** 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. */
108
+ filename?: string;
43
109
  }
44
110
  export interface MetaUpdateOptions {
45
111
  /** Attribution text. */
@@ -57,21 +123,25 @@ export interface MetaUpdateOptions {
57
123
  /** Name text. */
58
124
  name?: string;
59
125
  /** Tile schema, allowed values: "rgb", "rgba", "dem/mapbox", "dem/terrarium", "dem/versatiles", "openmaptiles", "shortbread@1.0", "other", "unknown" */
60
- schema?: string;
126
+ schema?: "rgb" | "rgba" | "dem/mapbox" | "dem/terrarium" | "dem/versatiles" | "openmaptiles" | "shortbread@1.0" | "other";
61
127
  }
62
128
  export interface DemOverviewOptions {
63
129
  /** Use this zoom level to build the overview. Defaults to the maximum zoom level of the source. */
64
130
  level?: number;
65
- /** Size of the tiles in pixels. Defaults to 512. */
66
- tileSize?: number;
67
131
  /** Override auto-detection of DEM encoding. Values: "mapbox", "terrarium". */
68
132
  encoding?: string;
69
133
  }
70
134
  export interface DemQuantizeOptions {
71
- /** Minimum elevation resolution as fraction of tile ground size. E.g. 0.001 means for a 1000 m tile, keep 1 m resolution. Defaults to 0.001. */
72
- resolutionRatio?: number;
73
- /** Maximum allowed gradient change in degrees due to quantization. Defaults to 1.0. */
74
- maxGradientError?: number;
135
+ /** Allowed elevation error as fraction of pixel ground size. E.g. 0.5 means for a 10 m pixel, allow up to 5 m elevation error. Defaults to 0.5. */
136
+ elevationError?: number;
137
+ /** Maximum allowed slope change in degrees due to quantization. Defaults to 1.0. */
138
+ slopeError?: number;
139
+ /** Override auto-detection of DEM encoding. Values: "mapbox", "terrarium". */
140
+ encoding?: string;
141
+ }
142
+ export interface DemTileResizeOptions {
143
+ /** Target tile size in pixels. Must be 256 or 512. */
144
+ tileSize?: number;
75
145
  /** Override auto-detection of DEM encoding. Values: "mapbox", "terrarium". */
76
146
  encoding?: string;
77
147
  }
@@ -81,11 +151,13 @@ export interface RasterFlattenOptions {
81
151
  }
82
152
  export interface RasterFormatOptions {
83
153
  /** The desired tile format. Allowed values are: AVIF, JPG, PNG or WEBP. If not specified, the source format will be used. */
84
- format?: string;
85
- /** 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: "80,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). */
154
+ format?: "avif" | "jpg" | "png" | "webp";
155
+ /** 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). */
86
156
  quality?: string;
87
- /** Compression speed, between 0 (slowest) and 100 (fastest). */
88
- speed?: number;
157
+ /** 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). */
158
+ qualityTranslucent?: string;
159
+ /** Compression effort, between 0 (fastest) and 100 (slowest/best). */
160
+ effort?: number;
89
161
  }
90
162
  export interface RasterLevelsOptions {
91
163
  /** Brightness adjustment, between -255 and 255. Defaults to 0.0 (no change). */
@@ -116,12 +188,20 @@ export interface RasterOverscaleOptions {
116
188
  export interface RasterOverviewOptions {
117
189
  /** use this zoom level to build the overview. Defaults to the maximum zoom level of the source. */
118
190
  level?: number;
119
- /** Size of the tiles in pixels. Defaults to 512. */
191
+ }
192
+ export interface RasterTileResizeOptions {
193
+ /** 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. */
120
194
  tileSize?: number;
121
195
  }
196
+ export interface VectorFilterFeaturesOptions {
197
+ /** Layers the expression applies to, as a VPL array of strings. Features in all other layers are left unchanged. Example: `layer=["poi","place"]`. */
198
+ layer: unknown;
199
+ /** 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. */
200
+ expr: string;
201
+ }
122
202
  export interface VectorFilterLayersOptions {
123
- /** Comma‑separated list of layer names that should be removed from the tiles, e.g.: filter="pois,ocean". */
124
- filter: string;
203
+ /** Layer names to remove from the tiles, e.g. `filter=["pois","ocean"]`. */
204
+ filter: unknown;
125
205
  /** If set, inverts the filter logic (i.e., keeps only layers matching the filter). */
126
206
  invert?: boolean;
127
207
  }
@@ -158,8 +238,12 @@ export declare class VPL {
158
238
  static fromColor(options?: FromColorOptions): VPL;
159
239
  /** Reads a tile container, such as a `*.versatiles`, `*.mbtiles`, `*.pmtiles` or `*.tar` file. */
160
240
  static fromContainer(options: FromContainerOptions): VPL;
241
+ /** Reads a CSV file with longitude/latitude columns and emits MVT point tiles. */
242
+ static fromCsv(options: FromCsvOptions): VPL;
161
243
  /** Generates debug tiles that display their coordinates as text. */
162
244
  static fromDebug(options?: FromDebugOptions): VPL;
245
+ /** Reads a GeoJSON or Shapefile and emits MVT vector tiles. */
246
+ static fromGeo(options: FromGeoOptions): VPL;
163
247
  /** Merges multiple vector tile sources. */
164
248
  static fromMergedVector(sources: VPL[]): VPL;
165
249
  /** Overlays multiple raster tile sources on top of each other. */
@@ -170,7 +254,7 @@ export declare class VPL {
170
254
  static fromTile(options: FromTileOptions): VPL;
171
255
  /** Reads tiles from a remote tile server via a TileJSON endpoint. */
172
256
  static fromTilejson(options: FromTilejsonOptions): VPL;
173
- /** Filter tiles by bounding box and/or zoom levels. */
257
+ /** Filter tiles by bounding box, zoom levels, and/or the tile coordinates present in another container. */
174
258
  filter(options?: FilterOptions): VPL;
175
259
  /** Update metadata, see also <https://github.com/mapbox/tilejson-spec/tree/master/3.0.0> */
176
260
  metaUpdate(options?: MetaUpdateOptions): VPL;
@@ -178,9 +262,11 @@ export declare class VPL {
178
262
  demOverview(options?: DemOverviewOptions): VPL;
179
263
  /** Quantize DEM (elevation) raster tiles by zeroing unnecessary low bits. */
180
264
  demQuantize(options?: DemQuantizeOptions): VPL;
265
+ /** Convert DEM tile size between 256px and 512px by splitting or merging tiles. */
266
+ demTileResize(options?: DemTileResizeOptions): VPL;
181
267
  /** Flattens (translucent) raster tiles onto a background */
182
268
  rasterFlatten(options?: RasterFlattenOptions): VPL;
183
- /** Convert raster tiles to a different image format and/or adjust quality/speed settings. */
269
+ /** Convert raster tiles to a different image format and/or adjust quality/effort settings. */
184
270
  rasterFormat(options?: RasterFormatOptions): VPL;
185
271
  /** Adjust brightness, contrast and gamma of raster tiles. */
186
272
  rasterLevels(options?: RasterLevelsOptions): VPL;
@@ -190,7 +276,11 @@ export declare class VPL {
190
276
  rasterOverscale(options?: RasterOverscaleOptions): VPL;
191
277
  /** Generate lower-zoom overview tiles by downscaling from a base zoom level. */
192
278
  rasterOverview(options?: RasterOverviewOptions): VPL;
193
- /** Filters vector tile layers based on a comma-separated list of layer names. */
279
+ /** Convert the size of tiles by splitting or merging them to a width of 256px or 512px. */
280
+ rasterTileResize(options?: RasterTileResizeOptions): VPL;
281
+ /** Drops vector features in selected layers that do not satisfy a boolean CEL expression. */
282
+ vectorFilterFeatures(options: VectorFilterFeaturesOptions): VPL;
283
+ /** Filters vector tile layers by name. */
194
284
  vectorFilterLayers(options: VectorFilterLayersOptions): VPL;
195
285
  /** Filters properties based on a regular expressions. */
196
286
  vectorFilterProperties(options: VectorFilterPropertiesOptions): VPL;
@@ -201,5 +291,5 @@ export declare class VPL {
201
291
  /** Convert this VPL pipeline to a JSON-serializable array of steps. */
202
292
  toJSON(): object[];
203
293
  /** Execute this VPL pipeline and return a TileSource. */
204
- open(dir?: string): Promise<TileSource>;
294
+ fromPath(dir?: string): Promise<TileSource>;
205
295
  }
package/vpl.js CHANGED
@@ -39,6 +39,38 @@ export class VPL {
39
39
  params['filename'] = options.filename;
40
40
  return new VPL([{ name: 'from_container', params }]);
41
41
  }
42
+ /** Reads a CSV file with longitude/latitude columns and emits MVT point tiles. */
43
+ static fromCsv(options) {
44
+ const params = {};
45
+ params['filename'] = options.filename;
46
+ params['lon_column'] = options.lonColumn;
47
+ params['lat_column'] = options.latColumn;
48
+ if (options.idColumn !== undefined)
49
+ params['id_column'] = options.idColumn;
50
+ if (options.delimiter !== undefined)
51
+ params['delimiter'] = options.delimiter;
52
+ if (options.hasHeader !== undefined)
53
+ params['has_header'] = options.hasHeader;
54
+ if (options.layerName !== undefined)
55
+ params['layer_name'] = options.layerName;
56
+ if (options.minZoom !== undefined)
57
+ params['min_zoom'] = options.minZoom;
58
+ if (options.maxZoom !== undefined)
59
+ params['max_zoom'] = options.maxZoom;
60
+ if (options.bbox !== undefined)
61
+ params['bbox'] = options.bbox;
62
+ if (options.propertiesInclude !== undefined)
63
+ params['properties_include'] = options.propertiesInclude;
64
+ if (options.propertiesExclude !== undefined)
65
+ params['properties_exclude'] = options.propertiesExclude;
66
+ if (options.pointReduction !== undefined)
67
+ params['point_reduction'] = options.pointReduction;
68
+ if (options.pointReductionValue !== undefined)
69
+ params['point_reduction_value'] = options.pointReductionValue;
70
+ if (options.compression !== undefined)
71
+ params['compression'] = options.compression;
72
+ return new VPL([{ name: 'from_csv', params }]);
73
+ }
42
74
  /** Generates debug tiles that display their coordinates as text. */
43
75
  static fromDebug(options) {
44
76
  const params = {};
@@ -46,6 +78,40 @@ export class VPL {
46
78
  params['format'] = options?.format;
47
79
  return new VPL([{ name: 'from_debug', params }]);
48
80
  }
81
+ /** Reads a GeoJSON or Shapefile and emits MVT vector tiles. */
82
+ static fromGeo(options) {
83
+ const params = {};
84
+ params['filename'] = options.filename;
85
+ if (options.layerName !== undefined)
86
+ params['layer_name'] = options.layerName;
87
+ if (options.minZoom !== undefined)
88
+ params['min_zoom'] = options.minZoom;
89
+ if (options.maxZoom !== undefined)
90
+ params['max_zoom'] = options.maxZoom;
91
+ if (options.bbox !== undefined)
92
+ params['bbox'] = options.bbox;
93
+ if (options.propertiesInclude !== undefined)
94
+ params['properties_include'] = options.propertiesInclude;
95
+ if (options.propertiesExclude !== undefined)
96
+ params['properties_exclude'] = options.propertiesExclude;
97
+ if (options.polygonMinArea !== undefined)
98
+ params['polygon_min_area'] = options.polygonMinArea;
99
+ if (options.polygonSimplify !== undefined)
100
+ params['polygon_simplify'] = options.polygonSimplify;
101
+ if (options.lineMinLength !== undefined)
102
+ params['line_min_length'] = options.lineMinLength;
103
+ if (options.lineSimplify !== undefined)
104
+ params['line_simplify'] = options.lineSimplify;
105
+ if (options.pointReduction !== undefined)
106
+ params['point_reduction'] = options.pointReduction;
107
+ if (options.pointReductionValue !== undefined)
108
+ params['point_reduction_value'] = options.pointReductionValue;
109
+ if (options.compression !== undefined)
110
+ params['compression'] = options.compression;
111
+ if (options.ignoreId !== undefined)
112
+ params['ignore_id'] = options.ignoreId;
113
+ return new VPL([{ name: 'from_geo', params }]);
114
+ }
49
115
  /** Merges multiple vector tile sources. */
50
116
  static fromMergedVector(sources) {
51
117
  const params = {};
@@ -81,7 +147,7 @@ export class VPL {
81
147
  params['max_concurrent_requests'] = options.maxConcurrentRequests;
82
148
  return new VPL([{ name: 'from_tilejson', params }]);
83
149
  }
84
- /** Filter tiles by bounding box and/or zoom levels. */
150
+ /** Filter tiles by bounding box, zoom levels, and/or the tile coordinates present in another container. */
85
151
  filter(options) {
86
152
  const params = {};
87
153
  if (options?.bbox !== undefined)
@@ -90,6 +156,8 @@ export class VPL {
90
156
  params['level_min'] = options?.levelMin;
91
157
  if (options?.levelMax !== undefined)
92
158
  params['level_max'] = options?.levelMax;
159
+ if (options?.filename !== undefined)
160
+ params['filename'] = options?.filename;
93
161
  return new VPL([...this.steps, { name: 'filter', params }]);
94
162
  }
95
163
  /** Update metadata, see also <https://github.com/mapbox/tilejson-spec/tree/master/3.0.0> */
@@ -118,8 +186,6 @@ export class VPL {
118
186
  const params = {};
119
187
  if (options?.level !== undefined)
120
188
  params['level'] = options?.level;
121
- if (options?.tileSize !== undefined)
122
- params['tile_size'] = options?.tileSize;
123
189
  if (options?.encoding !== undefined)
124
190
  params['encoding'] = options?.encoding;
125
191
  return new VPL([...this.steps, { name: 'dem_overview', params }]);
@@ -127,14 +193,23 @@ export class VPL {
127
193
  /** Quantize DEM (elevation) raster tiles by zeroing unnecessary low bits. */
128
194
  demQuantize(options) {
129
195
  const params = {};
130
- if (options?.resolutionRatio !== undefined)
131
- params['resolution_ratio'] = options?.resolutionRatio;
132
- if (options?.maxGradientError !== undefined)
133
- params['max_gradient_error'] = options?.maxGradientError;
196
+ if (options?.elevationError !== undefined)
197
+ params['elevation_error'] = options?.elevationError;
198
+ if (options?.slopeError !== undefined)
199
+ params['slope_error'] = options?.slopeError;
134
200
  if (options?.encoding !== undefined)
135
201
  params['encoding'] = options?.encoding;
136
202
  return new VPL([...this.steps, { name: 'dem_quantize', params }]);
137
203
  }
204
+ /** Convert DEM tile size between 256px and 512px by splitting or merging tiles. */
205
+ demTileResize(options) {
206
+ const params = {};
207
+ if (options?.tileSize !== undefined)
208
+ params['tile_size'] = options?.tileSize;
209
+ if (options?.encoding !== undefined)
210
+ params['encoding'] = options?.encoding;
211
+ return new VPL([...this.steps, { name: 'dem_tile_resize', params }]);
212
+ }
138
213
  /** Flattens (translucent) raster tiles onto a background */
139
214
  rasterFlatten(options) {
140
215
  const params = {};
@@ -142,15 +217,17 @@ export class VPL {
142
217
  params['color'] = options?.color;
143
218
  return new VPL([...this.steps, { name: 'raster_flatten', params }]);
144
219
  }
145
- /** Convert raster tiles to a different image format and/or adjust quality/speed settings. */
220
+ /** Convert raster tiles to a different image format and/or adjust quality/effort settings. */
146
221
  rasterFormat(options) {
147
222
  const params = {};
148
223
  if (options?.format !== undefined)
149
224
  params['format'] = options?.format;
150
225
  if (options?.quality !== undefined)
151
226
  params['quality'] = options?.quality;
152
- if (options?.speed !== undefined)
153
- params['speed'] = options?.speed;
227
+ if (options?.qualityTranslucent !== undefined)
228
+ params['quality_translucent'] = options?.qualityTranslucent;
229
+ if (options?.effort !== undefined)
230
+ params['effort'] = options?.effort;
154
231
  return new VPL([...this.steps, { name: 'raster_format', params }]);
155
232
  }
156
233
  /** Adjust brightness, contrast and gamma of raster tiles. */
@@ -192,11 +269,23 @@ export class VPL {
192
269
  const params = {};
193
270
  if (options?.level !== undefined)
194
271
  params['level'] = options?.level;
272
+ return new VPL([...this.steps, { name: 'raster_overview', params }]);
273
+ }
274
+ /** Convert the size of tiles by splitting or merging them to a width of 256px or 512px. */
275
+ rasterTileResize(options) {
276
+ const params = {};
195
277
  if (options?.tileSize !== undefined)
196
278
  params['tile_size'] = options?.tileSize;
197
- return new VPL([...this.steps, { name: 'raster_overview', params }]);
279
+ return new VPL([...this.steps, { name: 'raster_tile_resize', params }]);
280
+ }
281
+ /** Drops vector features in selected layers that do not satisfy a boolean CEL expression. */
282
+ vectorFilterFeatures(options) {
283
+ const params = {};
284
+ params['layer'] = options.layer;
285
+ params['expr'] = options.expr;
286
+ return new VPL([...this.steps, { name: 'vector_filter_features', params }]);
198
287
  }
199
- /** Filters vector tile layers based on a comma-separated list of layer names. */
288
+ /** Filters vector tile layers by name. */
200
289
  vectorFilterLayers(options) {
201
290
  const params = {};
202
291
  params['filter'] = options.filter;
@@ -256,7 +345,7 @@ export class VPL {
256
345
  });
257
346
  }
258
347
  /** Execute this VPL pipeline and return a TileSource. */
259
- async open(dir) {
348
+ async fromPath(dir) {
260
349
  return TileSource.fromPipeline(JSON.stringify(this.toJSON()), dir);
261
350
  }
262
351
  }