@loaders.gl/shapefile 4.2.0-alpha.4 → 4.2.0-alpha.6

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 (49) hide show
  1. package/dist/dbf-loader.js +25 -20
  2. package/dist/dbf-worker.js +14 -7
  3. package/dist/dist.dev.js +219 -232
  4. package/dist/dist.min.js +12 -0
  5. package/dist/index.cjs +74 -75
  6. package/dist/index.cjs.map +7 -0
  7. package/dist/index.d.ts +6 -6
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +1 -1
  10. package/dist/lib/parsers/parse-dbf.d.ts +1 -1
  11. package/dist/lib/parsers/parse-dbf.d.ts.map +1 -1
  12. package/dist/lib/parsers/parse-dbf.js +300 -258
  13. package/dist/lib/parsers/parse-shapefile.d.ts +3 -3
  14. package/dist/lib/parsers/parse-shapefile.d.ts.map +1 -1
  15. package/dist/lib/parsers/parse-shapefile.js +225 -184
  16. package/dist/lib/parsers/parse-shp-geometry.d.ts +1 -1
  17. package/dist/lib/parsers/parse-shp-geometry.d.ts.map +1 -1
  18. package/dist/lib/parsers/parse-shp-geometry.js +260 -168
  19. package/dist/lib/parsers/parse-shp-header.js +33 -23
  20. package/dist/lib/parsers/parse-shp.d.ts +1 -1
  21. package/dist/lib/parsers/parse-shp.d.ts.map +1 -1
  22. package/dist/lib/parsers/parse-shp.js +146 -109
  23. package/dist/lib/parsers/parse-shx.js +19 -15
  24. package/dist/lib/parsers/types.js +0 -1
  25. package/dist/lib/streaming/binary-chunk-reader.js +154 -95
  26. package/dist/lib/streaming/binary-reader.js +51 -23
  27. package/dist/lib/streaming/zip-batch-iterators.js +61 -45
  28. package/dist/shapefile-loader.js +26 -19
  29. package/dist/shp-loader.js +25 -19
  30. package/dist/shp-worker.js +22 -16
  31. package/dist/workers/dbf-worker.js +0 -1
  32. package/dist/workers/shp-worker.js +0 -1
  33. package/package.json +11 -7
  34. package/dist/dbf-loader.js.map +0 -1
  35. package/dist/index.js.map +0 -1
  36. package/dist/lib/parsers/parse-dbf.js.map +0 -1
  37. package/dist/lib/parsers/parse-shapefile.js.map +0 -1
  38. package/dist/lib/parsers/parse-shp-geometry.js.map +0 -1
  39. package/dist/lib/parsers/parse-shp-header.js.map +0 -1
  40. package/dist/lib/parsers/parse-shp.js.map +0 -1
  41. package/dist/lib/parsers/parse-shx.js.map +0 -1
  42. package/dist/lib/parsers/types.js.map +0 -1
  43. package/dist/lib/streaming/binary-chunk-reader.js.map +0 -1
  44. package/dist/lib/streaming/binary-reader.js.map +0 -1
  45. package/dist/lib/streaming/zip-batch-iterators.js.map +0 -1
  46. package/dist/shapefile-loader.js.map +0 -1
  47. package/dist/shp-loader.js.map +0 -1
  48. package/dist/workers/dbf-worker.js.map +0 -1
  49. package/dist/workers/shp-worker.js.map +0 -1
@@ -1,26 +1,31 @@
1
1
  import { parseDBF, parseDBFInBatches } from "./lib/parsers/parse-dbf.js";
2
- const VERSION = typeof "4.2.0-alpha.4" !== 'undefined' ? "4.2.0-alpha.4" : 'latest';
2
+ // __VERSION__ is injected by babel-plugin-version-inline
3
+ // @ts-ignore TS2304: Cannot find name '__VERSION__'.
4
+ const VERSION = typeof "4.2.0-alpha.5" !== 'undefined' ? "4.2.0-alpha.5" : 'latest';
5
+ /**
6
+ * DBFLoader - DBF files are used to contain non-geometry columns in Shapefiles
7
+ */
3
8
  export const DBFWorkerLoader = {
4
- name: 'DBF',
5
- id: 'dbf',
6
- module: 'shapefile',
7
- version: VERSION,
8
- worker: true,
9
- category: 'table',
10
- extensions: ['dbf'],
11
- mimeTypes: ['application/x-dbf'],
12
- options: {
13
- dbf: {
14
- encoding: 'latin1'
9
+ name: 'DBF',
10
+ id: 'dbf',
11
+ module: 'shapefile',
12
+ version: VERSION,
13
+ worker: true,
14
+ category: 'table',
15
+ extensions: ['dbf'],
16
+ mimeTypes: ['application/x-dbf'],
17
+ options: {
18
+ dbf: {
19
+ encoding: 'latin1'
20
+ }
15
21
  }
16
- }
17
22
  };
23
+ /** DBF file loader */
18
24
  export const DBFLoader = {
19
- ...DBFWorkerLoader,
20
- parse: async (arrayBuffer, options) => parseDBF(arrayBuffer, options),
21
- parseSync: parseDBF,
22
- parseInBatches(arrayBufferIterator, options) {
23
- return parseDBFInBatches(arrayBufferIterator, options);
24
- }
25
+ ...DBFWorkerLoader,
26
+ parse: async (arrayBuffer, options) => parseDBF(arrayBuffer, options),
27
+ parseSync: parseDBF,
28
+ parseInBatches(arrayBufferIterator, options) {
29
+ return parseDBFInBatches(arrayBufferIterator, options);
30
+ }
25
31
  };
26
- //# sourceMappingURL=dbf-loader.js.map
@@ -2,6 +2,10 @@
2
2
  (() => {
3
3
  // src/lib/streaming/binary-chunk-reader.ts
4
4
  var BinaryChunkReader = class {
5
+ offset;
6
+ arrayBuffers;
7
+ ended;
8
+ maxRewindBytes;
5
9
  constructor(options) {
6
10
  const { maxRewindBytes = 0 } = options || {};
7
11
  this.offset = 0;
@@ -144,12 +148,13 @@
144
148
  var LITTLE_ENDIAN = true;
145
149
  var DBF_HEADER_SIZE = 32;
146
150
  var DBFParser = class {
151
+ binaryReader = new BinaryChunkReader();
152
+ textDecoder;
153
+ state = 0 /* START */;
154
+ result = {
155
+ data: []
156
+ };
147
157
  constructor(options) {
148
- this.binaryReader = new BinaryChunkReader();
149
- this.state = 0 /* START */;
150
- this.result = {
151
- data: []
152
- };
153
158
  this.textDecoder = new TextDecoder(options.encoding);
154
159
  }
155
160
  /**
@@ -372,7 +377,7 @@
372
377
  }
373
378
 
374
379
  // src/dbf-loader.ts
375
- var VERSION = true ? "4.2.0-alpha.4" : "latest";
380
+ var VERSION = true ? "4.2.0-alpha.5" : "latest";
376
381
  var DBFWorkerLoader = {
377
382
  name: "DBF",
378
383
  id: "dbf",
@@ -456,7 +461,9 @@
456
461
  }
457
462
  getParentPort().then((parentPort2) => {
458
463
  if (parentPort2) {
459
- parentPort2.on("message", handleMessage);
464
+ parentPort2.on("message", (message) => {
465
+ handleMessage(message);
466
+ });
460
467
  parentPort2.on("exit", () => console.debug("Node worker closing"));
461
468
  } else {
462
469
  globalThis.onmessage = handleMessage;