@loaders.gl/shapefile 3.4.0-alpha.2 → 3.4.0-alpha.4

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 (57) hide show
  1. package/dist/dbf-worker.js +1 -1
  2. package/dist/dist.min.js +47 -0
  3. package/dist/es5/dbf-loader.js +7 -11
  4. package/dist/es5/dbf-loader.js.map +1 -1
  5. package/dist/es5/index.js.map +1 -1
  6. package/dist/es5/lib/parsers/parse-dbf.js +47 -75
  7. package/dist/es5/lib/parsers/parse-dbf.js.map +1 -1
  8. package/dist/es5/lib/parsers/parse-shapefile.js +239 -249
  9. package/dist/es5/lib/parsers/parse-shapefile.js.map +1 -1
  10. package/dist/es5/lib/parsers/parse-shp-geometry.js +0 -16
  11. package/dist/es5/lib/parsers/parse-shp-geometry.js.map +1 -1
  12. package/dist/es5/lib/parsers/parse-shp-header.js +0 -1
  13. package/dist/es5/lib/parsers/parse-shp-header.js.map +1 -1
  14. package/dist/es5/lib/parsers/parse-shp.js +74 -79
  15. package/dist/es5/lib/parsers/parse-shp.js.map +1 -1
  16. package/dist/es5/lib/parsers/parse-shx.js +0 -1
  17. package/dist/es5/lib/parsers/parse-shx.js.map +1 -1
  18. package/dist/es5/lib/streaming/binary-chunk-reader.js +9 -33
  19. package/dist/es5/lib/streaming/binary-chunk-reader.js.map +1 -1
  20. package/dist/es5/lib/streaming/binary-reader.js +4 -11
  21. package/dist/es5/lib/streaming/binary-reader.js.map +1 -1
  22. package/dist/es5/lib/streaming/zip-batch-iterators.js +54 -58
  23. package/dist/es5/lib/streaming/zip-batch-iterators.js.map +1 -1
  24. package/dist/es5/shapefile-loader.js +1 -2
  25. package/dist/es5/shapefile-loader.js.map +1 -1
  26. package/dist/es5/shp-loader.js +7 -11
  27. package/dist/es5/shp-loader.js.map +1 -1
  28. package/dist/es5/workers/dbf-worker.js.map +1 -1
  29. package/dist/es5/workers/shp-worker.js.map +1 -1
  30. package/dist/esm/bundle.js +0 -1
  31. package/dist/esm/bundle.js.map +1 -1
  32. package/dist/esm/dbf-loader.js +1 -4
  33. package/dist/esm/dbf-loader.js.map +1 -1
  34. package/dist/esm/lib/parsers/parse-dbf.js +34 -45
  35. package/dist/esm/lib/parsers/parse-dbf.js.map +1 -1
  36. package/dist/esm/lib/parsers/parse-shapefile.js +0 -16
  37. package/dist/esm/lib/parsers/parse-shapefile.js.map +1 -1
  38. package/dist/esm/lib/parsers/parse-shp-geometry.js +0 -18
  39. package/dist/esm/lib/parsers/parse-shp-geometry.js.map +1 -1
  40. package/dist/esm/lib/parsers/parse-shp-header.js +0 -1
  41. package/dist/esm/lib/parsers/parse-shp-header.js.map +1 -1
  42. package/dist/esm/lib/parsers/parse-shp.js +0 -4
  43. package/dist/esm/lib/parsers/parse-shp.js.map +1 -1
  44. package/dist/esm/lib/parsers/parse-shx.js +0 -1
  45. package/dist/esm/lib/parsers/parse-shx.js.map +1 -1
  46. package/dist/esm/lib/streaming/binary-chunk-reader.js +0 -16
  47. package/dist/esm/lib/streaming/binary-chunk-reader.js.map +1 -1
  48. package/dist/esm/lib/streaming/binary-reader.js +0 -3
  49. package/dist/esm/lib/streaming/binary-reader.js.map +1 -1
  50. package/dist/esm/lib/streaming/zip-batch-iterators.js +0 -5
  51. package/dist/esm/lib/streaming/zip-batch-iterators.js.map +1 -1
  52. package/dist/esm/shapefile-loader.js +1 -3
  53. package/dist/esm/shapefile-loader.js.map +1 -1
  54. package/dist/esm/shp-loader.js +1 -4
  55. package/dist/esm/shp-loader.js.map +1 -1
  56. package/dist/shp-worker.js +1 -1
  57. package/package.json +5 -5
@@ -22,7 +22,7 @@ var _shpLoader = require("../../shp-loader");
22
22
  var _dbfLoader = require("../../dbf-loader");
23
23
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
24
24
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
25
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
25
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
26
26
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
27
27
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
28
28
  function _asyncIterator(iterable) { var method, async, sync, retry = 2; for ("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;) { if (async && null != (method = iterable[async])) return method.call(iterable); if (sync && null != (method = iterable[sync])) return new AsyncFromSyncIterator(method.call(iterable)); async = "@@asyncIterator", sync = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
@@ -34,145 +34,143 @@ function _parseShapefileInBatches() {
34
34
  _parseShapefileInBatches = (0, _wrapAsyncGenerator2.default)(_regenerator.default.mark(function _callee(asyncIterator, options, context) {
35
35
  var _ref, _ref$reproject, reproject, _ref$_targetCrs, _targetCrs, _yield$_awaitAsyncGen, shx, cpg, prj, shapeIterable, propertyIterable, dbfResponse, shapeHeader, dbfHeader, iterator, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, item, geometries, properties, _item, geojsonGeometries, features;
36
36
  return _regenerator.default.wrap(function _callee$(_context) {
37
- while (1) {
38
- switch (_context.prev = _context.next) {
39
- case 0:
40
- _ref = (options === null || options === void 0 ? void 0 : options.gis) || {}, _ref$reproject = _ref.reproject, reproject = _ref$reproject === void 0 ? false : _ref$reproject, _ref$_targetCrs = _ref._targetCrs, _targetCrs = _ref$_targetCrs === void 0 ? 'WGS84' : _ref$_targetCrs;
41
- _context.next = 3;
42
- return (0, _awaitAsyncGenerator2.default)(loadShapefileSidecarFiles(options, context));
43
- case 3:
44
- _yield$_awaitAsyncGen = _context.sent;
45
- shx = _yield$_awaitAsyncGen.shx;
46
- cpg = _yield$_awaitAsyncGen.cpg;
47
- prj = _yield$_awaitAsyncGen.prj;
48
- _context.next = 9;
49
- return (0, _awaitAsyncGenerator2.default)(context.parseInBatches(asyncIterator, _shpLoader.SHPLoader, options));
50
- case 9:
51
- shapeIterable = _context.sent;
52
- _context.next = 12;
53
- return (0, _awaitAsyncGenerator2.default)(context.fetch(replaceExtension((context === null || context === void 0 ? void 0 : context.url) || '', 'dbf')));
54
- case 12:
55
- dbfResponse = _context.sent;
56
- if (!dbfResponse.ok) {
57
- _context.next = 17;
58
- break;
59
- }
60
- _context.next = 16;
61
- return (0, _awaitAsyncGenerator2.default)(context.parseInBatches(dbfResponse, _dbfLoader.DBFLoader, _objectSpread(_objectSpread({}, options), {}, {
62
- dbf: {
63
- encoding: cpg || 'latin1'
64
- }
65
- })));
66
- case 16:
67
- propertyIterable = _context.sent;
68
- case 17:
69
- _context.next = 19;
70
- return (0, _awaitAsyncGenerator2.default)(shapeIterable.next());
71
- case 19:
72
- shapeHeader = _context.sent.value;
73
- if (!(shapeHeader && shapeHeader.batchType === 'metadata')) {
74
- _context.next = 24;
75
- break;
76
- }
77
- _context.next = 23;
78
- return (0, _awaitAsyncGenerator2.default)(shapeIterable.next());
79
- case 23:
80
- shapeHeader = _context.sent.value;
81
- case 24:
82
- dbfHeader = {};
83
- if (!propertyIterable) {
84
- _context.next = 33;
85
- break;
86
- }
87
- _context.next = 28;
88
- return (0, _awaitAsyncGenerator2.default)(propertyIterable.next());
89
- case 28:
90
- dbfHeader = _context.sent.value;
91
- if (!(dbfHeader && dbfHeader.batchType === 'metadata')) {
92
- _context.next = 33;
93
- break;
94
- }
95
- _context.next = 32;
96
- return (0, _awaitAsyncGenerator2.default)(propertyIterable.next());
97
- case 32:
98
- dbfHeader = _context.sent.value;
99
- case 33:
100
- if (propertyIterable) {
101
- iterator = (0, _zipBatchIterators.zipBatchIterators)(shapeIterable, propertyIterable);
102
- } else {
103
- iterator = shapeIterable;
104
- }
105
- _iteratorAbruptCompletion = false;
106
- _didIteratorError = false;
107
- _context.prev = 36;
108
- _iterator = _asyncIterator(iterator);
109
- case 38:
110
- _context.next = 40;
111
- return (0, _awaitAsyncGenerator2.default)(_iterator.next());
112
- case 40:
113
- if (!(_iteratorAbruptCompletion = !(_step = _context.sent).done)) {
114
- _context.next = 53;
115
- break;
116
- }
117
- item = _step.value;
118
- geometries = void 0;
119
- properties = void 0;
120
- if (!propertyIterable) {
121
- geometries = item;
122
- } else {
123
- _item = (0, _slicedToArray2.default)(item, 2);
124
- geometries = _item[0];
125
- properties = _item[1];
126
- }
127
- geojsonGeometries = parseGeometries(geometries);
128
- features = joinProperties(geojsonGeometries, properties);
129
- if (reproject) {
130
- features = reprojectFeatures(features, prj, _targetCrs);
37
+ while (1) switch (_context.prev = _context.next) {
38
+ case 0:
39
+ _ref = (options === null || options === void 0 ? void 0 : options.gis) || {}, _ref$reproject = _ref.reproject, reproject = _ref$reproject === void 0 ? false : _ref$reproject, _ref$_targetCrs = _ref._targetCrs, _targetCrs = _ref$_targetCrs === void 0 ? 'WGS84' : _ref$_targetCrs;
40
+ _context.next = 3;
41
+ return (0, _awaitAsyncGenerator2.default)(loadShapefileSidecarFiles(options, context));
42
+ case 3:
43
+ _yield$_awaitAsyncGen = _context.sent;
44
+ shx = _yield$_awaitAsyncGen.shx;
45
+ cpg = _yield$_awaitAsyncGen.cpg;
46
+ prj = _yield$_awaitAsyncGen.prj;
47
+ _context.next = 9;
48
+ return (0, _awaitAsyncGenerator2.default)(context.parseInBatches(asyncIterator, _shpLoader.SHPLoader, options));
49
+ case 9:
50
+ shapeIterable = _context.sent;
51
+ _context.next = 12;
52
+ return (0, _awaitAsyncGenerator2.default)(context.fetch(replaceExtension((context === null || context === void 0 ? void 0 : context.url) || '', 'dbf')));
53
+ case 12:
54
+ dbfResponse = _context.sent;
55
+ if (!dbfResponse.ok) {
56
+ _context.next = 17;
57
+ break;
58
+ }
59
+ _context.next = 16;
60
+ return (0, _awaitAsyncGenerator2.default)(context.parseInBatches(dbfResponse, _dbfLoader.DBFLoader, _objectSpread(_objectSpread({}, options), {}, {
61
+ dbf: {
62
+ encoding: cpg || 'latin1'
131
63
  }
132
- _context.next = 50;
133
- return {
134
- encoding: cpg,
135
- prj: prj,
136
- shx: shx,
137
- header: shapeHeader,
138
- data: features
139
- };
140
- case 50:
141
- _iteratorAbruptCompletion = false;
142
- _context.next = 38;
64
+ })));
65
+ case 16:
66
+ propertyIterable = _context.sent;
67
+ case 17:
68
+ _context.next = 19;
69
+ return (0, _awaitAsyncGenerator2.default)(shapeIterable.next());
70
+ case 19:
71
+ shapeHeader = _context.sent.value;
72
+ if (!(shapeHeader && shapeHeader.batchType === 'metadata')) {
73
+ _context.next = 24;
143
74
  break;
144
- case 53:
145
- _context.next = 59;
75
+ }
76
+ _context.next = 23;
77
+ return (0, _awaitAsyncGenerator2.default)(shapeIterable.next());
78
+ case 23:
79
+ shapeHeader = _context.sent.value;
80
+ case 24:
81
+ dbfHeader = {};
82
+ if (!propertyIterable) {
83
+ _context.next = 33;
146
84
  break;
147
- case 55:
148
- _context.prev = 55;
149
- _context.t0 = _context["catch"](36);
150
- _didIteratorError = true;
151
- _iteratorError = _context.t0;
152
- case 59:
153
- _context.prev = 59;
154
- _context.prev = 60;
155
- if (!(_iteratorAbruptCompletion && _iterator.return != null)) {
156
- _context.next = 64;
157
- break;
158
- }
85
+ }
86
+ _context.next = 28;
87
+ return (0, _awaitAsyncGenerator2.default)(propertyIterable.next());
88
+ case 28:
89
+ dbfHeader = _context.sent.value;
90
+ if (!(dbfHeader && dbfHeader.batchType === 'metadata')) {
91
+ _context.next = 33;
92
+ break;
93
+ }
94
+ _context.next = 32;
95
+ return (0, _awaitAsyncGenerator2.default)(propertyIterable.next());
96
+ case 32:
97
+ dbfHeader = _context.sent.value;
98
+ case 33:
99
+ if (propertyIterable) {
100
+ iterator = (0, _zipBatchIterators.zipBatchIterators)(shapeIterable, propertyIterable);
101
+ } else {
102
+ iterator = shapeIterable;
103
+ }
104
+ _iteratorAbruptCompletion = false;
105
+ _didIteratorError = false;
106
+ _context.prev = 36;
107
+ _iterator = _asyncIterator(iterator);
108
+ case 38:
109
+ _context.next = 40;
110
+ return (0, _awaitAsyncGenerator2.default)(_iterator.next());
111
+ case 40:
112
+ if (!(_iteratorAbruptCompletion = !(_step = _context.sent).done)) {
113
+ _context.next = 53;
114
+ break;
115
+ }
116
+ item = _step.value;
117
+ geometries = void 0;
118
+ properties = void 0;
119
+ if (!propertyIterable) {
120
+ geometries = item;
121
+ } else {
122
+ _item = (0, _slicedToArray2.default)(item, 2);
123
+ geometries = _item[0];
124
+ properties = _item[1];
125
+ }
126
+ geojsonGeometries = parseGeometries(geometries);
127
+ features = joinProperties(geojsonGeometries, properties);
128
+ if (reproject) {
129
+ features = reprojectFeatures(features, prj, _targetCrs);
130
+ }
131
+ _context.next = 50;
132
+ return {
133
+ encoding: cpg,
134
+ prj: prj,
135
+ shx: shx,
136
+ header: shapeHeader,
137
+ data: features
138
+ };
139
+ case 50:
140
+ _iteratorAbruptCompletion = false;
141
+ _context.next = 38;
142
+ break;
143
+ case 53:
144
+ _context.next = 59;
145
+ break;
146
+ case 55:
147
+ _context.prev = 55;
148
+ _context.t0 = _context["catch"](36);
149
+ _didIteratorError = true;
150
+ _iteratorError = _context.t0;
151
+ case 59:
152
+ _context.prev = 59;
153
+ _context.prev = 60;
154
+ if (!(_iteratorAbruptCompletion && _iterator.return != null)) {
159
155
  _context.next = 64;
160
- return (0, _awaitAsyncGenerator2.default)(_iterator.return());
161
- case 64:
162
- _context.prev = 64;
163
- if (!_didIteratorError) {
164
- _context.next = 67;
165
- break;
166
- }
167
- throw _iteratorError;
168
- case 67:
169
- return _context.finish(64);
170
- case 68:
171
- return _context.finish(59);
172
- case 69:
173
- case "end":
174
- return _context.stop();
175
- }
156
+ break;
157
+ }
158
+ _context.next = 64;
159
+ return (0, _awaitAsyncGenerator2.default)(_iterator.return());
160
+ case 64:
161
+ _context.prev = 64;
162
+ if (!_didIteratorError) {
163
+ _context.next = 67;
164
+ break;
165
+ }
166
+ throw _iteratorError;
167
+ case 67:
168
+ return _context.finish(64);
169
+ case 68:
170
+ return _context.finish(59);
171
+ case 69:
172
+ case "end":
173
+ return _context.stop();
176
174
  }
177
175
  }, _callee, null, [[36, 55, 59, 69], [60,, 64, 68]]);
178
176
  }));
@@ -185,57 +183,55 @@ function _parseShapefile() {
185
183
  _parseShapefile = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(arrayBuffer, options, context) {
186
184
  var _ref2, _ref2$reproject, reproject, _ref2$_targetCrs, _targetCrs, _yield$loadShapefileS, shx, cpg, prj, _yield$context$parse, header, geometries, geojsonGeometries, properties, dbfResponse, features;
187
185
  return _regenerator.default.wrap(function _callee2$(_context2) {
188
- while (1) {
189
- switch (_context2.prev = _context2.next) {
190
- case 0:
191
- _ref2 = (options === null || options === void 0 ? void 0 : options.gis) || {}, _ref2$reproject = _ref2.reproject, reproject = _ref2$reproject === void 0 ? false : _ref2$reproject, _ref2$_targetCrs = _ref2._targetCrs, _targetCrs = _ref2$_targetCrs === void 0 ? 'WGS84' : _ref2$_targetCrs;
192
- _context2.next = 3;
193
- return loadShapefileSidecarFiles(options, context);
194
- case 3:
195
- _yield$loadShapefileS = _context2.sent;
196
- shx = _yield$loadShapefileS.shx;
197
- cpg = _yield$loadShapefileS.cpg;
198
- prj = _yield$loadShapefileS.prj;
199
- _context2.next = 9;
200
- return context.parse(arrayBuffer, _shpLoader.SHPLoader, options);
201
- case 9:
202
- _yield$context$parse = _context2.sent;
203
- header = _yield$context$parse.header;
204
- geometries = _yield$context$parse.geometries;
205
- geojsonGeometries = parseGeometries(geometries);
206
- properties = [];
207
- _context2.next = 16;
208
- return context.fetch(replaceExtension(context.url, 'dbf'));
209
- case 16:
210
- dbfResponse = _context2.sent;
211
- if (!dbfResponse.ok) {
212
- _context2.next = 21;
213
- break;
214
- }
215
- _context2.next = 20;
216
- return context.parse(dbfResponse, _dbfLoader.DBFLoader, {
217
- dbf: {
218
- encoding: cpg || 'latin1'
219
- }
220
- });
221
- case 20:
222
- properties = _context2.sent;
223
- case 21:
224
- features = joinProperties(geojsonGeometries, properties);
225
- if (reproject) {
226
- features = reprojectFeatures(features, prj, _targetCrs);
186
+ while (1) switch (_context2.prev = _context2.next) {
187
+ case 0:
188
+ _ref2 = (options === null || options === void 0 ? void 0 : options.gis) || {}, _ref2$reproject = _ref2.reproject, reproject = _ref2$reproject === void 0 ? false : _ref2$reproject, _ref2$_targetCrs = _ref2._targetCrs, _targetCrs = _ref2$_targetCrs === void 0 ? 'WGS84' : _ref2$_targetCrs;
189
+ _context2.next = 3;
190
+ return loadShapefileSidecarFiles(options, context);
191
+ case 3:
192
+ _yield$loadShapefileS = _context2.sent;
193
+ shx = _yield$loadShapefileS.shx;
194
+ cpg = _yield$loadShapefileS.cpg;
195
+ prj = _yield$loadShapefileS.prj;
196
+ _context2.next = 9;
197
+ return context.parse(arrayBuffer, _shpLoader.SHPLoader, options);
198
+ case 9:
199
+ _yield$context$parse = _context2.sent;
200
+ header = _yield$context$parse.header;
201
+ geometries = _yield$context$parse.geometries;
202
+ geojsonGeometries = parseGeometries(geometries);
203
+ properties = [];
204
+ _context2.next = 16;
205
+ return context.fetch(replaceExtension(context.url, 'dbf'));
206
+ case 16:
207
+ dbfResponse = _context2.sent;
208
+ if (!dbfResponse.ok) {
209
+ _context2.next = 21;
210
+ break;
211
+ }
212
+ _context2.next = 20;
213
+ return context.parse(dbfResponse, _dbfLoader.DBFLoader, {
214
+ dbf: {
215
+ encoding: cpg || 'latin1'
227
216
  }
228
- return _context2.abrupt("return", {
229
- encoding: cpg,
230
- prj: prj,
231
- shx: shx,
232
- header: header,
233
- data: features
234
- });
235
- case 24:
236
- case "end":
237
- return _context2.stop();
238
- }
217
+ });
218
+ case 20:
219
+ properties = _context2.sent;
220
+ case 21:
221
+ features = joinProperties(geojsonGeometries, properties);
222
+ if (reproject) {
223
+ features = reprojectFeatures(features, prj, _targetCrs);
224
+ }
225
+ return _context2.abrupt("return", {
226
+ encoding: cpg,
227
+ prj: prj,
228
+ shx: shx,
229
+ header: header,
230
+ data: features
231
+ });
232
+ case 24:
233
+ case "end":
234
+ return _context2.stop();
239
235
  }
240
236
  }, _callee2);
241
237
  }));
@@ -257,7 +253,6 @@ function parseGeometries(geometries) {
257
253
  }
258
254
  return geojsonGeometries;
259
255
  }
260
-
261
256
  function joinProperties(geometries, properties) {
262
257
  var features = [];
263
258
  for (var i = 0; i < geometries.length; i++) {
@@ -271,7 +266,6 @@ function joinProperties(geometries, properties) {
271
266
  }
272
267
  return features;
273
268
  }
274
-
275
269
  function reprojectFeatures(features, sourceCrs, targetCrs) {
276
270
  if (!sourceCrs && !targetCrs) {
277
271
  return features;
@@ -284,7 +278,6 @@ function reprojectFeatures(features, sourceCrs, targetCrs) {
284
278
  return projection.project(coord);
285
279
  });
286
280
  }
287
-
288
281
  function loadShapefileSidecarFiles(_x7, _x8) {
289
282
  return _loadShapefileSidecarFiles.apply(this, arguments);
290
283
  }
@@ -292,65 +285,63 @@ function _loadShapefileSidecarFiles() {
292
285
  _loadShapefileSidecarFiles = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(options, context) {
293
286
  var url, fetch, shxPromise, cpgPromise, prjPromise, shx, cpg, prj, shxResponse, arrayBuffer, cpgResponse, prjResponse;
294
287
  return _regenerator.default.wrap(function _callee3$(_context3) {
295
- while (1) {
296
- switch (_context3.prev = _context3.next) {
297
- case 0:
298
- url = context.url, fetch = context.fetch;
299
- shxPromise = fetch(replaceExtension(url, 'shx'));
300
- cpgPromise = fetch(replaceExtension(url, 'cpg'));
301
- prjPromise = fetch(replaceExtension(url, 'prj'));
302
- _context3.next = 6;
303
- return Promise.all([shxPromise, cpgPromise, prjPromise]);
304
- case 6:
305
- _context3.next = 8;
306
- return shxPromise;
307
- case 8:
308
- shxResponse = _context3.sent;
309
- if (!shxResponse.ok) {
310
- _context3.next = 14;
311
- break;
312
- }
313
- _context3.next = 12;
314
- return shxResponse.arrayBuffer();
315
- case 12:
316
- arrayBuffer = _context3.sent;
317
- shx = (0, _parseShx.parseShx)(arrayBuffer);
318
- case 14:
319
- _context3.next = 16;
320
- return cpgPromise;
321
- case 16:
322
- cpgResponse = _context3.sent;
323
- if (!cpgResponse.ok) {
324
- _context3.next = 21;
325
- break;
326
- }
327
- _context3.next = 20;
328
- return cpgResponse.text();
329
- case 20:
330
- cpg = _context3.sent;
331
- case 21:
332
- _context3.next = 23;
333
- return prjPromise;
334
- case 23:
335
- prjResponse = _context3.sent;
336
- if (!prjResponse.ok) {
337
- _context3.next = 28;
338
- break;
339
- }
340
- _context3.next = 27;
341
- return prjResponse.text();
342
- case 27:
343
- prj = _context3.sent;
344
- case 28:
345
- return _context3.abrupt("return", {
346
- shx: shx,
347
- cpg: cpg,
348
- prj: prj
349
- });
350
- case 29:
351
- case "end":
352
- return _context3.stop();
353
- }
288
+ while (1) switch (_context3.prev = _context3.next) {
289
+ case 0:
290
+ url = context.url, fetch = context.fetch;
291
+ shxPromise = fetch(replaceExtension(url, 'shx'));
292
+ cpgPromise = fetch(replaceExtension(url, 'cpg'));
293
+ prjPromise = fetch(replaceExtension(url, 'prj'));
294
+ _context3.next = 6;
295
+ return Promise.all([shxPromise, cpgPromise, prjPromise]);
296
+ case 6:
297
+ _context3.next = 8;
298
+ return shxPromise;
299
+ case 8:
300
+ shxResponse = _context3.sent;
301
+ if (!shxResponse.ok) {
302
+ _context3.next = 14;
303
+ break;
304
+ }
305
+ _context3.next = 12;
306
+ return shxResponse.arrayBuffer();
307
+ case 12:
308
+ arrayBuffer = _context3.sent;
309
+ shx = (0, _parseShx.parseShx)(arrayBuffer);
310
+ case 14:
311
+ _context3.next = 16;
312
+ return cpgPromise;
313
+ case 16:
314
+ cpgResponse = _context3.sent;
315
+ if (!cpgResponse.ok) {
316
+ _context3.next = 21;
317
+ break;
318
+ }
319
+ _context3.next = 20;
320
+ return cpgResponse.text();
321
+ case 20:
322
+ cpg = _context3.sent;
323
+ case 21:
324
+ _context3.next = 23;
325
+ return prjPromise;
326
+ case 23:
327
+ prjResponse = _context3.sent;
328
+ if (!prjResponse.ok) {
329
+ _context3.next = 28;
330
+ break;
331
+ }
332
+ _context3.next = 27;
333
+ return prjResponse.text();
334
+ case 27:
335
+ prj = _context3.sent;
336
+ case 28:
337
+ return _context3.abrupt("return", {
338
+ shx: shx,
339
+ cpg: cpg,
340
+ prj: prj
341
+ });
342
+ case 29:
343
+ case "end":
344
+ return _context3.stop();
354
345
  }
355
346
  }, _callee3);
356
347
  }));
@@ -365,7 +356,6 @@ function replaceExtension(url, newExtension) {
365
356
  }
366
357
  return "".concat(baseName, ".").concat(newExtension);
367
358
  }
368
-
369
359
  function basename(url) {
370
360
  var extIndex = url && url.lastIndexOf('.');
371
361
  if (typeof extIndex === 'number') {