@loaders.gl/json 3.4.8 → 3.4.10

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/dist.min.js CHANGED
@@ -2015,7 +2015,8 @@ Char: ${this.c}`;
2015
2015
  ...geometryInfo
2016
2016
  }, {
2017
2017
  numericPropKeys: options && options.numericPropKeys || numericPropKeys,
2018
- PositionDataType: options ? options.PositionDataType : Float32Array
2018
+ PositionDataType: options ? options.PositionDataType : Float32Array,
2019
+ triangulate: options ? options.triangulate : true
2019
2020
  });
2020
2021
  }
2021
2022
  function extractNumericPropTypes(features) {
@@ -2044,7 +2045,7 @@ Char: ${this.c}`;
2044
2045
  propArrayTypes,
2045
2046
  coordLength
2046
2047
  } = geometryInfo;
2047
- const { numericPropKeys = [], PositionDataType = Float32Array } = options;
2048
+ const { numericPropKeys = [], PositionDataType = Float32Array, triangulate = true } = options;
2048
2049
  const hasGlobalId = features[0] && "id" in features[0];
2049
2050
  const GlobalFeatureIdsDataType = features.length > 65535 ? Uint32Array : Uint16Array;
2050
2051
  const points = {
@@ -2071,13 +2072,15 @@ Char: ${this.c}`;
2071
2072
  polygonIndices: polygonPositionsCount > 65535 ? new Uint32Array(polygonObjectsCount + 1) : new Uint16Array(polygonObjectsCount + 1),
2072
2073
  primitivePolygonIndices: polygonPositionsCount > 65535 ? new Uint32Array(polygonRingsCount + 1) : new Uint16Array(polygonRingsCount + 1),
2073
2074
  positions: new PositionDataType(polygonPositionsCount * coordLength),
2074
- triangles: [],
2075
2075
  globalFeatureIds: new GlobalFeatureIdsDataType(polygonPositionsCount),
2076
2076
  featureIds: polygonFeaturesCount > 65535 ? new Uint32Array(polygonPositionsCount) : new Uint16Array(polygonPositionsCount),
2077
2077
  numericProps: {},
2078
2078
  properties: [],
2079
2079
  fields: []
2080
2080
  };
2081
+ if (triangulate) {
2082
+ polygons.triangles = [];
2083
+ }
2081
2084
  for (const object of [points, lines, polygons]) {
2082
2085
  for (const propName of numericPropKeys) {
2083
2086
  const T = propArrayTypes[propName];
@@ -2182,6 +2185,9 @@ Char: ${this.c}`;
2182
2185
  endPosition,
2183
2186
  coordLength
2184
2187
  }) {
2188
+ if (!polygons.triangles) {
2189
+ return;
2190
+ }
2185
2191
  const start = startPosition * coordLength;
2186
2192
  const end = endPosition * coordLength;
2187
2193
  const polygonPositions = polygons.positions.subarray(start, end);
@@ -2200,7 +2206,7 @@ Char: ${this.c}`;
2200
2206
  return returnObj;
2201
2207
  }
2202
2208
  function makeAccessorObjects(points, lines, polygons, coordLength) {
2203
- return {
2209
+ const binaryFeatures = {
2204
2210
  points: {
2205
2211
  ...points,
2206
2212
  positions: { value: points.positions, size: coordLength },
@@ -2221,12 +2227,15 @@ Char: ${this.c}`;
2221
2227
  positions: { value: polygons.positions, size: coordLength },
2222
2228
  polygonIndices: { value: polygons.polygonIndices, size: 1 },
2223
2229
  primitivePolygonIndices: { value: polygons.primitivePolygonIndices, size: 1 },
2224
- triangles: { value: new Uint32Array(polygons.triangles), size: 1 },
2225
2230
  globalFeatureIds: { value: polygons.globalFeatureIds, size: 1 },
2226
2231
  featureIds: { value: polygons.featureIds, size: 1 },
2227
2232
  numericProps: wrapProps(polygons.numericProps, 1)
2228
2233
  }
2229
2234
  };
2235
+ if (polygons.triangles) {
2236
+ binaryFeatures.polygons.triangles = { value: new Uint32Array(polygons.triangles), size: 1 };
2237
+ }
2238
+ return binaryFeatures;
2230
2239
  }
2231
2240
  function fillNumericProperties(object, properties, index, length) {
2232
2241
  for (const numericPropName in object.numericProps) {
@@ -2435,14 +2444,15 @@ Char: ${this.c}`;
2435
2444
  });
2436
2445
 
2437
2446
  // ../gis/src/lib/geojson-to-binary.ts
2438
- function geojsonToBinary(features, options = { fixRingWinding: true }) {
2447
+ function geojsonToBinary(features, options = { fixRingWinding: true, triangulate: true }) {
2439
2448
  const geometryInfo = extractGeometryInfo(features);
2440
2449
  const coordLength = geometryInfo.coordLength;
2441
2450
  const { fixRingWinding } = options;
2442
2451
  const flatFeatures = geojsonToFlatGeojson(features, { coordLength, fixRingWinding });
2443
2452
  return flatGeojsonToBinary(flatFeatures, geometryInfo, {
2444
2453
  numericPropKeys: options.numericPropKeys,
2445
- PositionDataType: options.PositionDataType || Float32Array
2454
+ PositionDataType: options.PositionDataType || Float32Array,
2455
+ triangulate: options.triangulate
2446
2456
  });
2447
2457
  }
2448
2458
  var init_geojson_to_binary = __esm({
@@ -17,7 +17,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
17
17
  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; }
18
18
  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"); }
19
19
  function AsyncFromSyncIterator(s) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var done = r.done; return Promise.resolve(r.value).then(function (value) { return { value: value, done: done }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(s) { this.s = s, this.n = s.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, return: function _return(value) { var ret = this.s.return; return void 0 === ret ? Promise.resolve({ value: value, done: !0 }) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments)); }, throw: function _throw(value) { var thr = this.s.return; return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(s); }
20
- var VERSION = typeof "3.4.8" !== 'undefined' ? "3.4.8" : 'latest';
20
+ var VERSION = typeof "3.4.10" !== 'undefined' ? "3.4.10" : 'latest';
21
21
  var DEFAULT_GEOJSON_LOADER_OPTIONS = {
22
22
  geojson: {
23
23
  shape: 'object-row-table'
@@ -1 +1 @@
1
- {"version":3,"file":"geojson-loader.js","names":["_gis","require","_parseJson","_interopRequireDefault","_parseJsonInBatches","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","_asyncIterator","iterable","method","async","sync","retry","Symbol","asyncIterator","iterator","call","AsyncFromSyncIterator","TypeError","s","AsyncFromSyncIteratorContinuation","r","Promise","reject","done","resolve","value","then","n","next","prototype","return","_return","ret","throw","_throw","thr","VERSION","DEFAULT_GEOJSON_LOADER_OPTIONS","geojson","shape","json","jsonpaths","gis","format","GeoJSONWorkerLoader","name","id","module","version","worker","extensions","mimeTypes","category","text","options","exports","GeoJSONLoader","parse","parseTextSync","parseInBatches","_x2","_x3","_parse","_asyncToGenerator2","_regenerator","mark","_callee2","arrayBuffer","wrap","_callee2$","_context2","prev","abrupt","TextDecoder","decode","stop","parseJSONSync","geojsonToBinary","geojsonIterator","parseJSONInBatches","makeBinaryGeometryIterator","_x","_makeBinaryGeometryIterator","_wrapAsyncGenerator2","_callee","_iteratorAbruptCompletion","_didIteratorError","_iteratorError","_iterator","_step","batch","_callee$","_context","_awaitAsyncGenerator2","sent","data","t0","finish"],"sources":["../../src/geojson-loader.ts"],"sourcesContent":["import type {Loader, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {JSONLoaderOptions} from './json-loader';\nimport {geojsonToBinary} from '@loaders.gl/gis';\nimport parseJSONSync from './lib/parse-json';\nimport parseJSONInBatches from './lib/parse-json-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type GeoJSONLoaderOptions = JSONLoaderOptions & {\n geojson?: {\n shape?: 'object-row-table';\n };\n gis?: {\n format?: 'geojson' | 'binary';\n };\n};\n\nconst DEFAULT_GEOJSON_LOADER_OPTIONS = {\n geojson: {\n shape: 'object-row-table'\n },\n json: {\n jsonpaths: ['$', '$.features']\n },\n gis: {\n format: 'geojson'\n }\n};\n\n/**\n * GeoJSON loader\n */\nexport const GeoJSONWorkerLoader: Loader = {\n name: 'GeoJSON',\n id: 'geojson',\n module: 'geojson',\n version: VERSION,\n worker: true,\n extensions: ['geojson'],\n mimeTypes: ['application/geo+json'],\n category: 'geometry',\n text: true,\n options: DEFAULT_GEOJSON_LOADER_OPTIONS\n};\n\nexport const GeoJSONLoader: LoaderWithParser = {\n ...GeoJSONWorkerLoader,\n parse,\n parseTextSync,\n parseInBatches\n};\n\nasync function parse(arrayBuffer, options) {\n return parseTextSync(new TextDecoder().decode(arrayBuffer), options);\n}\n\nfunction parseTextSync(text, options) {\n // Apps can call the parse method directly, we so apply default options here\n options = {...DEFAULT_GEOJSON_LOADER_OPTIONS, ...options};\n options.json = {...DEFAULT_GEOJSON_LOADER_OPTIONS.geojson, ...options.geojson};\n options.gis = options.gis || {};\n const json = parseJSONSync(text, options);\n switch (options.gis.format) {\n case 'binary':\n return geojsonToBinary(json);\n default:\n return json;\n }\n}\n\nfunction parseInBatches(asyncIterator, options): AsyncIterable<any> {\n // Apps can call the parse method directly, we so apply default options here\n options = {...DEFAULT_GEOJSON_LOADER_OPTIONS, ...options};\n options.json = {...DEFAULT_GEOJSON_LOADER_OPTIONS.geojson, ...options.geojson};\n\n const geojsonIterator = parseJSONInBatches(asyncIterator, options);\n\n switch (options.gis.format) {\n case 'binary':\n return makeBinaryGeometryIterator(geojsonIterator);\n default:\n return geojsonIterator;\n }\n}\n\nasync function* makeBinaryGeometryIterator(geojsonIterator) {\n for await (const batch of geojsonIterator) {\n batch.data = geojsonToBinary(batch.data);\n yield batch;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAEA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAD,sBAAA,CAAAF,OAAA;AAA6D,SAAAI,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wBAAA,CAAAR,MAAA,EAAAO,GAAA,EAAAE,UAAA,OAAAP,IAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,IAAA,EAAAG,OAAA,YAAAH,IAAA;AAAA,SAAAU,cAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,WAAAF,SAAA,CAAAD,CAAA,IAAAC,SAAA,CAAAD,CAAA,QAAAA,CAAA,OAAAf,OAAA,CAAAI,MAAA,CAAAc,MAAA,OAAAC,OAAA,WAAAC,GAAA,QAAAC,gBAAA,CAAAC,OAAA,EAAAR,MAAA,EAAAM,GAAA,EAAAF,MAAA,CAAAE,GAAA,SAAAhB,MAAA,CAAAmB,yBAAA,GAAAnB,MAAA,CAAAoB,gBAAA,CAAAV,MAAA,EAAAV,MAAA,CAAAmB,yBAAA,CAAAL,MAAA,KAAAlB,OAAA,CAAAI,MAAA,CAAAc,MAAA,GAAAC,OAAA,WAAAC,GAAA,IAAAhB,MAA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AC;UAACH,QAAA,CAAAhE,IAAA;UACzC,OAAM8D,KAAK;QAAA;UAAAL,yBAAA;UAAAO,QAAA,CAAAhE,IAAA;UAAA;QAAA;UAAAgE,QAAA,CAAAhE,IAAA;UAAA;QAAA;UAAAgE,QAAA,CAAArB,IAAA;UAAAqB,QAAA,CAAAI,EAAA,GAAAJ,QAAA;UAAAN,iBAAA;UAAAC,cAAA,GAAAK,QAAA,CAAAI,EAAA;QAAA;UAAAJ,QAAA,CAAArB,IAAA;UAAAqB,QAAA,CAAArB,IAAA;UAAA,MAAAc,yBAAA,IAAAG,SAAA,CAAA1D,MAAA;YAAA8D,QAAA,CAAAhE,IAAA;YAAA;UAAA;UAAAgE,QAAA,CAAAhE,IAAA;UAAA,WAAAiE,qBAAA,CAAA3F,OAAA,EAAAsF,SAAA,CAAA1D,MAAA;QAAA;UAAA8D,QAAA,CAAArB,IAAA;UAAA,KAAAe,iBAAA;YAAAM,QAAA,CAAAhE,IAAA;YAAA;UAAA;UAAA,MAAA2D,cAAA;QAAA;UAAA,OAAAK,QAAA,CAAAK,MAAA;QAAA;UAAA,OAAAL,QAAA,CAAAK,MAAA;QAAA;QAAA;UAAA,OAAAL,QAAA,CAAAjB,IAAA;MAAA;IAAA,GAAAS,OAAA;EAAA,CAEd;EAAA,OAAAF,2BAAA,CAAA1F,KAAA,OAAAI,SAAA;AAAA"}
1
+ {"version":3,"file":"geojson-loader.js","names":["_gis","require","_parseJson","_interopRequireDefault","_parseJsonInBatches","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","_asyncIterator","iterable","method","async","sync","retry","Symbol","asyncIterator","iterator","call","AsyncFromSyncIterator","TypeError","s","AsyncFromSyncIteratorContinuation","r","Promise","reject","done","resolve","value","then","n","next","prototype","return","_return","ret","throw","_throw","thr","VERSION","DEFAULT_GEOJSON_LOADER_OPTIONS","geojson","shape","json","jsonpaths","gis","format","GeoJSONWorkerLoader","name","id","module","version","worker","extensions","mimeTypes","category","text","options","exports","GeoJSONLoader","parse","parseTextSync","parseInBatches","_x2","_x3","_parse","_asyncToGenerator2","_regenerator","mark","_callee2","arrayBuffer","wrap","_callee2$","_context2","prev","abrupt","TextDecoder","decode","stop","parseJSONSync","geojsonToBinary","geojsonIterator","parseJSONInBatches","makeBinaryGeometryIterator","_x","_makeBinaryGeometryIterator","_wrapAsyncGenerator2","_callee","_iteratorAbruptCompletion","_didIteratorError","_iteratorError","_iterator","_step","batch","_callee$","_context","_awaitAsyncGenerator2","sent","data","t0","finish"],"sources":["../../src/geojson-loader.ts"],"sourcesContent":["import type {Loader, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {JSONLoaderOptions} from './json-loader';\nimport {geojsonToBinary} from '@loaders.gl/gis';\nimport parseJSONSync from './lib/parse-json';\nimport parseJSONInBatches from './lib/parse-json-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type GeoJSONLoaderOptions = JSONLoaderOptions & {\n geojson?: {\n shape?: 'object-row-table';\n };\n gis?: {\n format?: 'geojson' | 'binary';\n };\n};\n\nconst DEFAULT_GEOJSON_LOADER_OPTIONS = {\n geojson: {\n shape: 'object-row-table'\n },\n json: {\n jsonpaths: ['$', '$.features']\n },\n gis: {\n format: 'geojson'\n }\n};\n\n/**\n * GeoJSON loader\n */\nexport const GeoJSONWorkerLoader: Loader = {\n name: 'GeoJSON',\n id: 'geojson',\n module: 'geojson',\n version: VERSION,\n worker: true,\n extensions: ['geojson'],\n mimeTypes: ['application/geo+json'],\n category: 'geometry',\n text: true,\n options: DEFAULT_GEOJSON_LOADER_OPTIONS\n};\n\nexport const GeoJSONLoader: LoaderWithParser = {\n ...GeoJSONWorkerLoader,\n parse,\n parseTextSync,\n parseInBatches\n};\n\nasync function parse(arrayBuffer, options) {\n return parseTextSync(new TextDecoder().decode(arrayBuffer), options);\n}\n\nfunction parseTextSync(text, options) {\n // Apps can call the parse method directly, we so apply default options here\n options = {...DEFAULT_GEOJSON_LOADER_OPTIONS, ...options};\n options.json = {...DEFAULT_GEOJSON_LOADER_OPTIONS.geojson, ...options.geojson};\n options.gis = options.gis || {};\n const json = parseJSONSync(text, options);\n switch (options.gis.format) {\n case 'binary':\n return geojsonToBinary(json);\n default:\n return json;\n }\n}\n\nfunction parseInBatches(asyncIterator, options): AsyncIterable<any> {\n // Apps can call the parse method directly, we so apply default options here\n options = {...DEFAULT_GEOJSON_LOADER_OPTIONS, ...options};\n options.json = {...DEFAULT_GEOJSON_LOADER_OPTIONS.geojson, ...options.geojson};\n\n const geojsonIterator = parseJSONInBatches(asyncIterator, options);\n\n switch (options.gis.format) {\n case 'binary':\n return makeBinaryGeometryIterator(geojsonIterator);\n default:\n return geojsonIterator;\n }\n}\n\nasync function* makeBinaryGeometryIterator(geojsonIterator) {\n for await (const batch of geojsonIterator) {\n batch.data = geojsonToBinary(batch.data);\n yield batch;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAEA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAD,sBAAA,CAAAF,OAAA;AAA6D,SAAAI,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wBAAA,CAAAR,MAAA,EAAAO,GAAA,EAAAE,UAAA,OAAAP,IAAA,CAAAQ,IAAA,CAAAC,KA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AA;UAAA,OAAAL,QAAA,CAAAK,MAAA;QAAA;QAAA;UAAA,OAAAL,QAAA,CAAAjB,IAAA;MAAA;IAAA,GAAAS,OAAA;EAAA,CAEd;EAAA,OAAAF,2BAAA,CAAA1F,KAAA,OAAAI,SAAA;AAAA"}
@@ -12,7 +12,7 @@ var _parseJson = _interopRequireDefault(require("./lib/parse-json"));
12
12
  var _parseJsonInBatches = _interopRequireDefault(require("./lib/parse-json-in-batches"));
13
13
  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; }
14
14
  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; }
15
- var VERSION = typeof "3.4.8" !== 'undefined' ? "3.4.8" : 'latest';
15
+ var VERSION = typeof "3.4.10" !== 'undefined' ? "3.4.10" : 'latest';
16
16
  var DEFAULT_JSON_LOADER_OPTIONS = {
17
17
  json: {
18
18
  shape: 'row-table',
@@ -1 +1 @@
1
- {"version":3,"file":"json-loader.js","names":["_parseJson","_interopRequireDefault","require","_parseJsonInBatches","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","VERSION","DEFAULT_JSON_LOADER_OPTIONS","json","shape","table","jsonpaths","JSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parse","parseTextSync","parseInBatches","options","exports","_x","_x2","_parse","_asyncToGenerator2","_regenerator","mark","_callee","arrayBuffer","wrap","_callee$","_context","prev","next","abrupt","TextDecoder","decode","stop","jsonOptions","parseJSONSync","asyncIterator","parseJSONInBatches"],"sources":["../../src/json-loader.ts"],"sourcesContent":["import type {Batch} from '@loaders.gl/schema';\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport parseJSONSync from './lib/parse-json';\nimport parseJSONInBatches from './lib/parse-json-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * @param table -\n * @param jsonpaths -\n */\nexport type JSONLoaderOptions = LoaderOptions & {\n json?: {\n shape?: 'row-table';\n table?: false;\n jsonpaths?: string[];\n };\n};\n\nconst DEFAULT_JSON_LOADER_OPTIONS = {\n json: {\n shape: 'row-table',\n table: false,\n jsonpaths: []\n // batchSize: 'auto'\n }\n};\n\nexport const JSONLoader: LoaderWithParser = {\n name: 'JSON',\n id: 'json',\n module: 'json',\n version: VERSION,\n extensions: ['json', 'geojson'],\n mimeTypes: ['application/json'],\n category: 'table',\n text: true,\n parse,\n parseTextSync,\n parseInBatches,\n options: DEFAULT_JSON_LOADER_OPTIONS\n};\n\nasync function parse(arrayBuffer: ArrayBuffer, options?: JSONLoaderOptions) {\n return parseTextSync(new TextDecoder().decode(arrayBuffer), options);\n}\n\nfunction parseTextSync(text: string, options?: JSONLoaderOptions) {\n const jsonOptions = {...options, json: {...DEFAULT_JSON_LOADER_OPTIONS.json, ...options?.json}};\n return parseJSONSync(text, jsonOptions as JSONLoaderOptions);\n}\n\nfunction parseInBatches(\n asyncIterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n options?: JSONLoaderOptions\n): AsyncIterable<Batch> {\n const jsonOptions = {...options, json: {...DEFAULT_JSON_LOADER_OPTI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,aAAaA,CAACF,IAAY,EAAEI,OAA2B,EAAE;EAChE,IAAMmB,WAAW,GAAAlD,aAAA,CAAAA,aAAA,KAAO+B,OAAO;IAAEhB,IAAI,EAAAf,aAAA,CAAAA,aAAA,KAAMc,2BAA2B,CAACC,IAAI,GAAKgB,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEhB,IAAI;EAAC,EAAC;EAC/F,OAAO,IAAAoC,kBAAa,EAACxB,IAAI,EAAEuB,WAAgC,CAAC;AAC9D;AAEA,SAASpB,cAAcA,CACrBsB,aAAiE,EACjErB,OAA2B,EACL;EACtB,IAAMmB,WAAW,GAAAlD,aAAA,CAAAA,aAAA,KAAO+B,OAAO;IAAEhB,IAAI,EAAAf,aAAA,CAAAA,aAAA,KAAMc,2BAA2B,CAACC,IAAI,GAAKgB,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEhB,IAAI;EAAC,EAAC;EAC/F,OAAO,IAAAsC,2BAAkB,EAACD,aAAa,EAAEF,WAAgC,CAAC;AAC5E"}
1
+ {"version":3,"file":"json-loader.js","names":["_parseJson","_interopRequireDefault","require","_parseJsonInBatches","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","VERSION","DEFAULT_JSON_LOADER_OPTIONS","json","shape","table","jsonpaths","JSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parse","parseTextSync","parseInBatches","options","exports","_x","_x2","_parse","_asyncToGenerator2","_regenerator","mark","_callee","arrayBuffer","wrap","_callee$","_context","prev","next","abrupt","TextDecoder","decode","stop","jsonOptions","parseJSONSync","asyncIterator","parseJSONInBatches"],"sources":["../../src/json-loader.ts"],"sourcesContent":["import type {Batch} from '@loaders.gl/schema';\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport parseJSONSync from './lib/parse-json';\nimport parseJSONInBatches from './lib/parse-json-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * @param table -\n * @param jsonpaths -\n */\nexport type JSONLoaderOptions = LoaderOptions & {\n json?: {\n shape?: 'row-table';\n table?: false;\n jsonpaths?: string[];\n };\n};\n\nconst DEFAULT_JSON_LOADER_OPTIONS = {\n json: {\n shape: 'row-table',\n table: false,\n jsonpaths: []\n // batchSize: 'auto'\n }\n};\n\nexport const JSONLoader: LoaderWithParser = {\n name: 'JSON',\n id: 'json',\n module: 'json',\n version: VERSION,\n extensions: ['json', 'geojson'],\n mimeTypes: ['application/json'],\n category: 'table',\n text: true,\n parse,\n parseTextSync,\n parseInBatches,\n options: DEFAULT_JSON_LOADER_OPTIONS\n};\n\nasync function parse(arrayBuffer: ArrayBuffer, options?: JSONLoaderOptions) {\n return parseTextSync(new TextDecoder().decode(arrayBuffer), options);\n}\n\nfunction parseTextSync(text: string, options?: JSONLoaderOptions) {\n const jsonOptions = {...options, json: {...DEFAULT_JSON_LOADER_OPTIONS.json, ...options?.json}};\n return parseJSONSync(text, jsonOptions as JSONLoaderOptions);\n}\n\nfunction parseInBatches(\n asyncIterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n options?: JSONLoaderOptions\n): AsyncIterable<Batch> {\n const jsonOptions = {...options, json: {...DEFAULT_JSON_LOADER_OPTIONS.json, ...options?.json}};\n return parseJSONInBatches(asyncIterator, jsonOptions as JSONLoaderOptions);\n}\n"],"mappings":";;;;;;;;;;AAEA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA6D,SAAAE,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,C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,WAAgC,CAAC;AAC9D;AAEA,SAASpB,cAAcA,CACrBsB,aAAiE,EACjErB,OAA2B,EACL;EACtB,IAAMmB,WAAW,GAAAlD,aAAA,CAAAA,aAAA,KAAO+B,OAAO;IAAEhB,IAAI,EAAAf,aAAA,CAAAA,aAAA,KAAMc,2BAA2B,CAACC,IAAI,GAAKgB,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEhB,IAAI;EAAC,EAAC;EAC/F,OAAO,IAAAsC,2BAAkB,EAACD,aAAa,EAAEF,WAAgC,CAAC;AAC5E"}
@@ -9,7 +9,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
9
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
10
  var _parseNdjson = _interopRequireDefault(require("./lib/parse-ndjson"));
11
11
  var _parseNdjsonInBatches = _interopRequireDefault(require("./lib/parse-ndjson-in-batches"));
12
- var VERSION = typeof "3.4.8" !== 'undefined' ? "3.4.8" : 'latest';
12
+ var VERSION = typeof "3.4.10" !== 'undefined' ? "3.4.10" : 'latest';
13
13
  var DEFAULT_NDGEOJSON_LOADER_OPTIONS = {
14
14
  geojson: {
15
15
  shape: 'object-row-table'
@@ -1 +1 @@
1
- {"version":3,"file":"ndgeoson-loader.js","names":["_parseNdjson","_interopRequireDefault","require","_parseNdjsonInBatches","VERSION","DEFAULT_NDGEOJSON_LOADER_OPTIONS","geojson","shape","gis","format","NDJSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parse","_parse","_asyncToGenerator2","default","_regenerator","mark","_callee","arrayBuffer","wrap","_callee$","_context","prev","next","abrupt","parseNDJSONSync","TextDecoder","decode","stop","_x","apply","arguments","parseTextSync","parseInBatches","parseNDJSONInBatches","options","exports","_typecheckNDJSONLoader"],"sources":["../../src/ndgeoson-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport parseNDJSONSync from './lib/parse-ndjson';\nimport parseNDJSONInBatches from './lib/parse-ndjson-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type NDGeoJSONLoaderOptions = LoaderOptions & {\n geojson?: {\n shape?: 'object-row-table';\n };\n gis?: {\n format: 'geojson';\n };\n};\n\nconst DEFAULT_NDGEOJSON_LOADER_OPTIONS = {\n geojson: {\n shape: 'object-row-table'\n },\n gis: {\n format: 'geojson'\n }\n};\n\nexport const NDJSONLoader = {\n name: 'NDJSON',\n id: 'ndjson',\n module: 'json',\n version: VERSION,\n extensions: ['ndjson', 'ndgeojson'],\n mimeTypes: [\n 'application/geo+x-ndjson',\n 'application/geo+x-ldjson',\n 'application/jsonlines', // https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html#cm-batch\n 'application/geo+json-seq',\n 'application/x-ndjson'\n ],\n category: 'table',\n text: true,\n parse: async (arrayBuffer: ArrayBuffer) => parseNDJSONSync(new TextDecoder().decode(arrayBuffer)),\n parseTextSync: parseNDJSONSync,\n parseInBatches: parseNDJSONInBatches,\n options: DEFAULT_NDGEOJSON_LOADER_OPTIONS\n};\n\nexport const _typecheckNDJSONLoader: LoaderWithParser = NDJSONLoader;\n"],"mappings":";;;;;;;;;AACA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAIA,IAAME,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAW3E,IAAMC,gCAAgC,GAAG;EACvCC,OAAO,EAAE;IACPC,KAAK,EAAE;EACT,CAAC;EACDC,GAAG,EAAE;IACHC,MAAM,EAAE;EACV;AACF,CAAC;AAEM,IAAMC,YAAY,GAAG;EAC1BC,IAAI,EAAE,QAAQ;EACdC,EAAE,EAAE,QAAQ;EACZC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEV,OAAO;EAChBW,UAAU,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC;EACnCC,SAAS,EAAE,CACT,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,CACvB;EACDC,QAAQ,EAAE,OAAO;EACjBC,IAAI,EAAE,IAAI;EACVC,KAAK;IAAA,IAAAC,MAAA,OAAAC,kBAAA,CAAAC,OAAA,EAAAC,YAAA,CAAAD,OAAA,CAAAE,IAAA,CAAE,SAAAC,QAAOC,WAAwB;MAAA,OAAAH,YAAA,CAAAD,OAAA,CAAAK,IAAA,UAAAC,SAAAC,QAAA;QAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;UAAA;YAAA,OAAAF,QAAA,CAAAG,MAAA,WAAK,IAAAC,oBAAe,EAAC,IAAIC,WAAW,CAAC,CAAC,CAACC,MAAM,CAACT,WAAW,CAAC,CAAC;UAAA;UAAA;YAAA,OAAAG,QAAA,CAAAO,IAAA;QAAA;MAAA,GAAAX,OAAA;IAAA;IAAA,SAAAN,MAAAkB,EAAA;MAAA,OAAAjB,MAAA,CAAAkB,KAAA,OAAAC,SAAA;IAAA;IAAA,OAAApB,KAAA;EAAA;EACjGqB,aAAa,EAAEP,oBAAe;EAC9BQ,cAAc,EAAEC,6BAAoB;EACpCC,OAAO,EAAEtC;AACX,CAAC;AAACuC,OAAA,CAAAlC,YAAA,GAAAA,YAAA;AAEK,IAAMmC,sBAAwC,GAAGnC,YAAY;AAACkC,OAAA,CAAAC,sBAAA,GAAAA,sBAAA"}
1
+ {"version":3,"file":"ndgeoson-loader.js","names":["_parseNdjson","_interopRequireDefault","require","_parseNdjsonInBatches","VERSION","DEFAULT_NDGEOJSON_LOADER_OPTIONS","geojson","shape","gis","format","NDJSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parse","_parse","_asyncToGenerator2","default","_regenerator","mark","_callee","arrayBuffer","wrap","_callee$","_context","prev","next","abrupt","parseNDJSONSync","TextDecoder","decode","stop","_x","apply","arguments","parseTextSync","parseInBatches","parseNDJSONInBatches","options","exports","_typecheckNDJSONLoader"],"sources":["../../src/ndgeoson-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport parseNDJSONSync from './lib/parse-ndjson';\nimport parseNDJSONInBatches from './lib/parse-ndjson-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type NDGeoJSONLoaderOptions = LoaderOptions & {\n geojson?: {\n shape?: 'object-row-table';\n };\n gis?: {\n format: 'geojson';\n };\n};\n\nconst DEFAULT_NDGEOJSON_LOADER_OPTIONS = {\n geojson: {\n shape: 'object-row-table'\n },\n gis: {\n format: 'geojson'\n }\n};\n\nexport const NDJSONLoader = {\n name: 'NDJSON',\n id: 'ndjson',\n module: 'json',\n version: VERSION,\n extensions: ['ndjson', 'ndgeojson'],\n mimeTypes: [\n 'application/geo+x-ndjson',\n 'application/geo+x-ldjson',\n 'application/jsonlines', // https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html#cm-batch\n 'application/geo+json-seq',\n 'application/x-ndjson'\n ],\n category: 'table',\n text: true,\n parse: async (arrayBuffer: ArrayBuffer) => parseNDJSONSync(new TextDecoder().decode(arrayBuffer)),\n parseTextSync: parseNDJSONSync,\n parseInBatches: parseNDJSONInBatches,\n options: DEFAULT_NDGEOJSON_LOADER_OPTIONS\n};\n\nexport const _typecheckNDJSONLoader: LoaderWithParser = NDJSONLoader;\n"],"mappings":";;;;;;;;;AACA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAIA,IAAME,OAAO,GAAG,eAAkB,KAAK,WAAW,cAAiB,QAAQ;AAW3E,IAAMC,gCAAgC,GAAG;EACvCC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equireDefault(require("@babel/runtime/regenerator"))
9
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
10
  var _parseNdjson = _interopRequireDefault(require("./lib/parse-ndjson"));
11
11
  var _parseNdjsonInBatches = _interopRequireDefault(require("./lib/parse-ndjson-in-batches"));
12
- var VERSION = typeof "3.4.8" !== 'undefined' ? "3.4.8" : 'latest';
12
+ var VERSION = typeof "3.4.10" !== 'undefined' ? "3.4.10" : 'latest';
13
13
  var NDJSONLoader = {
14
14
  name: 'NDJSON',
15
15
  id: 'ndjson',
@@ -1 +1 @@
1
- {"version":3,"file":"ndjson-loader.js","names":["_parseNdjson","_interopRequireDefault","require","_parseNdjsonInBatches","VERSION","NDJSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parse","_parse","_asyncToGenerator2","default","_regenerator","mark","_callee","arrayBuffer","wrap","_callee$","_context","prev","next","abrupt","parseNDJSONSync","TextDecoder","decode","stop","_x","apply","arguments","parseTextSync","parseInBatches","parseNDJSONInBatches","options","exports"],"sources":["../../src/ndjson-loader.ts"],"sourcesContent":["import parseNDJSONSync from './lib/parse-ndjson';\nimport parseNDJSONInBatches from './lib/parse-ndjson-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport const NDJSONLoader = {\n name: 'NDJSON',\n id: 'ndjson',\n module: 'json',\n version: VERSION,\n extensions: ['ndjson', 'jsonl'],\n mimeTypes: [\n 'application/x-ndjson',\n 'application/jsonlines', // https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html#cm-batch\n 'application/json-seq'\n ],\n category: 'table',\n text: true,\n parse: async (arrayBuffer: ArrayBuffer) => parseNDJSONSync(new TextDecoder().decode(arrayBuffer)),\n parseTextSync: parseNDJSONSync,\n parseInBatches: parseNDJSONInBatches,\n options: {}\n};\n"],"mappings":";;;;;;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","NDJSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parse","_parse","_asyncToGenerator2","default","_regenerator","mark","_callee","arrayBuffer","wrap","_callee$","_context","prev","next","abrupt","parseNDJSONSync","TextDecoder","decode","stop","_x","apply","arguments","parseTextSync","parseInBatches","parseNDJSONInBatches","options","exports"],"sources":["../../src/ndjson-loader.ts"],"sourcesContent":["import parseNDJSONSync from './lib/parse-ndjson';\nimport parseNDJSONInBatches from './lib/parse-ndjson-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport const NDJSONLoader = {\n name: 'NDJSON',\n id: 'ndjson',\n module: 'json',\n version: VERSION,\n extensions: ['ndjson', 'jsonl'],\n mimeTypes: [\n 'application/x-ndjson',\n 'application/jsonlines', // https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html#cm-batch\n 'application/json-seq'\n ],\n category: 'table',\n text: true,\n parse: async (arrayBuffer: ArrayBuffer) => parseNDJSONSync(new TextDecoder().decode(arrayBuffer)),\n parseTextSync: parseNDJSONSync,\n parseInBatches: parseNDJSONInBatches,\n options: {}\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAIA,IAAME,OAAO,GAAG,eAAkB,KAAK,WAAW,cAAiB,QAAQ;AAEpE,IAAMC,YAAY,GAAG;EAC1BC,IAAI,EAAE,QAAQ;EACdC,EAAE,EAAE,QAAQ;EACZC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEL,OAAO;EAChBM,UAAU,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;EAC/BC,SAAS,EAAE,CACT,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,CACvB;EACDC,QAAQ,EAAE,OAAO;EACjBC,IAAI,EAAE,IAAI;EACVC,KAAK;IAAA,IAAAC,MAAA,OAAAC,kBAAA,CAAAC,OAAA,EAAAC,YAAA,CAAAD,OAAA,CAAAE,IAAA,CAAE,SAAAC,QAAOC,WAAwB;MAAA,OAAAH,YAAA,CAAAD,OAAA,CAAAK,IAAA,UAAAC,SAAAC,QAAA;QAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;UAAA;YAAA,OAAAF,QAAA,CAAAG,MAAA,WAAK,IAAAC,oBAAe,EAAC,IAAIC,WAAW,CAAC,CAAC,CAACC,MAAM,CAACT,WAAW,CAAC,CAAC;UAAA;UAAA;YAAA,OAAAG,QAAA,CAAAO,IAAA;QAAA;MAAA,GAAAX,OAAA;IAAA;IAAA,SAAAN,MAAAkB,EAAA;MAAA,OAAAjB,MAAA,CAAAkB,KAAA,OAAAC,SAAA;IAAA;IAAA,OAAApB,KAAA;EAAA;EACjGqB,aAAa,EAAEP,oBAAe;EAC9BQ,cAAc,EAAEC,6BAAoB;EACpCC,OAAO,EAAE,CAAC;AACZ,CAAC;AAACC,OAAA,CAAAlC,YAAA,GAAAA,YAAA"}
@@ -1,7 +1,7 @@
1
1
  import { geojsonToBinary } from '@loaders.gl/gis';
2
2
  import parseJSONSync from './lib/parse-json';
3
3
  import parseJSONInBatches from './lib/parse-json-in-batches';
4
- const VERSION = typeof "3.4.8" !== 'undefined' ? "3.4.8" : 'latest';
4
+ const VERSION = typeof "3.4.10" !== 'undefined' ? "3.4.10" : 'latest';
5
5
  const DEFAULT_GEOJSON_LOADER_OPTIONS = {
6
6
  geojson: {
7
7
  shape: 'object-row-table'
@@ -1 +1 @@
1
- {"version":3,"file":"geojson-loader.js","names":["geojsonToBinary","parseJSONSync","parseJSONInBatches","VERSION","DEFAULT_GEOJSON_LOADER_OPTIONS","geojson","shape","json","jsonpaths","gis","format","GeoJSONWorkerLoader","name","id","module","version","worker","extensions","mimeTypes","category","text","options","GeoJSONLoader","parse","parseTextSync","parseInBatches","arrayBuffer","TextDecoder","decode","asyncIterator","geojsonIterator","makeBinaryGeometryIterator","batch","data"],"sources":["../../src/geojson-loader.ts"],"sourcesContent":["import type {Loader, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {JSONLoaderOptions} from './json-loader';\nimport {geojsonToBinary} from '@loaders.gl/gis';\nimport parseJSONSync from './lib/parse-json';\nimport parseJSONInBatches from './lib/parse-json-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type GeoJSONLoaderOptions = JSONLoaderOptions & {\n geojson?: {\n shape?: 'object-row-table';\n };\n gis?: {\n format?: 'geojson' | 'binary';\n };\n};\n\nconst DEFAULT_GEOJSON_LOADER_OPTIONS = {\n geojson: {\n shape: 'object-row-table'\n },\n json: {\n jsonpaths: ['$', '$.features']\n },\n gis: {\n format: 'geojson'\n }\n};\n\n/**\n * GeoJSON loader\n */\nexport const GeoJSONWorkerLoader: Loader = {\n name: 'GeoJSON',\n id: 'geojson',\n module: 'geojson',\n version: VERSION,\n worker: true,\n extensions: ['geojson'],\n mimeTypes: ['application/geo+json'],\n category: 'geometry',\n text: true,\n options: DEFAULT_GEOJSON_LOADER_OPTIONS\n};\n\nexport const GeoJSONLoader: LoaderWithParser = {\n ...GeoJSONWorkerLoader,\n parse,\n parseTextSync,\n parseInBatches\n};\n\nasync function parse(arrayBuffer, options) {\n return parseTextSync(new TextDecoder().decode(arrayBuffer), options);\n}\n\nfunction parseTextSync(text, options) {\n // Apps can call the parse method directly, we so apply default options here\n options = {...DEFAULT_GEOJSON_LOADER_OPTIONS, ...options};\n options.json = {...DEFAULT_GEOJSON_LOADER_OPTIONS.geojson, ...options.geojson};\n options.gis = options.gis || {};\n const json = parseJSONSync(text, options);\n switch (options.gis.format) {\n case 'binary':\n return geojsonToBinary(json);\n default:\n return json;\n }\n}\n\nfunction parseInBatches(asyncIterator, options): AsyncIterable<any> {\n // Apps can call the parse method directly, we so apply default options here\n options = {...DEFAULT_GEOJSON_LOADER_OPTIONS, ...options};\n options.json = {...DEFAULT_GEOJSON_LOADER_OPTIONS.geojson, ...options.geojson};\n\n const geojsonIterator = parseJSONInBatches(asyncIterator, options);\n\n switch (options.gis.format) {\n case 'binary':\n return makeBinaryGeometryIterator(geojsonIterator);\n default:\n return geojsonIterator;\n }\n}\n\nasync function* makeBinaryGeometryIterator(geojsonIterator) {\n for await (const batch of geojsonIterator) {\n batch.data = geojsonToBinary(batch.data);\n yield batch;\n }\n}\n"],"mappings":"AAEA,SAAQA,eAAe,QAAO,iBAAiB;AAC/C,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,kBAAkB,MAAM,6BAA6B;AAI5D,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAW3E,MAAMC,8BAA8B,GAAG;EACrCC,OAAO,EAAE;IACPC,KAAK,EAAE;EACT,CAAC;EACDC,IAAI,EAAE;IACJC,SAAS,EAAE,CAAC,GAAG,EAAE,YAAY;EAC/B,CAAC;EACDC,GAAG,EAAE;IACHC,MAAM,EAAE;EACV;AACF,CAAC;AAKD,OAAO,MAAMC,mBAA2B,GAAG;EACzCC,IAAI,EAAE,SAAS;EACfC,EAAE,EAAE,SAAS;EACbC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAEZ,OAAO;EAChBa,MAAM,EAAE,IAAI;EACZC,UAAU,EAAE,CAAC,SAAS,CAAC;EACvBC,SAAS,EAAE,CAAC,sBAAsB,CAAC;EACnCC,QAAQ,EAAE,UAAU;EACpBC,IAAI,EAAE,IAAI;EACVC,OAAO,EAAEjB;AACX,CAAC;AAED,OAAO,MAAMkB,aAA+B,GAAG;EAC7C,GAAGX,mBAAmB;EACtBY,KAAK;EACLC,aAAa;EACbC;AACF,CAAC;AAED,eAAeF,KAAKA,CAACG,WAAW,EAAEL,OAAO,EAAE;EACzC,OAAOG,aAAa,CAAC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.js","names":["geojsonToBinary","parseJSONSync","parseJSONInBatches","VERSION","DEFAULT_GEOJSON_LOADER_OPTIONS","geojson","shape","json","jsonpaths","gis","format","GeoJSONWorkerLoader","name","id","module","version","worker","extensions","mimeTypes","category","text","options","GeoJSONLoader","parse","parseTextSync","parseInBatches","arrayBuffer","TextDecoder","decode","asyncIterator","geojsonIterator","makeBinaryGeometryIterator","batch","data"],"sources":["../../src/geojson-loader.ts"],"sourcesContent":["import type {Loader, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {JSONLoaderOptions} from './json-loader';\nimport {geojsonToBinary} from '@loaders.gl/gis';\nimport parseJSONSync from './lib/parse-json';\nimport parseJSONInBatches from './lib/parse-json-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type GeoJSONLoaderOptions = JSONLoaderOptions & {\n geojson?: {\n shape?: 'object-row-table';\n };\n gis?: {\n format?: 'geojson' | 'binary';\n };\n};\n\nconst DEFAULT_GEOJSON_LOADER_OPTIONS = {\n geojson: {\n shape: 'object-row-table'\n },\n json: {\n jsonpaths: ['$', '$.features']\n },\n gis: {\n format: 'geojson'\n }\n};\n\n/**\n * GeoJSON loader\n */\nexport const GeoJSONWorkerLoader: Loader = {\n name: 'GeoJSON',\n id: 'geojson',\n module: 'geojson',\n version: VERSION,\n worker: true,\n extensions: ['geojson'],\n mimeTypes: ['application/geo+json'],\n category: 'geometry',\n text: true,\n options: DEFAULT_GEOJSON_LOADER_OPTIONS\n};\n\nexport const GeoJSONLoader: LoaderWithParser = {\n ...GeoJSONWorkerLoader,\n parse,\n parseTextSync,\n parseInBatches\n};\n\nasync function parse(arrayBuffer, options) {\n return parseTextSync(new TextDecoder().decode(arrayBuffer), options);\n}\n\nfunction parseTextSync(text, options) {\n // Apps can call the parse method directly, we so apply default options here\n options = {...DEFAULT_GEOJSON_LOADER_OPTIONS, ...options};\n options.json = {...DEFAULT_GEOJSON_LOADER_OPTIONS.geojson, ...options.geojson};\n options.gis = options.gis || {};\n const json = parseJSONSync(text, options);\n switch (options.gis.format) {\n case 'binary':\n return geojsonToBinary(json);\n default:\n return json;\n }\n}\n\nfunction parseInBatches(asyncIterator, options): AsyncIterable<any> {\n // Apps can call the parse method directly, we so apply default options here\n options = {...DEFAULT_GEOJSON_LOADER_OPTIONS, ...options};\n options.json = {...DEFAULT_GEOJSON_LOADER_OPTIONS.geojson, ...options.geojson};\n\n const geojsonIterator = parseJSONInBatches(asyncIterator, options);\n\n switch (options.gis.format) {\n case 'binary':\n return makeBinaryGeometryIterator(geojsonIterator);\n default:\n return geojsonIterator;\n }\n}\n\nasync function* makeBinaryGeometryIterator(geojsonIterator) {\n for await (const batch of geojsonIterator) {\n batch.data = geojsonToBinary(batch.data);\n yield batch;\n }\n}\n"],"mappings":"AAEA,SAAQA,eAAe,QAAO,iBAAiB;AAC/C,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,kBAAkB,MAAM,6BAA6B;AAI5D,MAAMC,OAAO,GAAG,eAAkB,KAAK,WAAW,cAAiB,QAAQ;AAW3E,MAAMC,8BAA8B,GAAG;EACrCC,OAAO,EAAE;IACPC,KAAK,EAAE;EACT,CAAC;EACDC,IAAI,EAAE;IACJC,SAAS,EAAE,CAAC,GAAG,EAAE,YAAY;EAC/B,CAAC;EACDC,GAAG,EAAE;IACHC,MAAM,EAAE;EACV;AACF,CAAC;AAKD,OAAO,MAAMC,mBAA2B,GAAG;EACzCC,IAAI,EAAE,SAAS;EACfC,EAAE,EAAE,SAAS;EACbC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAEZ,OAAO;EAChBa,MAAM,EAAE,IAAI;EACZC,UAAU,EAAE,CAAC,SAAS,CAAC;EACvBC,SAAS,EAAE,CAAC,sBAAsB,CAAC;EACnCC,QAAQ,EAAE,UAAU;EACpBC,IAAI,EAAE,IAAI;EACVC,OAAO,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A,CAACD,eAAe,EAAE;EAC1D,WAAW,MAAME,KAAK,IAAIF,eAAe,EAAE;IACzCE,KAAK,CAACC,IAAI,GAAGjC,eAAe,CAACgC,KAAK,CAACC,IAAI,CAAC;IACxC,MAAMD,KAAK;EACb;AACF"}
@@ -1,6 +1,6 @@
1
1
  import parseJSONSync from './lib/parse-json';
2
2
  import parseJSONInBatches from './lib/parse-json-in-batches';
3
- const VERSION = typeof "3.4.8" !== 'undefined' ? "3.4.8" : 'latest';
3
+ const VERSION = typeof "3.4.10" !== 'undefined' ? "3.4.10" : 'latest';
4
4
  const DEFAULT_JSON_LOADER_OPTIONS = {
5
5
  json: {
6
6
  shape: 'row-table',
@@ -1 +1 @@
1
- {"version":3,"file":"json-loader.js","names":["parseJSONSync","parseJSONInBatches","VERSION","DEFAULT_JSON_LOADER_OPTIONS","json","shape","table","jsonpaths","JSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parse","parseTextSync","parseInBatches","options","arrayBuffer","TextDecoder","decode","jsonOptions","asyncIterator"],"sources":["../../src/json-loader.ts"],"sourcesContent":["import type {Batch} from '@loaders.gl/schema';\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport parseJSONSync from './lib/parse-json';\nimport parseJSONInBatches from './lib/parse-json-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * @param table -\n * @param jsonpaths -\n */\nexport type JSONLoaderOptions = LoaderOptions & {\n json?: {\n shape?: 'row-table';\n table?: false;\n jsonpaths?: string[];\n };\n};\n\nconst DEFAULT_JSON_LOADER_OPTIONS = {\n json: {\n shape: 'row-table',\n table: false,\n jsonpaths: []\n // batchSize: 'auto'\n }\n};\n\nexport const JSONLoader: LoaderWithParser = {\n name: 'JSON',\n id: 'json',\n module: 'json',\n version: VERSION,\n extensions: ['json', 'geojson'],\n mimeTypes: ['application/json'],\n category: 'table',\n text: true,\n parse,\n parseTextSync,\n parseInBatches,\n options: DEFAULT_JSON_LOADER_OPTIONS\n};\n\nasync function parse(arrayBuffer: ArrayBuffer, options?: JSONLoaderOptions) {\n return parseTextSync(new TextDecoder().decode(arrayBuffer), options);\n}\n\nfunction parseTextSync(text: string, options?: JSONLoaderOptions) {\n const jsonOptions = {...options, json: {...DEFAULT_JSON_LOADER_OPTIONS.json, ...options?.json}};\n return parseJSONSync(text, jsonOptions as JSONLoaderOptions);\n}\n\nfunction parseInBatches(\n asyncIterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n options?: JSONLoaderOptions\n): AsyncIterable<Batch> {\n const jsonOptions = {...options, json: {...DEFAULT_JSON_LOADER_OPTIONS.json, ...options?.json}};\n return parseJSONInBatches(asyncIterator, jsonOptions as JSONLoaderOptions);\n}\n"],"mappings":"AAEA,OAAOA,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,kBAAkB,MAAM,6BAA6B;AAI5D,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAc3E,MAAMC,2BAA2B,GAAG;EAClCC,IAAI,EAAE;IACJC,KAAK,EAAE,WAAW;IAClBC,KAAK,EAAE,KAAK;IACZC,SAAS,EAAE;EAEb;AACF,CAAC;AAED,OAAO,MAAMC,UAA4B,GAAG;EAC1CC,IAAI,EAAE,MAAM;EACZC,EAAE,EAAE,MAAM;EACVC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEV,OAAO;EAChBW,UAAU,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;EAC/BC,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,QAAQ,EAAE,OAAO;EACjBC,IAAI,EAAE,IAAI;EACVC,KAAK;EACLC,aAAa;EACbC,cAAc;EACdC,OAAO,EAAEjB;AACX,CAAC;AAED,eAAec,KAAKA,CAACI,WAAwB,EAAED,OAA2B,EAAE;EAC1E,OAAOF,aAAa,CAAC,IAAII,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAED,OAAO,CAAC;AACtE;AAEA,SAASF,aAAaA,CAACF,IAAY,EAAEI,OAA2B,EAAE;EAChE,MAAMI,WAAW,GAAG;IAAC,GAAGJ,OAAO;IAAEhB,IAAI,EAAE;MAAC,GAAGD,2BAA2B,CAACC,IAAI;MAAE,IAAGgB,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEhB,IAAI;IAAA;EAAC,CAAC;EAC/F,OAAOJ,aAAa,CAACgB,IAAI,EAAEQ,WAAgC,CAAC;AAC9D;AAEA,SAASL,cAAcA,CACrBM,aAAiE,EACjEL,OAA2B,EACL;EACtB,MAAMI,WAAW,GAAG;IAAC,GAAGJ,OAAO;IAAEhB,IAAI,EAAE;MAAC,GAAGD,2BAA2B,CAACC,IAAI;MAAE,IAAGgB,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEhB,IAAI;IAAA;EAAC,CAAC;EAC/F,OAAOH,kBAAkB,CAACwB,aAAa,EAAED,WAAgC,CAAC;AAC5E"}
1
+ {"version":3,"file":"json-loader.js","names":["parseJSONSync","parseJSONInBatches","VERSION","DEFAULT_JSON_LOADER_OPTIONS","json","shape","table","jsonpaths","JSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parse","parseTextSync","parseInBatches","options","arrayBuffer","TextDecoder","decode","jsonOptions","asyncIterator"],"sources":["../../src/json-loader.ts"],"sourcesContent":["import type {Batch} from '@loaders.gl/schema';\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport parseJSONSync from './lib/parse-json';\nimport parseJSONInBatches from './lib/parse-json-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * @param table -\n * @param jsonpaths -\n */\nexport type JSONLoaderOptions = LoaderOptions & {\n json?: {\n shape?: 'row-table';\n table?: false;\n jsonpaths?: string[];\n };\n};\n\nconst DEFAULT_JSON_LOADER_OPTIONS = {\n json: {\n shape: 'row-table',\n table: false,\n jsonpaths: []\n // batchSize: 'auto'\n }\n};\n\nexport const JSONLoader: LoaderWithParser = {\n name: 'JSON',\n id: 'json',\n module: 'json',\n version: VERSION,\n extensions: ['json', 'geojson'],\n mimeTypes: ['application/json'],\n category: 'table',\n text: true,\n parse,\n parseTextSync,\n parseInBatches,\n options: DEFAULT_JSON_LOADER_OPTIONS\n};\n\nasync function parse(arrayBuffer: ArrayBuffer, options?: JSONLoaderOptions) {\n return parseTextSync(new TextDecoder().decode(arrayBuffer), options);\n}\n\nfunction parseTextSync(text: string, options?: JSONLoaderOptions) {\n const jsonOptions = {...options, json: {...DEFAULT_JSON_LOADER_OPTIONS.json, ...options?.json}};\n return parseJSONSync(text, jsonOptions as JSONLoaderOptions);\n}\n\nfunction parseInBatches(\n asyncIterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>,\n options?: JSONLoaderOptions\n): AsyncIterable<Batch> {\n const jsonOptions = {...options, json: {...DEFAULT_JSON_LOADER_OPTIONS.json, ...options?.json}};\n return parseJSONInBatches(asyncIterator, jsonOptions as JSONLoaderOptions);\n}\n"],"mappings":"AAEA,OAAOA,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,kBAAkB,MAAM,6BAA6B;AAI5D,MAAMC,OAAO,GAAG,eAAkB,KAAK,WAAW,cAAiB,QAAQ;AAc3E,MAAMC,2BAA2B,GAAG;EAClCC,IAAI,EAAE;IACJC,KAAK,EAAE,WAAW;IAClBC,KAAK,EAAE,KAAK;IACZC,SAAS,EAAE;EAEb;AACF,CAAC;AAED,OAAO,MAAMC,UAA4B,GAAG;EAC1CC,IAAI,EAAE,MAAM;EACZC,EAAE,EAAE,MAAM;EACVC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEV,OAAO;EAChBW,UAAU,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;EAC/BC,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,QAAQ,EAAE,OAAO;EACjBC,IAAI,EAAE,IAAI;EACVC,KAAK;EACLC,aAAa;EACbC,cAAc;EACdC,OAAO,EAAEjB;AACX,CAAC;AAED,eAAec,KAAKA,CAACI,WAAwB,EAAED,OAA2B,EAAE;EAC1E,OAAOF,aAAa,CAAC,IAAII,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,EAAED,OAAO,CAAC;AACtE;AAEA,SAASF,aAAaA,CAACF,IAAY,EAAEI,OAA2B,EAAE;EAChE,MAAMI,WAAW,GAAG;IAAC,GAAGJ,OAAO;IAAEhB,IAAI,EAAE;MAAC,GAAGD,2BAA2B,CAACC,IAAI;MAAE,IAAGgB,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEhB,IAAI;IAAA;EAAC,CAAC;EAC/F,OAAOJ,aAAa,CAACgB,IAAI,EAAEQ,WAAgC,CAAC;AAC9D;AAEA,SAASL,cAAcA,CACrBM,aAAiE,EACjEL,OAA2B,EACL;EACtB,MAAMI,WAAW,GAAG;IAAC,GAAGJ,OAAO;IAAEhB,IAAI,EAAE;MAAC,GAAGD,2BAA2B,CAACC,IAAI;MAAE,IAAGgB,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEhB,IAAI;IAAA;EAAC,CAAC;EAC/F,OAAOH,kBAAkB,CAACwB,aAAa,EAAED,WAAgC,CAAC;AAC5E"}
@@ -1,6 +1,6 @@
1
1
  import parseNDJSONSync from './lib/parse-ndjson';
2
2
  import parseNDJSONInBatches from './lib/parse-ndjson-in-batches';
3
- const VERSION = typeof "3.4.8" !== 'undefined' ? "3.4.8" : 'latest';
3
+ const VERSION = typeof "3.4.10" !== 'undefined' ? "3.4.10" : 'latest';
4
4
  const DEFAULT_NDGEOJSON_LOADER_OPTIONS = {
5
5
  geojson: {
6
6
  shape: 'object-row-table'
@@ -1 +1 @@
1
- {"version":3,"file":"ndgeoson-loader.js","names":["parseNDJSONSync","parseNDJSONInBatches","VERSION","DEFAULT_NDGEOJSON_LOADER_OPTIONS","geojson","shape","gis","format","NDJSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parse","arrayBuffer","TextDecoder","decode","parseTextSync","parseInBatches","options","_typecheckNDJSONLoader"],"sources":["../../src/ndgeoson-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport parseNDJSONSync from './lib/parse-ndjson';\nimport parseNDJSONInBatches from './lib/parse-ndjson-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type NDGeoJSONLoaderOptions = LoaderOptions & {\n geojson?: {\n shape?: 'object-row-table';\n };\n gis?: {\n format: 'geojson';\n };\n};\n\nconst DEFAULT_NDGEOJSON_LOADER_OPTIONS = {\n geojson: {\n shape: 'object-row-table'\n },\n gis: {\n format: 'geojson'\n }\n};\n\nexport const NDJSONLoader = {\n name: 'NDJSON',\n id: 'ndjson',\n module: 'json',\n version: VERSION,\n extensions: ['ndjson', 'ndgeojson'],\n mimeTypes: [\n 'application/geo+x-ndjson',\n 'application/geo+x-ldjson',\n 'application/jsonlines', // https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html#cm-batch\n 'application/geo+json-seq',\n 'application/x-ndjson'\n ],\n category: 'table',\n text: true,\n parse: async (arrayBuffer: ArrayBuffer) => parseNDJSONSync(new TextDecoder().decode(arrayBuffer)),\n parseTextSync: parseNDJSONSync,\n parseInBatches: parseNDJSONInBatches,\n options: DEFAULT_NDGEOJSON_LOADER_OPTIONS\n};\n\nexport const _typecheckNDJSONLoader: LoaderWithParser = NDJSONLoader;\n"],"mappings":"AACA,OAAOA,eAAe,MAAM,oBAAoB;AAChD,OAAOC,oBAAoB,MAAM,+BAA+B;AAIhE,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAW3E,MAAMC,gCAAgC,GAAG;EACvCC,OAAO,EAAE;IACPC,KAAK,EAAE;EACT,CAAC;EACDC,GAAG,EAAE;IACHC,MAAM,EAAE;EACV;AACF,CAAC;AAED,OAAO,MAAMC,YAAY,GAAG;EAC1BC,IAAI,EAAE,QAAQ;EACdC,EAAE,EAAE,QAAQ;EACZC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEV,OAAO;EAChBW,UAAU,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC;EACnCC,SAAS,EAAE,CACT,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,CACvB;EACDC,QAAQ,EAAE,OAAO;EACjBC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE,MAAOC,WAAwB,IAAKlB,eAAe,CAAC,IAAImB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,CAAC;EACjGG,aAAa,EAAErB,eAAe;EAC9BsB,cAAc,EAAErB,oBAAoB;EACpCsB,OAAO,EAAEpB;AACX,CAAC;AAED,OAAO,MAAMqB,sBAAwC,GAAGhB,YAAY"}
1
+ {"version":3,"file":"ndgeoson-loader.js","names":["parseNDJSONSync","parseNDJSONInBatches","VERSION","DEFAULT_NDGEOJSON_LOADER_OPTIONS","geojson","shape","gis","format","NDJSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parse","arrayBuffer","TextDecoder","decode","parseTextSync","parseInBatches","options","_typecheckNDJSONLoader"],"sources":["../../src/ndgeoson-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport parseNDJSONSync from './lib/parse-ndjson';\nimport parseNDJSONInBatches from './lib/parse-ndjson-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type NDGeoJSONLoaderOptions = LoaderOptions & {\n geojson?: {\n shape?: 'object-row-table';\n };\n gis?: {\n format: 'geojson';\n };\n};\n\nconst DEFAULT_NDGEOJSON_LOADER_OPTIONS = {\n geojson: {\n shape: 'object-row-table'\n },\n gis: {\n format: 'geojson'\n }\n};\n\nexport const NDJSONLoader = {\n name: 'NDJSON',\n id: 'ndjson',\n module: 'json',\n version: VERSION,\n extensions: ['ndjson', 'ndgeojson'],\n mimeTypes: [\n 'application/geo+x-ndjson',\n 'application/geo+x-ldjson',\n 'application/jsonlines', // https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html#cm-batch\n 'application/geo+json-seq',\n 'application/x-ndjson'\n ],\n category: 'table',\n text: true,\n parse: async (arrayBuffer: ArrayBuffer) => parseNDJSONSync(new TextDecoder().decode(arrayBuffer)),\n parseTextSync: parseNDJSONSync,\n parseInBatches: parseNDJSONInBatches,\n options: DEFAULT_NDGEOJSON_LOADER_OPTIONS\n};\n\nexport const _typecheckNDJSONLoader: LoaderWithParser = NDJSONLoader;\n"],"mappings":"AACA,OAAOA,eAAe,MAAM,oBAAoB;AAChD,OAAOC,oBAAoB,MAAM,+BAA+B;AAIhE,MAAMC,OAAO,GAAG,eAAkB,KAAK,WAAW,cAAiB,QAAQ;AAW3E,MAAMC,gCAAgC,GAAG;EACvCC,OAAO,EAAE;IACPC,KAAK,EAAE;EACT,CAAC;EACDC,GAAG,EAAE;IACHC,MAAM,EAAE;EACV;AACF,CAAC;AAED,OAAO,MAAMC,YAAY,GAAG;EAC1BC,IAAI,EAAE,QAAQ;EACdC,EAAE,EAAE,QAAQ;EACZC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEV,OAAO;EAChBW,UAAU,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC;EACnCC,SAAS,EAAE,CACT,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,CACvB;EACDC,QAAQ,EAAE,OAAO;EACjBC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE,MAAOC,WAAwB,IAAKlB,eAAe,CAAC,IAAImB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,CAAC;EACjGG,aAAa,EAAErB,eAAe;EAC9BsB,cAAc,EAAErB,oBAAoB;EACpCsB,OAAO,EAAEpB;AACX,CAAC;AAED,OAAO,MAAMqB,sBAAwC,GAAGhB,YAAY"}
@@ -1,6 +1,6 @@
1
1
  import parseNDJSONSync from './lib/parse-ndjson';
2
2
  import parseNDJSONInBatches from './lib/parse-ndjson-in-batches';
3
- const VERSION = typeof "3.4.8" !== 'undefined' ? "3.4.8" : 'latest';
3
+ const VERSION = typeof "3.4.10" !== 'undefined' ? "3.4.10" : 'latest';
4
4
  export const NDJSONLoader = {
5
5
  name: 'NDJSON',
6
6
  id: 'ndjson',
@@ -1 +1 @@
1
- {"version":3,"file":"ndjson-loader.js","names":["parseNDJSONSync","parseNDJSONInBatches","VERSION","NDJSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parse","arrayBuffer","TextDecoder","decode","parseTextSync","parseInBatches","options"],"sources":["../../src/ndjson-loader.ts"],"sourcesContent":["import parseNDJSONSync from './lib/parse-ndjson';\nimport parseNDJSONInBatches from './lib/parse-ndjson-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport const NDJSONLoader = {\n name: 'NDJSON',\n id: 'ndjson',\n module: 'json',\n version: VERSION,\n extensions: ['ndjson', 'jsonl'],\n mimeTypes: [\n 'application/x-ndjson',\n 'application/jsonlines', // https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html#cm-batch\n 'application/json-seq'\n ],\n category: 'table',\n text: true,\n parse: async (arrayBuffer: ArrayBuffer) => parseNDJSONSync(new TextDecoder().decode(arrayBuffer)),\n parseTextSync: parseNDJSONSync,\n parseInBatches: parseNDJSONInBatches,\n options: {}\n};\n"],"mappings":"AAAA,OAAOA,eAAe,MAAM,oBAAoB;AAChD,OAAOC,oBAAoB,MAAM,+BAA+B;AAIhE,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAE3E,OAAO,MAAMC,YAAY,GAAG;EAC1BC,IAAI,EAAE,QAAQ;EACdC,EAAE,EAAE,QAAQ;EACZC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEL,OAAO;EAChBM,UAAU,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;EAC/BC,SAAS,EAAE,CACT,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,CACvB;EACDC,QAAQ,EAAE,OAAO;EACjBC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE,MAAOC,WAAwB,IAAKb,eAAe,CAAC,IAAIc,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,CAAC;EACjGG,aAAa,EAAEhB,eAAe;EAC9BiB,cAAc,EAAEhB,oBAAoB;EACpCiB,OAAO,EAAE,CAAC;AACZ,CAAC"}
1
+ {"version":3,"file":"ndjson-loader.js","names":["parseNDJSONSync","parseNDJSONInBatches","VERSION","NDJSONLoader","name","id","module","version","extensions","mimeTypes","category","text","parse","arrayBuffer","TextDecoder","decode","parseTextSync","parseInBatches","options"],"sources":["../../src/ndjson-loader.ts"],"sourcesContent":["import parseNDJSONSync from './lib/parse-ndjson';\nimport parseNDJSONInBatches from './lib/parse-ndjson-in-batches';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport const NDJSONLoader = {\n name: 'NDJSON',\n id: 'ndjson',\n module: 'json',\n version: VERSION,\n extensions: ['ndjson', 'jsonl'],\n mimeTypes: [\n 'application/x-ndjson',\n 'application/jsonlines', // https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html#cm-batch\n 'application/json-seq'\n ],\n category: 'table',\n text: true,\n parse: async (arrayBuffer: ArrayBuffer) => parseNDJSONSync(new TextDecoder().decode(arrayBuffer)),\n parseTextSync: parseNDJSONSync,\n parseInBatches: parseNDJSONInBatches,\n options: {}\n};\n"],"mappings":"AAAA,OAAOA,eAAe,MAAM,oBAAoB;AAChD,OAAOC,oBAAoB,MAAM,+BAA+B;AAIhE,MAAMC,OAAO,GAAG,eAAkB,KAAK,WAAW,cAAiB,QAAQ;AAE3E,OAAO,MAAMC,YAAY,GAAG;EAC1BC,IAAI,EAAE,QAAQ;EACdC,EAAE,EAAE,QAAQ;EACZC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEL,OAAO;EAChBM,UAAU,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;EAC/BC,SAAS,EAAE,CACT,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,CACvB;EACDC,QAAQ,EAAE,OAAO;EACjBC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE,MAAOC,WAAwB,IAAKb,eAAe,CAAC,IAAIc,WAAW,CAAC,CAAC,CAACC,MAAM,CAACF,WAAW,CAAC,CAAC;EACjGG,aAAa,EAAEhB,eAAe;EAC9BiB,cAAc,EAAEhB,oBAAoB;EACpCiB,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -687,7 +687,8 @@
687
687
  ...geometryInfo
688
688
  }, {
689
689
  numericPropKeys: options && options.numericPropKeys || numericPropKeys,
690
- PositionDataType: options ? options.PositionDataType : Float32Array
690
+ PositionDataType: options ? options.PositionDataType : Float32Array,
691
+ triangulate: options ? options.triangulate : true
691
692
  });
692
693
  }
693
694
  function extractNumericPropTypes(features) {
@@ -716,7 +717,7 @@
716
717
  propArrayTypes,
717
718
  coordLength
718
719
  } = geometryInfo;
719
- const { numericPropKeys = [], PositionDataType = Float32Array } = options;
720
+ const { numericPropKeys = [], PositionDataType = Float32Array, triangulate = true } = options;
720
721
  const hasGlobalId = features[0] && "id" in features[0];
721
722
  const GlobalFeatureIdsDataType = features.length > 65535 ? Uint32Array : Uint16Array;
722
723
  const points = {
@@ -743,13 +744,15 @@
743
744
  polygonIndices: polygonPositionsCount > 65535 ? new Uint32Array(polygonObjectsCount + 1) : new Uint16Array(polygonObjectsCount + 1),
744
745
  primitivePolygonIndices: polygonPositionsCount > 65535 ? new Uint32Array(polygonRingsCount + 1) : new Uint16Array(polygonRingsCount + 1),
745
746
  positions: new PositionDataType(polygonPositionsCount * coordLength),
746
- triangles: [],
747
747
  globalFeatureIds: new GlobalFeatureIdsDataType(polygonPositionsCount),
748
748
  featureIds: polygonFeaturesCount > 65535 ? new Uint32Array(polygonPositionsCount) : new Uint16Array(polygonPositionsCount),
749
749
  numericProps: {},
750
750
  properties: [],
751
751
  fields: []
752
752
  };
753
+ if (triangulate) {
754
+ polygons.triangles = [];
755
+ }
753
756
  for (const object of [points, lines, polygons]) {
754
757
  for (const propName of numericPropKeys) {
755
758
  const T = propArrayTypes[propName];
@@ -854,6 +857,9 @@
854
857
  endPosition,
855
858
  coordLength
856
859
  }) {
860
+ if (!polygons.triangles) {
861
+ return;
862
+ }
857
863
  const start = startPosition * coordLength;
858
864
  const end = endPosition * coordLength;
859
865
  const polygonPositions = polygons.positions.subarray(start, end);
@@ -872,7 +878,7 @@
872
878
  return returnObj;
873
879
  }
874
880
  function makeAccessorObjects(points, lines, polygons, coordLength) {
875
- return {
881
+ const binaryFeatures = {
876
882
  points: {
877
883
  ...points,
878
884
  positions: { value: points.positions, size: coordLength },
@@ -893,12 +899,15 @@
893
899
  positions: { value: polygons.positions, size: coordLength },
894
900
  polygonIndices: { value: polygons.polygonIndices, size: 1 },
895
901
  primitivePolygonIndices: { value: polygons.primitivePolygonIndices, size: 1 },
896
- triangles: { value: new Uint32Array(polygons.triangles), size: 1 },
897
902
  globalFeatureIds: { value: polygons.globalFeatureIds, size: 1 },
898
903
  featureIds: { value: polygons.featureIds, size: 1 },
899
904
  numericProps: wrapProps(polygons.numericProps, 1)
900
905
  }
901
906
  };
907
+ if (polygons.triangles) {
908
+ binaryFeatures.polygons.triangles = { value: new Uint32Array(polygons.triangles), size: 1 };
909
+ }
910
+ return binaryFeatures;
902
911
  }
903
912
  function fillNumericProperties(object, properties, index, length) {
904
913
  for (const numericPropName in object.numericProps) {
@@ -1093,14 +1102,15 @@
1093
1102
  }
1094
1103
 
1095
1104
  // ../gis/src/lib/geojson-to-binary.ts
1096
- function geojsonToBinary(features, options = { fixRingWinding: true }) {
1105
+ function geojsonToBinary(features, options = { fixRingWinding: true, triangulate: true }) {
1097
1106
  const geometryInfo = extractGeometryInfo(features);
1098
1107
  const coordLength = geometryInfo.coordLength;
1099
1108
  const { fixRingWinding } = options;
1100
1109
  const flatFeatures = geojsonToFlatGeojson(features, { coordLength, fixRingWinding });
1101
1110
  return flatGeojsonToBinary(flatFeatures, geometryInfo, {
1102
1111
  numericPropKeys: options.numericPropKeys,
1103
- PositionDataType: options.PositionDataType || Float32Array
1112
+ PositionDataType: options.PositionDataType || Float32Array,
1113
+ triangulate: options.triangulate
1104
1114
  });
1105
1115
  }
1106
1116
 
@@ -2266,7 +2276,7 @@ Char: ${this.c}`;
2266
2276
  }
2267
2277
 
2268
2278
  // src/geojson-loader.ts
2269
- var VERSION = true ? "3.4.8" : "latest";
2279
+ var VERSION = true ? "3.4.10" : "latest";
2270
2280
  var DEFAULT_GEOJSON_LOADER_OPTIONS = {
2271
2281
  geojson: {
2272
2282
  shape: "object-row-table"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/json",
3
- "version": "3.4.8",
3
+ "version": "3.4.10",
4
4
  "description": "Framework-independent loader for JSON and streaming JSON formats",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -35,9 +35,9 @@
35
35
  "build-worker": "esbuild src/workers/geojson-worker.ts --bundle --outfile=dist/geojson-worker.js --define:__VERSION__=\\\"$npm_package_version\\\""
36
36
  },
37
37
  "dependencies": {
38
- "@loaders.gl/gis": "3.4.8",
39
- "@loaders.gl/loader-utils": "3.4.8",
40
- "@loaders.gl/schema": "3.4.8"
38
+ "@loaders.gl/gis": "3.4.10",
39
+ "@loaders.gl/loader-utils": "3.4.10",
40
+ "@loaders.gl/schema": "3.4.10"
41
41
  },
42
- "gitHead": "1c4c0c794713d3701e5fe9a577b51b9b185c2e69"
42
+ "gitHead": "4568459c96eaf0480a50ab77cace355307f61f04"
43
43
  }