@loaders.gl/shapefile 4.3.2 → 4.4.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dbf-arrow-loader.d.ts +52 -0
- package/dist/dbf-arrow-loader.d.ts.map +1 -0
- package/dist/dbf-arrow-loader.js +32 -0
- package/dist/dbf-format.d.ts +10 -0
- package/dist/dbf-format.d.ts.map +1 -0
- package/dist/dbf-format.js +12 -0
- package/dist/dbf-loader.js +1 -1
- package/dist/dbf-worker.js +1 -1
- package/dist/dist.dev.js +12231 -33
- package/dist/dist.min.js +11 -2
- package/dist/index.cjs +277 -10
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/lib/parsers/parse-dbf-to-arrow.d.ts +26 -0
- package/dist/lib/parsers/parse-dbf-to-arrow.d.ts.map +1 -0
- package/dist/lib/parsers/parse-dbf-to-arrow.js +321 -0
- package/dist/lib/parsers/parse-dbf.d.ts +1 -1
- package/dist/lib/parsers/parse-dbf.d.ts.map +1 -1
- package/dist/lib/parsers/parse-shapefile.js +2 -2
- package/dist/lib/parsers/parse-shp-geometry.d.ts +1 -1
- package/dist/lib/parsers/parse-shp-geometry.d.ts.map +1 -1
- package/dist/lib/parsers/types.d.ts +1 -1
- package/dist/lib/parsers/types.d.ts.map +1 -1
- package/dist/shapefile-loader.d.ts.map +1 -1
- package/dist/shapefile-loader.js +1 -1
- package/dist/shp-loader.js +1 -1
- package/dist/shp-worker.js +1 -1
- package/package.json +6 -6
- package/src/dbf-arrow-loader.ts +46 -0
- package/src/dbf-format.ts +15 -0
- package/src/index.ts +1 -0
- package/src/lib/parsers/parse-dbf-to-arrow.ts +382 -0
- package/src/lib/parsers/parse-dbf.ts +1 -1
- package/src/lib/parsers/parse-shapefile.ts +2 -2
- package/src/lib/parsers/parse-shp-geometry.ts +1 -1
- package/src/lib/parsers/types.ts +1 -1
- package/src/shapefile-loader.ts +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { LoaderOptions } from '@loaders.gl/loader-utils';
|
|
2
|
+
import type { ArrowTable, ArrowTableBatch } from '@loaders.gl/schema';
|
|
3
|
+
import { parseDBF } from "./lib/parsers/parse-dbf-to-arrow.js";
|
|
4
|
+
export type DBFLoaderOptions = LoaderOptions & {
|
|
5
|
+
dbf?: {
|
|
6
|
+
encoding?: string;
|
|
7
|
+
/** Override the URL to the worker bundle (by default loads from unpkg.com) */
|
|
8
|
+
workerUrl?: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* DBFLoader - DBF files are used to contain non-geometry columns in Shapefiles
|
|
13
|
+
*/
|
|
14
|
+
export declare const DBFArrowWorkerLoader: {
|
|
15
|
+
readonly dataType: ArrowTable;
|
|
16
|
+
readonly batchType: ArrowTableBatch;
|
|
17
|
+
readonly version: any;
|
|
18
|
+
readonly worker: true;
|
|
19
|
+
readonly options: {
|
|
20
|
+
readonly dbf: {
|
|
21
|
+
readonly encoding: "latin1";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
readonly name: "DBF";
|
|
25
|
+
readonly id: "dbf";
|
|
26
|
+
readonly module: "shapefile";
|
|
27
|
+
readonly category: "table";
|
|
28
|
+
readonly extensions: ["dbf"];
|
|
29
|
+
readonly mimeTypes: ["application/x-dbf"];
|
|
30
|
+
};
|
|
31
|
+
/** DBF file loader */
|
|
32
|
+
export declare const DBFArrowLoader: {
|
|
33
|
+
readonly parse: (arrayBuffer: ArrayBuffer, options: DBFLoaderOptions | undefined) => Promise<ArrowTable>;
|
|
34
|
+
readonly parseSync: typeof parseDBF;
|
|
35
|
+
readonly parseInBatches: (arrayBufferIterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>, options: DBFLoaderOptions | undefined) => AsyncIterable<ArrowTableBatch>;
|
|
36
|
+
readonly dataType: ArrowTable;
|
|
37
|
+
readonly batchType: ArrowTableBatch;
|
|
38
|
+
readonly version: any;
|
|
39
|
+
readonly worker: true;
|
|
40
|
+
readonly options: {
|
|
41
|
+
readonly dbf: {
|
|
42
|
+
readonly encoding: "latin1";
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
readonly name: "DBF";
|
|
46
|
+
readonly id: "dbf";
|
|
47
|
+
readonly module: "shapefile";
|
|
48
|
+
readonly category: "table";
|
|
49
|
+
readonly extensions: ["dbf"];
|
|
50
|
+
readonly mimeTypes: ["application/x-dbf"];
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=dbf-arrow-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dbf-arrow-loader.d.ts","sourceRoot":"","sources":["../src/dbf-arrow-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAA2B,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACtF,OAAO,KAAK,EAAC,UAAU,EAAE,eAAe,EAAC,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAC,QAAQ,EAAoB,4CAAyC;AAO7E,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,GAAG,CAAC,EAAE;QACJ,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,8EAA8E;QAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB;uBAEF,UAAU;wBACT,eAAe;;;;;;;;;;;;;;CAQ2B,CAAC;AAE3E,sBAAsB;AACtB,eAAO,MAAM,cAAc;;;mDAIW,aAAa,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC;uBAhBzD,UAAU;wBACT,eAAe;;;;;;;;;;;;;;CAkBqC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { parseDBF, parseDBFInBatches } from "./lib/parsers/parse-dbf-to-arrow.js";
|
|
5
|
+
import { DBFFormat } from "./dbf-format.js";
|
|
6
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
7
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
8
|
+
const VERSION = typeof "4.4.0-alpha.0" !== 'undefined' ? "4.4.0-alpha.0" : 'latest';
|
|
9
|
+
/**
|
|
10
|
+
* DBFLoader - DBF files are used to contain non-geometry columns in Shapefiles
|
|
11
|
+
*/
|
|
12
|
+
export const DBFArrowWorkerLoader = {
|
|
13
|
+
...DBFFormat,
|
|
14
|
+
dataType: null,
|
|
15
|
+
batchType: null,
|
|
16
|
+
version: VERSION,
|
|
17
|
+
worker: true,
|
|
18
|
+
options: {
|
|
19
|
+
dbf: {
|
|
20
|
+
encoding: 'latin1'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
/** DBF file loader */
|
|
25
|
+
export const DBFArrowLoader = {
|
|
26
|
+
...DBFArrowWorkerLoader,
|
|
27
|
+
parse: async (arrayBuffer, options) => parseDBF(arrayBuffer, options),
|
|
28
|
+
parseSync: parseDBF,
|
|
29
|
+
parseInBatches(arrayBufferIterator, options) {
|
|
30
|
+
return parseDBFInBatches(arrayBufferIterator, options);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Information about the DBF format */
|
|
2
|
+
export declare const DBFFormat: {
|
|
3
|
+
readonly name: "DBF";
|
|
4
|
+
readonly id: "dbf";
|
|
5
|
+
readonly module: "shapefile";
|
|
6
|
+
readonly category: "table";
|
|
7
|
+
readonly extensions: ["dbf"];
|
|
8
|
+
readonly mimeTypes: ["application/x-dbf"];
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=dbf-format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dbf-format.d.ts","sourceRoot":"","sources":["../src/dbf-format.ts"],"names":[],"mappings":"AAMA,uCAAuC;AACvC,eAAO,MAAM,SAAS;;;;;;;CAOK,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
/** Information about the DBF format */
|
|
5
|
+
export const DBFFormat = {
|
|
6
|
+
name: 'DBF',
|
|
7
|
+
id: 'dbf',
|
|
8
|
+
module: 'shapefile',
|
|
9
|
+
category: 'table',
|
|
10
|
+
extensions: ['dbf'],
|
|
11
|
+
mimeTypes: ['application/x-dbf']
|
|
12
|
+
};
|
package/dist/dbf-loader.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { parseDBF, parseDBFInBatches } from "./lib/parsers/parse-dbf.js";
|
|
5
5
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
6
6
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
7
|
-
const VERSION = typeof "4.
|
|
7
|
+
const VERSION = typeof "4.4.0-alpha.0" !== 'undefined' ? "4.4.0-alpha.0" : 'latest';
|
|
8
8
|
/**
|
|
9
9
|
* DBFLoader - DBF files are used to contain non-geometry columns in Shapefiles
|
|
10
10
|
*/
|