@loaders.gl/shapefile 4.2.0-alpha.3 → 4.2.0-alpha.5

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 +1 -1
  3. package/dist/dist.dev.js +227 -247
  4. package/dist/dist.min.js +12 -0
  5. package/dist/index.cjs +49 -57
  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 -259
  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 +147 -110
  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 +150 -95
  26. package/dist/lib/streaming/binary-reader.js +49 -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 +1 -1
  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,295 +1,336 @@
1
1
  import { BinaryChunkReader } from "../streaming/binary-chunk-reader.js";
2
2
  const LITTLE_ENDIAN = true;
3
3
  const DBF_HEADER_SIZE = 32;
4
- var STATE = function (STATE) {
5
- STATE[STATE["START"] = 0] = "START";
6
- STATE[STATE["FIELD_DESCRIPTORS"] = 1] = "FIELD_DESCRIPTORS";
7
- STATE[STATE["FIELD_PROPERTIES"] = 2] = "FIELD_PROPERTIES";
8
- STATE[STATE["END"] = 3] = "END";
9
- STATE[STATE["ERROR"] = 4] = "ERROR";
10
- return STATE;
11
- }(STATE || {});
4
+ var STATE;
5
+ (function (STATE) {
6
+ STATE[STATE["START"] = 0] = "START";
7
+ STATE[STATE["FIELD_DESCRIPTORS"] = 1] = "FIELD_DESCRIPTORS";
8
+ STATE[STATE["FIELD_PROPERTIES"] = 2] = "FIELD_PROPERTIES";
9
+ STATE[STATE["END"] = 3] = "END";
10
+ STATE[STATE["ERROR"] = 4] = "ERROR";
11
+ })(STATE || (STATE = {}));
12
12
  class DBFParser {
13
- constructor(options) {
14
- this.binaryReader = new BinaryChunkReader();
15
- this.textDecoder = void 0;
16
- this.state = STATE.START;
17
- this.result = {
18
- data: []
19
- };
20
- this.textDecoder = new TextDecoder(options.encoding);
21
- }
22
- write(arrayBuffer) {
23
- this.binaryReader.write(arrayBuffer);
24
- this.state = parseState(this.state, this.result, this.binaryReader, this.textDecoder);
25
- }
26
- end() {
27
- this.binaryReader.end();
28
- this.state = parseState(this.state, this.result, this.binaryReader, this.textDecoder);
29
- if (this.state !== STATE.END) {
30
- this.state = STATE.ERROR;
31
- this.result.error = 'DBF incomplete file';
13
+ constructor(options) {
14
+ this.binaryReader = new BinaryChunkReader();
15
+ this.state = STATE.START;
16
+ this.result = {
17
+ data: []
18
+ };
19
+ this.textDecoder = new TextDecoder(options.encoding);
20
+ }
21
+ /**
22
+ * @param arrayBuffer
23
+ */
24
+ write(arrayBuffer) {
25
+ this.binaryReader.write(arrayBuffer);
26
+ this.state = parseState(this.state, this.result, this.binaryReader, this.textDecoder);
27
+ // this.result.progress.bytesUsed = this.binaryReader.bytesUsed();
28
+ // important events:
29
+ // - schema available
30
+ // - first rows available
31
+ // - all rows available
32
+ }
33
+ end() {
34
+ this.binaryReader.end();
35
+ this.state = parseState(this.state, this.result, this.binaryReader, this.textDecoder);
36
+ // this.result.progress.bytesUsed = this.binaryReader.bytesUsed();
37
+ if (this.state !== STATE.END) {
38
+ this.state = STATE.ERROR;
39
+ this.result.error = 'DBF incomplete file';
40
+ }
32
41
  }
33
- }
34
42
  }
35
- export function parseDBF(arrayBuffer) {
36
- var _options$dbf;
37
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
38
- const {
39
- encoding = 'latin1'
40
- } = options.dbf || {};
41
- const dbfParser = new DBFParser({
42
- encoding
43
- });
44
- dbfParser.write(arrayBuffer);
45
- dbfParser.end();
46
- const {
47
- data,
48
- schema
49
- } = dbfParser.result;
50
- const shape = options === null || options === void 0 ? void 0 : (_options$dbf = options.dbf) === null || _options$dbf === void 0 ? void 0 : _options$dbf.shape;
51
- switch (shape) {
52
- case 'object-row-table':
53
- {
54
- const table = {
55
- shape: 'object-row-table',
56
- schema,
57
- data
58
- };
59
- return table;
60
- }
61
- case 'table':
62
- return {
63
- schema,
64
- rows: data
65
- };
66
- case 'rows':
67
- default:
68
- return data;
69
- }
43
+ /**
44
+ * @param arrayBuffer
45
+ * @param options
46
+ * @returns DBFTable or rows
47
+ */
48
+ export function parseDBF(arrayBuffer, options = {}) {
49
+ const { encoding = 'latin1' } = options.dbf || {};
50
+ const dbfParser = new DBFParser({ encoding });
51
+ dbfParser.write(arrayBuffer);
52
+ dbfParser.end();
53
+ const { data, schema } = dbfParser.result;
54
+ const shape = options?.dbf?.shape;
55
+ switch (shape) {
56
+ case 'object-row-table': {
57
+ const table = {
58
+ shape: 'object-row-table',
59
+ schema,
60
+ data
61
+ };
62
+ return table;
63
+ }
64
+ case 'table':
65
+ return { schema, rows: data };
66
+ case 'rows':
67
+ default:
68
+ return data;
69
+ }
70
70
  }
71
- export function parseDBFInBatches(asyncIterator) {
72
- try {
73
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
74
- return async function* () {
75
- const {
76
- encoding = 'latin1'
77
- } = options.dbf || {};
78
- const parser = new DBFParser({
79
- encoding
80
- });
81
- let headerReturned = false;
82
- for await (const arrayBuffer of asyncIterator) {
71
+ /**
72
+ * @param asyncIterator
73
+ * @param options
74
+ */
75
+ export async function* parseDBFInBatches(asyncIterator, options = {}) {
76
+ const { encoding = 'latin1' } = options.dbf || {};
77
+ const parser = new DBFParser({ encoding });
78
+ let headerReturned = false;
79
+ for await (const arrayBuffer of asyncIterator) {
83
80
  parser.write(arrayBuffer);
84
81
  if (!headerReturned && parser.result.dbfHeader) {
85
- headerReturned = true;
86
- yield parser.result.dbfHeader;
82
+ headerReturned = true;
83
+ yield parser.result.dbfHeader;
87
84
  }
88
85
  if (parser.result.data.length > 0) {
89
- yield parser.result.data;
90
- parser.result.data = [];
86
+ yield parser.result.data;
87
+ parser.result.data = [];
91
88
  }
92
- }
93
- parser.end();
94
- if (parser.result.data.length > 0) {
89
+ }
90
+ parser.end();
91
+ if (parser.result.data.length > 0) {
95
92
  yield parser.result.data;
96
- }
97
- }();
98
- } catch (e) {
99
- return Promise.reject(e);
100
- }
93
+ }
101
94
  }
95
+ /**
96
+ * https://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm
97
+ * @param state
98
+ * @param result
99
+ * @param binaryReader
100
+ * @param textDecoder
101
+ * @returns
102
+ */
103
+ /* eslint-disable complexity, max-depth */
102
104
  function parseState(state, result, binaryReader, textDecoder) {
103
- while (true) {
104
- try {
105
- switch (state) {
106
- case STATE.ERROR:
107
- case STATE.END:
108
- return state;
109
- case STATE.START:
110
- const dataView = binaryReader.getDataView(DBF_HEADER_SIZE);
111
- if (!dataView) {
112
- return state;
113
- }
114
- result.dbfHeader = parseDBFHeader(dataView);
115
- result.progress = {
116
- bytesUsed: 0,
117
- rowsTotal: result.dbfHeader.nRecords,
118
- rows: 0
119
- };
120
- state = STATE.FIELD_DESCRIPTORS;
121
- break;
122
- case STATE.FIELD_DESCRIPTORS:
123
- const fieldDescriptorView = binaryReader.getDataView(result.dbfHeader.headerLength - DBF_HEADER_SIZE);
124
- if (!fieldDescriptorView) {
125
- return state;
126
- }
127
- result.dbfFields = parseFieldDescriptors(fieldDescriptorView, textDecoder);
128
- result.schema = {
129
- fields: result.dbfFields.map(dbfField => makeField(dbfField)),
130
- metadata: {}
131
- };
132
- state = STATE.FIELD_PROPERTIES;
133
- binaryReader.skip(1);
134
- break;
135
- case STATE.FIELD_PROPERTIES:
136
- const {
137
- recordLength = 0,
138
- nRecords = 0
139
- } = (result === null || result === void 0 ? void 0 : result.dbfHeader) || {};
140
- while (result.data.length < nRecords) {
141
- const recordView = binaryReader.getDataView(recordLength - 1);
142
- if (!recordView) {
143
- return state;
105
+ // eslint-disable-next-line no-constant-condition
106
+ while (true) {
107
+ try {
108
+ switch (state) {
109
+ case STATE.ERROR:
110
+ case STATE.END:
111
+ return state;
112
+ case STATE.START:
113
+ // Parse initial file header
114
+ // DBF Header
115
+ const dataView = binaryReader.getDataView(DBF_HEADER_SIZE);
116
+ if (!dataView) {
117
+ return state;
118
+ }
119
+ result.dbfHeader = parseDBFHeader(dataView);
120
+ result.progress = {
121
+ bytesUsed: 0,
122
+ rowsTotal: result.dbfHeader.nRecords,
123
+ rows: 0
124
+ };
125
+ state = STATE.FIELD_DESCRIPTORS;
126
+ break;
127
+ case STATE.FIELD_DESCRIPTORS:
128
+ // Parse DBF field descriptors (schema)
129
+ const fieldDescriptorView = binaryReader.getDataView(
130
+ // @ts-ignore
131
+ result.dbfHeader.headerLength - DBF_HEADER_SIZE);
132
+ if (!fieldDescriptorView) {
133
+ return state;
134
+ }
135
+ result.dbfFields = parseFieldDescriptors(fieldDescriptorView, textDecoder);
136
+ result.schema = {
137
+ fields: result.dbfFields.map((dbfField) => makeField(dbfField)),
138
+ metadata: {}
139
+ };
140
+ state = STATE.FIELD_PROPERTIES;
141
+ // TODO(kyle) Not exactly sure why start offset needs to be headerLength + 1?
142
+ // parsedbf uses ((fields.length + 1) << 5) + 2;
143
+ binaryReader.skip(1);
144
+ break;
145
+ case STATE.FIELD_PROPERTIES:
146
+ const { recordLength = 0, nRecords = 0 } = result?.dbfHeader || {};
147
+ while (result.data.length < nRecords) {
148
+ const recordView = binaryReader.getDataView(recordLength - 1);
149
+ if (!recordView) {
150
+ return state;
151
+ }
152
+ // Note: Avoid actually reading the last byte, which may not be present
153
+ binaryReader.skip(1);
154
+ // @ts-ignore
155
+ const row = parseRow(recordView, result.dbfFields, textDecoder);
156
+ result.data.push(row);
157
+ // @ts-ignore
158
+ result.progress.rows = result.data.length;
159
+ }
160
+ state = STATE.END;
161
+ break;
162
+ default:
163
+ state = STATE.ERROR;
164
+ result.error = `illegal parser state ${state}`;
165
+ return state;
144
166
  }
145
- binaryReader.skip(1);
146
- const row = parseRow(recordView, result.dbfFields, textDecoder);
147
- result.data.push(row);
148
- result.progress.rows = result.data.length;
149
- }
150
- state = STATE.END;
151
- break;
152
- default:
153
- state = STATE.ERROR;
154
- result.error = `illegal parser state ${state}`;
155
- return state;
156
- }
157
- } catch (error) {
158
- state = STATE.ERROR;
159
- result.error = `DBF parsing failed: ${error.message}`;
160
- return state;
167
+ }
168
+ catch (error) {
169
+ state = STATE.ERROR;
170
+ result.error = `DBF parsing failed: ${error.message}`;
171
+ return state;
172
+ }
161
173
  }
162
- }
163
174
  }
175
+ /**
176
+ * @param headerView
177
+ */
164
178
  function parseDBFHeader(headerView) {
165
- return {
166
- year: headerView.getUint8(1) + 1900,
167
- month: headerView.getUint8(2),
168
- day: headerView.getUint8(3),
169
- nRecords: headerView.getUint32(4, LITTLE_ENDIAN),
170
- headerLength: headerView.getUint16(8, LITTLE_ENDIAN),
171
- recordLength: headerView.getUint16(10, LITTLE_ENDIAN),
172
- languageDriver: headerView.getUint8(29)
173
- };
179
+ return {
180
+ // Last updated date
181
+ year: headerView.getUint8(1) + 1900,
182
+ month: headerView.getUint8(2),
183
+ day: headerView.getUint8(3),
184
+ // Number of records in data file
185
+ nRecords: headerView.getUint32(4, LITTLE_ENDIAN),
186
+ // Length of header in bytes
187
+ headerLength: headerView.getUint16(8, LITTLE_ENDIAN),
188
+ // Length of each record
189
+ recordLength: headerView.getUint16(10, LITTLE_ENDIAN),
190
+ // Not sure if this is usually set
191
+ languageDriver: headerView.getUint8(29)
192
+ };
174
193
  }
194
+ /**
195
+ * @param view
196
+ */
175
197
  function parseFieldDescriptors(view, textDecoder) {
176
- const nFields = (view.byteLength - 1) / 32;
177
- const fields = [];
178
- let offset = 0;
179
- for (let i = 0; i < nFields; i++) {
180
- const name = textDecoder.decode(new Uint8Array(view.buffer, view.byteOffset + offset, 11)).replace(/\u0000/g, '');
181
- fields.push({
182
- name,
183
- dataType: String.fromCharCode(view.getUint8(offset + 11)),
184
- fieldLength: view.getUint8(offset + 16),
185
- decimal: view.getUint8(offset + 17)
186
- });
187
- offset += 32;
198
+ // NOTE: this might overestimate the number of fields if the "Database
199
+ // Container" container exists and is included in the headerLength
200
+ const nFields = (view.byteLength - 1) / 32;
201
+ const fields = [];
202
+ let offset = 0;
203
+ for (let i = 0; i < nFields; i++) {
204
+ const name = textDecoder
205
+ .decode(new Uint8Array(view.buffer, view.byteOffset + offset, 11))
206
+ // eslint-disable-next-line no-control-regex
207
+ .replace(/\u0000/g, '');
208
+ fields.push({
209
+ name,
210
+ dataType: String.fromCharCode(view.getUint8(offset + 11)),
211
+ fieldLength: view.getUint8(offset + 16),
212
+ decimal: view.getUint8(offset + 17)
213
+ });
214
+ offset += 32;
215
+ }
216
+ return fields;
217
+ }
218
+ /*
219
+ * @param {BinaryChunkReader} binaryReader
220
+ function parseRows(binaryReader, fields, nRecords, recordLength, textDecoder) {
221
+ const rows = [];
222
+ for (let i = 0; i < nRecords; i++) {
223
+ const recordView = binaryReader.getDataView(recordLength - 1);
224
+ binaryReader.skip(1);
225
+ // @ts-ignore
226
+ rows.push(parseRow(recordView, fields, textDecoder));
188
227
  }
189
- return fields;
228
+ return rows;
190
229
  }
230
+ */
231
+ /**
232
+ *
233
+ * @param view
234
+ * @param fields
235
+ * @param textDecoder
236
+ * @returns
237
+ */
191
238
  function parseRow(view, fields, textDecoder) {
192
- const out = {};
193
- let offset = 0;
194
- for (const field of fields) {
195
- const text = textDecoder.decode(new Uint8Array(view.buffer, view.byteOffset + offset, field.fieldLength));
196
- out[field.name] = parseField(text, field.dataType);
197
- offset += field.fieldLength;
198
- }
199
- return out;
239
+ const out = {};
240
+ let offset = 0;
241
+ for (const field of fields) {
242
+ const text = textDecoder.decode(new Uint8Array(view.buffer, view.byteOffset + offset, field.fieldLength));
243
+ out[field.name] = parseField(text, field.dataType);
244
+ offset += field.fieldLength;
245
+ }
246
+ return out;
200
247
  }
248
+ /**
249
+ * Should NaN be coerced to null?
250
+ * @param text
251
+ * @param dataType
252
+ * @returns Field depends on a type of the data
253
+ */
201
254
  function parseField(text, dataType) {
202
- switch (dataType) {
203
- case 'B':
204
- return parseNumber(text);
205
- case 'C':
206
- return parseCharacter(text);
207
- case 'F':
208
- return parseNumber(text);
209
- case 'N':
210
- return parseNumber(text);
211
- case 'O':
212
- return parseNumber(text);
213
- case 'D':
214
- return parseDate(text);
215
- case 'L':
216
- return parseBoolean(text);
217
- default:
218
- throw new Error('Unsupported data type');
219
- }
255
+ switch (dataType) {
256
+ case 'B':
257
+ return parseNumber(text);
258
+ case 'C':
259
+ return parseCharacter(text);
260
+ case 'F':
261
+ return parseNumber(text);
262
+ case 'N':
263
+ return parseNumber(text);
264
+ case 'O':
265
+ return parseNumber(text);
266
+ case 'D':
267
+ return parseDate(text);
268
+ case 'L':
269
+ return parseBoolean(text);
270
+ default:
271
+ throw new Error('Unsupported data type');
272
+ }
220
273
  }
274
+ /**
275
+ * Parse YYYYMMDD to date in milliseconds
276
+ * @param str YYYYMMDD
277
+ * @returns new Date as a number
278
+ */
221
279
  function parseDate(str) {
222
- return Date.UTC(str.slice(0, 4), parseInt(str.slice(4, 6), 10) - 1, str.slice(6, 8));
280
+ return Date.UTC(str.slice(0, 4), parseInt(str.slice(4, 6), 10) - 1, str.slice(6, 8));
223
281
  }
282
+ /**
283
+ * Read boolean value
284
+ * any of Y, y, T, t coerce to true
285
+ * any of N, n, F, f coerce to false
286
+ * otherwise null
287
+ * @param value
288
+ * @returns boolean | null
289
+ */
224
290
  function parseBoolean(value) {
225
- return /^[nf]$/i.test(value) ? false : /^[yt]$/i.test(value) ? true : null;
291
+ return /^[nf]$/i.test(value) ? false : /^[yt]$/i.test(value) ? true : null;
226
292
  }
293
+ /**
294
+ * Return null instead of NaN
295
+ * @param text
296
+ * @returns number | null
297
+ */
227
298
  function parseNumber(text) {
228
- const number = parseFloat(text);
229
- return isNaN(number) ? null : number;
299
+ const number = parseFloat(text);
300
+ return isNaN(number) ? null : number;
230
301
  }
302
+ /**
303
+ *
304
+ * @param text
305
+ * @returns string | null
306
+ */
231
307
  function parseCharacter(text) {
232
- return text.trim() || null;
308
+ return text.trim() || null;
233
309
  }
234
- function makeField(_ref) {
235
- let {
236
- name,
237
- dataType,
238
- fieldLength,
239
- decimal
240
- } = _ref;
241
- switch (dataType) {
242
- case 'B':
243
- return {
244
- name,
245
- type: 'float64',
246
- nullable: true,
247
- metadata: {}
248
- };
249
- case 'C':
250
- return {
251
- name,
252
- type: 'utf8',
253
- nullable: true,
254
- metadata: {}
255
- };
256
- case 'F':
257
- return {
258
- name,
259
- type: 'float64',
260
- nullable: true,
261
- metadata: {}
262
- };
263
- case 'N':
264
- return {
265
- name,
266
- type: 'float64',
267
- nullable: true,
268
- metadata: {}
269
- };
270
- case 'O':
271
- return {
272
- name,
273
- type: 'float64',
274
- nullable: true,
275
- metadata: {}
276
- };
277
- case 'D':
278
- return {
279
- name,
280
- type: 'timestamp-millisecond',
281
- nullable: true,
282
- metadata: {}
283
- };
284
- case 'L':
285
- return {
286
- name,
287
- type: 'bool',
288
- nullable: true,
289
- metadata: {}
290
- };
291
- default:
292
- throw new Error('Unsupported data type');
293
- }
310
+ /**
311
+ * Create a standard Arrow-style `Field` from field descriptor.
312
+ * TODO - use `fieldLength` and `decimal` to generate smaller types?
313
+ * @param param0
314
+ * @returns Field
315
+ */
316
+ // eslint-disable
317
+ function makeField({ name, dataType, fieldLength, decimal }) {
318
+ switch (dataType) {
319
+ case 'B':
320
+ return { name, type: 'float64', nullable: true, metadata: {} };
321
+ case 'C':
322
+ return { name, type: 'utf8', nullable: true, metadata: {} };
323
+ case 'F':
324
+ return { name, type: 'float64', nullable: true, metadata: {} };
325
+ case 'N':
326
+ return { name, type: 'float64', nullable: true, metadata: {} };
327
+ case 'O':
328
+ return { name, type: 'float64', nullable: true, metadata: {} };
329
+ case 'D':
330
+ return { name, type: 'timestamp-millisecond', nullable: true, metadata: {} };
331
+ case 'L':
332
+ return { name, type: 'bool', nullable: true, metadata: {} };
333
+ default:
334
+ throw new Error('Unsupported data type');
335
+ }
294
336
  }
295
- //# sourceMappingURL=parse-dbf.js.map
@@ -1,7 +1,7 @@
1
1
  import { LoaderContext } from '@loaders.gl/loader-utils';
2
- import type { SHXOutput } from './parse-shx';
3
- import type { SHPHeader } from './parse-shp-header';
4
- import type { ShapefileLoaderOptions } from './types';
2
+ import type { SHXOutput } from "./parse-shx.js";
3
+ import type { SHPHeader } from "./parse-shp-header.js";
4
+ import type { ShapefileLoaderOptions } from "./types.js";
5
5
  interface ShapefileOutput {
6
6
  encoding?: string;
7
7
  prj?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"parse-shapefile.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/parse-shapefile.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAA8C,MAAM,0BAA0B,CAAC;AAUpG,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,SAAS,CAAC;AAOpD,UAAU,eAAe;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,SAAS,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AACD;;GAEG;AAEH,wBAAuB,uBAAuB,CAC5C,aAAa,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,EACjE,OAAO,CAAC,EAAE,sBAAsB,EAChC,OAAO,CAAC,EAAE,aAAa,GACtB,aAAa,CAAC,eAAe,CAAC,CAkFhC;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,WAAW,EACxB,OAAO,CAAC,EAAE,sBAAsB,EAChC,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,eAAe,CAAC,CAiD1B;AAwDD;;;;;GAKG;AAEH,wBAAsB,yBAAyB,CAC7C,OAAO,CAAC,EAAE,sBAAsB,EAChC,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC;IACT,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC,CAkCD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAQ1E"}
1
+ {"version":3,"file":"parse-shapefile.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/parse-shapefile.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAA8C,MAAM,0BAA0B,CAAC;AAUpG,OAAO,KAAK,EAAC,SAAS,EAAC,uBAAoB;AAC3C,OAAO,KAAK,EAAC,SAAS,EAAC,8BAA2B;AAClD,OAAO,KAAK,EAAC,sBAAsB,EAAC,mBAAgB;AAOpD,UAAU,eAAe;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,SAAS,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AACD;;GAEG;AAEH,wBAAuB,uBAAuB,CAC5C,aAAa,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,EACjE,OAAO,CAAC,EAAE,sBAAsB,EAChC,OAAO,CAAC,EAAE,aAAa,GACtB,aAAa,CAAC,eAAe,CAAC,CAkFhC;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,WAAW,EACxB,OAAO,CAAC,EAAE,sBAAsB,EAChC,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,eAAe,CAAC,CAiD1B;AAwDD;;;;;GAKG;AAEH,wBAAsB,yBAAyB,CAC7C,OAAO,CAAC,EAAE,sBAAsB,EAChC,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC;IACT,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC,CAkCD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAQ1E"}