@loaders.gl/tile-converter 4.0.0-alpha.13 → 4.0.0-alpha.15

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 (142) hide show
  1. package/bin/i3s-server.js +4 -0
  2. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts +0 -1
  3. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts.map +1 -1
  4. package/dist/3d-tiles-converter/3d-tiles-converter.js +8 -19
  5. package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts +4 -1
  6. package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts.map +1 -1
  7. package/dist/converter.min.js +65 -65
  8. package/dist/dist.min.js +881 -261
  9. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js +34 -67
  10. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
  11. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
  12. package/dist/es5/deps-installer/deps-installer.js +1 -1
  13. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
  14. package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
  15. package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -1
  16. package/dist/es5/i3s-converter/i3s-converter.js +36 -43
  17. package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
  18. package/dist/es5/i3s-converter/types.js.map +1 -1
  19. package/dist/es5/i3s-server/README.md +46 -2
  20. package/dist/es5/i3s-server/app.js +3 -3
  21. package/dist/es5/i3s-server/app.js.map +1 -1
  22. package/dist/es5/i3s-server/bin/www.js +61 -0
  23. package/dist/es5/i3s-server/bin/www.js.map +1 -0
  24. package/dist/es5/i3s-server/controllers/slpk-controller.js +14 -18
  25. package/dist/es5/i3s-server/controllers/slpk-controller.js.map +1 -1
  26. package/dist/es5/index.js +7 -0
  27. package/dist/es5/index.js.map +1 -1
  28. package/dist/es5/pgm-loader.js +1 -1
  29. package/dist/es5/slpk-extractor/helpers/file-handle-provider.js +59 -26
  30. package/dist/es5/slpk-extractor/helpers/file-handle-provider.js.map +1 -1
  31. package/dist/es5/slpk-extractor/helpers/fs-promises.js +77 -0
  32. package/dist/es5/slpk-extractor/helpers/fs-promises.js.map +1 -0
  33. package/dist/es5/slpk-extractor/slpk-extractor.js +7 -7
  34. package/dist/es5/slpk-extractor/slpk-extractor.js.map +1 -1
  35. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js +8 -18
  36. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
  37. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
  38. package/dist/esm/deps-installer/deps-installer.js +1 -1
  39. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
  40. package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
  41. package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -1
  42. package/dist/esm/i3s-converter/i3s-converter.js +5 -8
  43. package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
  44. package/dist/esm/i3s-converter/types.js.map +1 -1
  45. package/dist/esm/i3s-server/README.md +46 -2
  46. package/dist/esm/i3s-server/app.js +4 -4
  47. package/dist/esm/i3s-server/app.js.map +1 -1
  48. package/dist/esm/i3s-server/bin/i3s-server.min.js +614 -0
  49. package/{src/i3s-server/bin/www → dist/esm/i3s-server/bin/www.js} +12 -55
  50. package/dist/esm/i3s-server/bin/www.js.map +1 -0
  51. package/dist/esm/i3s-server/controllers/slpk-controller.js +6 -12
  52. package/dist/esm/i3s-server/controllers/slpk-controller.js.map +1 -1
  53. package/dist/esm/index.js +1 -0
  54. package/dist/esm/index.js.map +1 -1
  55. package/dist/esm/pgm-loader.js +1 -1
  56. package/dist/esm/slpk-extractor/helpers/file-handle-provider.js +17 -6
  57. package/dist/esm/slpk-extractor/helpers/file-handle-provider.js.map +1 -1
  58. package/dist/esm/slpk-extractor/helpers/fs-promises.js +32 -0
  59. package/dist/esm/slpk-extractor/helpers/fs-promises.js.map +1 -0
  60. package/dist/esm/slpk-extractor/slpk-extractor.js +2 -2
  61. package/dist/esm/slpk-extractor/slpk-extractor.js.map +1 -1
  62. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +1 -1
  63. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -1
  64. package/dist/i3s-converter/helpers/geometry-converter.d.ts +2 -3
  65. package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
  66. package/dist/i3s-converter/helpers/gltf-attributes.d.ts +2 -2
  67. package/dist/i3s-converter/helpers/gltf-attributes.d.ts.map +1 -1
  68. package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
  69. package/dist/i3s-converter/i3s-converter.js +5 -6
  70. package/dist/i3s-converter/types.d.ts +32 -1
  71. package/dist/i3s-converter/types.d.ts.map +1 -1
  72. package/dist/i3s-server/app.d.ts.map +1 -1
  73. package/dist/i3s-server/app.js +1 -1
  74. package/dist/i3s-server/bin/www.d.ts +3 -0
  75. package/dist/i3s-server/bin/www.d.ts.map +1 -0
  76. package/dist/i3s-server/bin/www.js +83 -0
  77. package/dist/i3s-server/controllers/slpk-controller.d.ts.map +1 -1
  78. package/dist/i3s-server/controllers/slpk-controller.js +4 -9
  79. package/dist/index.d.ts +1 -0
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/index.js +3 -1
  82. package/dist/slpk-extractor/helpers/file-handle-provider.d.ts +15 -12
  83. package/dist/slpk-extractor/helpers/file-handle-provider.d.ts.map +1 -1
  84. package/dist/slpk-extractor/helpers/file-handle-provider.js +25 -10
  85. package/dist/slpk-extractor/helpers/fs-promises.d.ts +38 -0
  86. package/dist/slpk-extractor/helpers/fs-promises.d.ts.map +1 -0
  87. package/dist/slpk-extractor/helpers/fs-promises.js +51 -0
  88. package/dist/slpk-extractor/slpk-extractor.d.ts +2 -2
  89. package/dist/slpk-extractor/slpk-extractor.d.ts.map +1 -1
  90. package/dist/slpk-extractor/slpk-extractor.js +4 -7
  91. package/dist/slpk-extractor.min.js +44 -44
  92. package/package.json +20 -21
  93. package/src/3d-tiles-converter/3d-tiles-converter.ts +10 -28
  94. package/src/3d-tiles-converter/helpers/b3dm-converter.ts +5 -2
  95. package/src/i3s-converter/helpers/batch-ids-extensions.ts +1 -1
  96. package/src/i3s-converter/helpers/geometry-converter.ts +2 -7
  97. package/src/i3s-converter/helpers/gltf-attributes.ts +2 -2
  98. package/src/i3s-converter/i3s-converter.ts +5 -6
  99. package/src/i3s-converter/types.ts +32 -1
  100. package/src/i3s-server/README.md +46 -2
  101. package/src/i3s-server/app.js +1 -1
  102. package/{dist/es5/i3s-server/bin/www → src/i3s-server/bin/www.js} +7 -7
  103. package/src/i3s-server/controllers/slpk-controller.js +4 -11
  104. package/src/index.ts +1 -0
  105. package/src/slpk-extractor/helpers/file-handle-provider.ts +36 -18
  106. package/src/slpk-extractor/helpers/fs-promises.ts +66 -0
  107. package/src/slpk-extractor/slpk-extractor.ts +5 -6
  108. package/dist/3d-tiles-attributes-worker.d.ts +0 -28
  109. package/dist/3d-tiles-attributes-worker.d.ts.map +0 -1
  110. package/dist/3d-tiles-attributes-worker.js +0 -3
  111. package/dist/3d-tiles-attributes-worker.js.map +0 -7
  112. package/dist/es5/3d-tiles-attributes-worker.js +0 -25
  113. package/dist/es5/3d-tiles-attributes-worker.js.map +0 -1
  114. package/dist/es5/i3s-attributes-worker.js +0 -25
  115. package/dist/es5/i3s-attributes-worker.js.map +0 -1
  116. package/dist/es5/workers/3d-tiles-attributes-worker.js +0 -28
  117. package/dist/es5/workers/3d-tiles-attributes-worker.js.map +0 -1
  118. package/dist/es5/workers/i3s-attributes-worker.js +0 -30
  119. package/dist/es5/workers/i3s-attributes-worker.js.map +0 -1
  120. package/dist/esm/3d-tiles-attributes-worker.js +0 -16
  121. package/dist/esm/3d-tiles-attributes-worker.js.map +0 -1
  122. package/dist/esm/i3s-attributes-worker.js +0 -16
  123. package/dist/esm/i3s-attributes-worker.js.map +0 -1
  124. package/dist/esm/i3s-server/bin/www +0 -102
  125. package/dist/esm/workers/3d-tiles-attributes-worker.js +0 -8
  126. package/dist/esm/workers/3d-tiles-attributes-worker.js.map +0 -1
  127. package/dist/esm/workers/i3s-attributes-worker.js +0 -7
  128. package/dist/esm/workers/i3s-attributes-worker.js.map +0 -1
  129. package/dist/i3s-attributes-worker.d.ts +0 -45
  130. package/dist/i3s-attributes-worker.d.ts.map +0 -1
  131. package/dist/i3s-attributes-worker.js +0 -9
  132. package/dist/i3s-attributes-worker.js.map +0 -7
  133. package/dist/workers/3d-tiles-attributes-worker.d.ts +0 -2
  134. package/dist/workers/3d-tiles-attributes-worker.d.ts.map +0 -1
  135. package/dist/workers/3d-tiles-attributes-worker.js +0 -9
  136. package/dist/workers/i3s-attributes-worker.d.ts +0 -2
  137. package/dist/workers/i3s-attributes-worker.d.ts.map +0 -1
  138. package/dist/workers/i3s-attributes-worker.js +0 -5
  139. package/src/3d-tiles-attributes-worker.ts +0 -43
  140. package/src/i3s-attributes-worker.ts +0 -59
  141. package/src/workers/3d-tiles-attributes-worker.ts +0 -6
  142. package/src/workers/i3s-attributes-worker.ts +0 -7
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports._typecheckI3SAttributesWorker = exports.Tile3dAttributesWorker = void 0;
7
- exports.transform3DTilesAttributesOnWorker = transform3DTilesAttributesOnWorker;
8
- var _workerUtils = require("@loaders.gl/worker-utils");
9
- var VERSION = typeof "4.0.0-alpha.13" !== 'undefined' ? "4.0.0-alpha.13" : 'latest';
10
- var Tile3dAttributesWorker = {
11
- id: '3d-tiles-attributes',
12
- name: '3DTiles Attributes Worker',
13
- module: 'tile-converter',
14
- version: VERSION,
15
- options: {
16
- featureAttributes: null
17
- }
18
- };
19
- exports.Tile3dAttributesWorker = Tile3dAttributesWorker;
20
- function transform3DTilesAttributesOnWorker(i3sAttributesData, options) {
21
- return (0, _workerUtils.processOnWorker)(Tile3dAttributesWorker, i3sAttributesData, options);
22
- }
23
- var _typecheckI3SAttributesWorker = Tile3dAttributesWorker;
24
- exports._typecheckI3SAttributesWorker = _typecheckI3SAttributesWorker;
25
- //# sourceMappingURL=3d-tiles-attributes-worker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"3d-tiles-attributes-worker.js","names":["_workerUtils","require","VERSION","Tile3dAttributesWorker","id","name","module","version","options","featureAttributes","exports","transform3DTilesAttributesOnWorker","i3sAttributesData","processOnWorker","_typecheckI3SAttributesWorker"],"sources":["../../src/3d-tiles-attributes-worker.ts"],"sourcesContent":["import type {WorkerObject} from '@loaders.gl/worker-utils';\nimport type {FeatureAttribute} from '@loaders.gl/i3s';\n\nimport {processOnWorker} from '@loaders.gl/worker-utils';\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 Tile3DAttributesWorkerOptions = {\n featureAttributes: FeatureAttribute | null;\n source: string;\n};\n\nexport type I3SAttributesData = {\n tileContent: any;\n textureFormat: string;\n};\n\n/**\n * I3S Attributes Worker to handle B3DM object\n */\nexport const Tile3dAttributesWorker = {\n id: '3d-tiles-attributes',\n name: '3DTiles Attributes Worker',\n module: 'tile-converter',\n version: VERSION,\n options: {\n featureAttributes: null\n }\n};\n\n/**\n * Performs I3S attributes transformation\n */\nexport function transform3DTilesAttributesOnWorker(\n i3sAttributesData: I3SAttributesData,\n options: Tile3DAttributesWorkerOptions\n): Promise<ArrayBuffer> {\n return processOnWorker(Tile3dAttributesWorker, i3sAttributesData, options);\n}\n\nexport const _typecheckI3SAttributesWorker: WorkerObject = Tile3dAttributesWorker;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAIA,IAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,QAAQ;AAepE,IAAMC,sBAAsB,GAAG;EACpCC,EAAE,EAAE,qBAAqB;EACzBC,IAAI,EAAE,2BAA2B;EACjCC,MAAM,EAAE,gBAAgB;EACxBC,OAAO,EAAEL,OAAO;EAChBM,OAAO,EAAE;IACPC,iBAAiB,EAAE;EACrB;AACF,CAAC;AAACC,OAAA,CAAAP,sBAAA,GAAAA,sBAAA;AAKK,SAASQ,kCAAkCA,CAChDC,iBAAoC,EACpCJ,OAAsC,EAChB;EACtB,OAAO,IAAAK,4BAAe,EAACV,sBAAsB,EAAES,iBAAiB,EAAEJ,OAAO,CAAC;AAC5E;AAEO,IAAMM,6BAA2C,GAAGX,sBAAsB;AAACO,OAAA,CAAAI,6BAAA,GAAAA,6BAAA"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports._typecheckI3SAttributesWorker = exports.I3SAttributesWorker = void 0;
7
- exports.transformI3SAttributesOnWorker = transformI3SAttributesOnWorker;
8
- var _workerUtils = require("@loaders.gl/worker-utils");
9
- var VERSION = typeof "4.0.0-alpha.13" !== 'undefined' ? "4.0.0-alpha.13" : 'latest';
10
- var I3SAttributesWorker = {
11
- id: 'i3s-attributes',
12
- name: 'I3S Attributes Worker',
13
- module: 'tile-converter',
14
- version: VERSION,
15
- options: {
16
- useCartesianPositions: false
17
- }
18
- };
19
- exports.I3SAttributesWorker = I3SAttributesWorker;
20
- function transformI3SAttributesOnWorker(attributesData, options) {
21
- return (0, _workerUtils.processOnWorker)(I3SAttributesWorker, attributesData, options);
22
- }
23
- var _typecheckI3SAttributesWorker = I3SAttributesWorker;
24
- exports._typecheckI3SAttributesWorker = _typecheckI3SAttributesWorker;
25
- //# sourceMappingURL=i3s-attributes-worker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i3s-attributes-worker.js","names":["_workerUtils","require","VERSION","I3SAttributesWorker","id","name","module","version","options","useCartesianPositions","exports","transformI3SAttributesOnWorker","attributesData","processOnWorker","_typecheckI3SAttributesWorker"],"sources":["../../src/i3s-attributes-worker.ts"],"sourcesContent":["import type {WorkerObject} from '@loaders.gl/worker-utils';\nimport type {ConvertedAttributes} from './i3s-converter/types';\nimport type {Matrix4, Vector3} from '@math.gl/core';\nimport type {GLTFNodePostprocessed} from '@loaders.gl/gltf';\n\nimport {processOnWorker} from '@loaders.gl/worker-utils';\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 I3SAttributesWorkerOptions = {\n _nodeWorkers: boolean;\n reuseWorkers: boolean;\n useCartesianPositions: boolean;\n source: string;\n};\n\nexport type TextureImageProperties = {\n data: Uint8Array;\n compressed?: boolean;\n height?: number;\n width?: number;\n components?: number;\n mimeType?: string;\n};\n\nexport type B3DMAttributesData = {\n gltfMaterials?: {id: string}[];\n nodes: GLTFNodePostprocessed[];\n images: (null | TextureImageProperties)[];\n cartographicOrigin: Vector3;\n cartesianModelMatrix: Matrix4;\n};\n\n/**\n * I3S Attributes Worker to handle B3DM object\n */\nexport const I3SAttributesWorker = {\n id: 'i3s-attributes',\n name: 'I3S Attributes Worker',\n module: 'tile-converter',\n version: VERSION,\n options: {\n useCartesianPositions: false\n }\n};\n\n/**\n * Performs I3S attributes transformation\n */\nexport function transformI3SAttributesOnWorker(\n attributesData: B3DMAttributesData,\n options: I3SAttributesWorkerOptions\n): Promise<Map<string, ConvertedAttributes>> {\n return processOnWorker(I3SAttributesWorker, attributesData, options);\n}\n\nexport const _typecheckI3SAttributesWorker: WorkerObject = I3SAttributesWorker;\n"],"mappings":";;;;;;;AAKA,IAAAA,YAAA,GAAAC,OAAA;AAIA,IAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,QAAQ;AA6BpE,IAAMC,mBAAmB,GAAG;EACjCC,EAAE,EAAE,gBAAgB;EACpBC,IAAI,EAAE,uBAAuB;EAC7BC,MAAM,EAAE,gBAAgB;EACxBC,OAAO,EAAEL,OAAO;EAChBM,OAAO,EAAE;IACPC,qBAAqB,EAAE;EACzB;AACF,CAAC;AAACC,OAAA,CAAAP,mBAAA,GAAAA,mBAAA;AAKK,SAASQ,8BAA8BA,CAC5CC,cAAkC,EAClCJ,OAAmC,EACQ;EAC3C,OAAO,IAAAK,4BAAe,EAACV,mBAAmB,EAAES,cAAc,EAAEJ,OAAO,CAAC;AACtE;AAEO,IAAMM,6BAA2C,GAAGX,mBAAmB;AAACO,OAAA,CAAAI,6BAAA,GAAAA,6BAAA"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
5
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
6
- var _workerUtils = require("@loaders.gl/worker-utils");
7
- var _b3dmConverter = _interopRequireDefault(require("../3d-tiles-converter/helpers/b3dm-converter"));
8
- var b3dmConverter = new _b3dmConverter.default();
9
- (0, _workerUtils.createWorker)(function () {
10
- var _ref = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(data) {
11
- var options,
12
- _args = arguments;
13
- return _regenerator.default.wrap(function _callee$(_context) {
14
- while (1) switch (_context.prev = _context.next) {
15
- case 0:
16
- options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
17
- return _context.abrupt("return", b3dmConverter.convert(data, options.featureAttributes));
18
- case 2:
19
- case "end":
20
- return _context.stop();
21
- }
22
- }, _callee);
23
- }));
24
- return function (_x) {
25
- return _ref.apply(this, arguments);
26
- };
27
- }());
28
- //# sourceMappingURL=3d-tiles-attributes-worker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"3d-tiles-attributes-worker.js","names":["_workerUtils","require","_b3dmConverter","_interopRequireDefault","b3dmConverter","B3dmConverter","createWorker","_ref","_asyncToGenerator2","default","_regenerator","mark","_callee","data","options","_args","arguments","wrap","_callee$","_context","prev","next","length","undefined","abrupt","convert","featureAttributes","stop","_x","apply"],"sources":["../../../src/workers/3d-tiles-attributes-worker.ts"],"sourcesContent":["import {createWorker} from '@loaders.gl/worker-utils';\nimport B3dmConverter from '../3d-tiles-converter/helpers/b3dm-converter';\n\nconst b3dmConverter = new B3dmConverter();\n\ncreateWorker(async (data, options = {}) => b3dmConverter.convert(data, options.featureAttributes));\n"],"mappings":";;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAMG,aAAa,GAAG,IAAIC,sBAAa,CAAC,CAAC;AAEzC,IAAAC,yBAAY;EAAA,IAAAC,IAAA,OAAAC,kBAAA,CAAAC,OAAA,EAAAC,YAAA,CAAAD,OAAA,CAAAE,IAAA,CAAC,SAAAC,QAAOC,IAAI;IAAA,IAAAC,OAAA;MAAAC,KAAA,GAAAC,SAAA;IAAA,OAAAN,YAAA,CAAAD,OAAA,CAAAQ,IAAA,UAAAC,SAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UAAEP,OAAO,GAAAC,KAAA,CAAAO,MAAA,QAAAP,KAAA,QAAAQ,SAAA,GAAAR,KAAA,MAAG,CAAC,CAAC;UAAA,OAAAI,QAAA,CAAAK,MAAA,WAAKpB,aAAa,CAACqB,OAAO,CAACZ,IAAI,EAAEC,OAAO,CAACY,iBAAiB,CAAC;QAAA;QAAA;UAAA,OAAAP,QAAA,CAAAQ,IAAA;MAAA;IAAA,GAAAf,OAAA;EAAA;EAAA,iBAAAgB,EAAA;IAAA,OAAArB,IAAA,CAAAsB,KAAA,OAAAb,SAAA;EAAA;AAAA,IAAC"}
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
5
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
6
- var _workerUtils = require("@loaders.gl/worker-utils");
7
- var _geometryConverter = require("../i3s-converter/helpers/geometry-converter");
8
- (0, _workerUtils.createWorker)(function () {
9
- var _ref = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(data) {
10
- var options,
11
- _args = arguments;
12
- return _regenerator.default.wrap(function _callee$(_context) {
13
- while (1) switch (_context.prev = _context.next) {
14
- case 0:
15
- options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
16
- _context.next = 3;
17
- return (0, _geometryConverter.convertAttributes)(data, options.materialAndTextureList, options.useCartesianPositions);
18
- case 3:
19
- return _context.abrupt("return", _context.sent);
20
- case 4:
21
- case "end":
22
- return _context.stop();
23
- }
24
- }, _callee);
25
- }));
26
- return function (_x) {
27
- return _ref.apply(this, arguments);
28
- };
29
- }());
30
- //# sourceMappingURL=i3s-attributes-worker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i3s-attributes-worker.js","names":["_workerUtils","require","_geometryConverter","createWorker","_ref","_asyncToGenerator2","default","_regenerator","mark","_callee","data","options","_args","arguments","wrap","_callee$","_context","prev","next","length","undefined","convertAttributes","materialAndTextureList","useCartesianPositions","abrupt","sent","stop","_x","apply"],"sources":["../../../src/workers/i3s-attributes-worker.ts"],"sourcesContent":["import {createWorker} from '@loaders.gl/worker-utils';\nimport {convertAttributes} from '../i3s-converter/helpers/geometry-converter';\n\ncreateWorker(\n async (data, options = {}) =>\n await convertAttributes(data, options.materialAndTextureList, options.useCartesianPositions)\n);\n"],"mappings":";;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAEA,IAAAE,yBAAY;EAAA,IAAAC,IAAA,OAAAC,kBAAA,CAAAC,OAAA,EAAAC,YAAA,CAAAD,OAAA,CAAAE,IAAA,CACV,SAAAC,QAAOC,IAAI;IAAA,IAAAC,OAAA;MAAAC,KAAA,GAAAC,SAAA;IAAA,OAAAN,YAAA,CAAAD,OAAA,CAAAQ,IAAA,UAAAC,SAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UAAEP,OAAO,GAAAC,KAAA,CAAAO,MAAA,QAAAP,KAAA,QAAAQ,SAAA,GAAAR,KAAA,MAAG,CAAC,CAAC;UAAAI,QAAA,CAAAE,IAAA;UAAA,OACjB,IAAAG,oCAAiB,EAACX,IAAI,EAAEC,OAAO,CAACW,sBAAsB,EAAEX,OAAO,CAACY,qBAAqB,CAAC;QAAA;UAAA,OAAAP,QAAA,CAAAQ,MAAA,WAAAR,QAAA,CAAAS,IAAA;QAAA;QAAA;UAAA,OAAAT,QAAA,CAAAU,IAAA;MAAA;IAAA,GAAAjB,OAAA;EAAA;EAAA,iBAAAkB,EAAA;IAAA,OAAAvB,IAAA,CAAAwB,KAAA,OAAAf,SAAA;EAAA;AAAA,GAChG,CAAC"}
@@ -1,16 +0,0 @@
1
- import { processOnWorker } from '@loaders.gl/worker-utils';
2
- const VERSION = typeof "4.0.0-alpha.13" !== 'undefined' ? "4.0.0-alpha.13" : 'latest';
3
- export const Tile3dAttributesWorker = {
4
- id: '3d-tiles-attributes',
5
- name: '3DTiles Attributes Worker',
6
- module: 'tile-converter',
7
- version: VERSION,
8
- options: {
9
- featureAttributes: null
10
- }
11
- };
12
- export function transform3DTilesAttributesOnWorker(i3sAttributesData, options) {
13
- return processOnWorker(Tile3dAttributesWorker, i3sAttributesData, options);
14
- }
15
- export const _typecheckI3SAttributesWorker = Tile3dAttributesWorker;
16
- //# sourceMappingURL=3d-tiles-attributes-worker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"3d-tiles-attributes-worker.js","names":["processOnWorker","VERSION","Tile3dAttributesWorker","id","name","module","version","options","featureAttributes","transform3DTilesAttributesOnWorker","i3sAttributesData","_typecheckI3SAttributesWorker"],"sources":["../../src/3d-tiles-attributes-worker.ts"],"sourcesContent":["import type {WorkerObject} from '@loaders.gl/worker-utils';\nimport type {FeatureAttribute} from '@loaders.gl/i3s';\n\nimport {processOnWorker} from '@loaders.gl/worker-utils';\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 Tile3DAttributesWorkerOptions = {\n featureAttributes: FeatureAttribute | null;\n source: string;\n};\n\nexport type I3SAttributesData = {\n tileContent: any;\n textureFormat: string;\n};\n\n/**\n * I3S Attributes Worker to handle B3DM object\n */\nexport const Tile3dAttributesWorker = {\n id: '3d-tiles-attributes',\n name: '3DTiles Attributes Worker',\n module: 'tile-converter',\n version: VERSION,\n options: {\n featureAttributes: null\n }\n};\n\n/**\n * Performs I3S attributes transformation\n */\nexport function transform3DTilesAttributesOnWorker(\n i3sAttributesData: I3SAttributesData,\n options: Tile3DAttributesWorkerOptions\n): Promise<ArrayBuffer> {\n return processOnWorker(Tile3dAttributesWorker, i3sAttributesData, options);\n}\n\nexport const _typecheckI3SAttributesWorker: WorkerObject = Tile3dAttributesWorker;\n"],"mappings":"AAGA,SAAQA,eAAe,QAAO,0BAA0B;AAIxD,MAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,QAAQ;AAe3E,OAAO,MAAMC,sBAAsB,GAAG;EACpCC,EAAE,EAAE,qBAAqB;EACzBC,IAAI,EAAE,2BAA2B;EACjCC,MAAM,EAAE,gBAAgB;EACxBC,OAAO,EAAEL,OAAO;EAChBM,OAAO,EAAE;IACPC,iBAAiB,EAAE;EACrB;AACF,CAAC;AAKD,OAAO,SAASC,kCAAkCA,CAChDC,iBAAoC,EACpCH,OAAsC,EAChB;EACtB,OAAOP,eAAe,CAACE,sBAAsB,EAAEQ,iBAAiB,EAAEH,OAAO,CAAC;AAC5E;AAEA,OAAO,MAAMI,6BAA2C,GAAGT,sBAAsB"}
@@ -1,16 +0,0 @@
1
- import { processOnWorker } from '@loaders.gl/worker-utils';
2
- const VERSION = typeof "4.0.0-alpha.13" !== 'undefined' ? "4.0.0-alpha.13" : 'latest';
3
- export const I3SAttributesWorker = {
4
- id: 'i3s-attributes',
5
- name: 'I3S Attributes Worker',
6
- module: 'tile-converter',
7
- version: VERSION,
8
- options: {
9
- useCartesianPositions: false
10
- }
11
- };
12
- export function transformI3SAttributesOnWorker(attributesData, options) {
13
- return processOnWorker(I3SAttributesWorker, attributesData, options);
14
- }
15
- export const _typecheckI3SAttributesWorker = I3SAttributesWorker;
16
- //# sourceMappingURL=i3s-attributes-worker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i3s-attributes-worker.js","names":["processOnWorker","VERSION","I3SAttributesWorker","id","name","module","version","options","useCartesianPositions","transformI3SAttributesOnWorker","attributesData","_typecheckI3SAttributesWorker"],"sources":["../../src/i3s-attributes-worker.ts"],"sourcesContent":["import type {WorkerObject} from '@loaders.gl/worker-utils';\nimport type {ConvertedAttributes} from './i3s-converter/types';\nimport type {Matrix4, Vector3} from '@math.gl/core';\nimport type {GLTFNodePostprocessed} from '@loaders.gl/gltf';\n\nimport {processOnWorker} from '@loaders.gl/worker-utils';\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 I3SAttributesWorkerOptions = {\n _nodeWorkers: boolean;\n reuseWorkers: boolean;\n useCartesianPositions: boolean;\n source: string;\n};\n\nexport type TextureImageProperties = {\n data: Uint8Array;\n compressed?: boolean;\n height?: number;\n width?: number;\n components?: number;\n mimeType?: string;\n};\n\nexport type B3DMAttributesData = {\n gltfMaterials?: {id: string}[];\n nodes: GLTFNodePostprocessed[];\n images: (null | TextureImageProperties)[];\n cartographicOrigin: Vector3;\n cartesianModelMatrix: Matrix4;\n};\n\n/**\n * I3S Attributes Worker to handle B3DM object\n */\nexport const I3SAttributesWorker = {\n id: 'i3s-attributes',\n name: 'I3S Attributes Worker',\n module: 'tile-converter',\n version: VERSION,\n options: {\n useCartesianPositions: false\n }\n};\n\n/**\n * Performs I3S attributes transformation\n */\nexport function transformI3SAttributesOnWorker(\n attributesData: B3DMAttributesData,\n options: I3SAttributesWorkerOptions\n): Promise<Map<string, ConvertedAttributes>> {\n return processOnWorker(I3SAttributesWorker, attributesData, options);\n}\n\nexport const _typecheckI3SAttributesWorker: WorkerObject = I3SAttributesWorker;\n"],"mappings":"AAKA,SAAQA,eAAe,QAAO,0BAA0B;AAIxD,MAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,QAAQ;AA6B3E,OAAO,MAAMC,mBAAmB,GAAG;EACjCC,EAAE,EAAE,gBAAgB;EACpBC,IAAI,EAAE,uBAAuB;EAC7BC,MAAM,EAAE,gBAAgB;EACxBC,OAAO,EAAEL,OAAO;EAChBM,OAAO,EAAE;IACPC,qBAAqB,EAAE;EACzB;AACF,CAAC;AAKD,OAAO,SAASC,8BAA8BA,CAC5CC,cAAkC,EAClCH,OAAmC,EACQ;EAC3C,OAAOP,eAAe,CAACE,mBAAmB,EAAEQ,cAAc,EAAEH,OAAO,CAAC;AACtE;AAEA,OAAO,MAAMI,6BAA2C,GAAGT,mBAAmB"}
@@ -1,102 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * Module dependencies.
5
- */
6
-
7
- const app = require('../app');
8
- const debug = require('debug')('i3s-server:server');
9
- const https = require('https');
10
- const http = require('http');
11
- const fs = require('fs');
12
- const path = require('path');
13
-
14
- /**
15
- * Get port from environment and store in Express.
16
- */
17
-
18
- const httpPort = normalizePort(process.env.PORT || '80'); // eslint-disable-line no-process-env, no-undef
19
- const httpsPort = normalizePort(process.env.HTTPS_PORT || '443'); // eslint-disable-line no-process-env, no-undef
20
-
21
- /**
22
- * Create HTTP server.
23
- */
24
-
25
- const options = {
26
- key: fs.readFileSync(path.join(__dirname, '../certs/key.pem')),
27
- cert: fs.readFileSync(path.join(__dirname, '../certs/cert.pem'))
28
- };
29
-
30
- const httpServer = http.createServer(app);
31
- const httpsServer = https.createServer(options, app);
32
-
33
- /**
34
- * Listen on provided port, on all network interfaces.
35
- */
36
-
37
- httpServer.listen(httpPort);
38
- httpServer.on('error', formErrorHandler(httpPort));
39
- httpServer.on('listening', formListeningHandler(httpServer));
40
-
41
- httpsServer.listen(httpsPort);
42
- httpsServer.on('error', formErrorHandler(httpsPort));
43
- httpsServer.on('listening', formListeningHandler(httpsServer));
44
-
45
- /**
46
- * Normalize a port into a number, string, or false.
47
- */
48
-
49
- function normalizePort(val) {
50
- const chkPort = parseInt(val, 10);
51
-
52
- if (isNaN(chkPort)) {
53
- // named pipe
54
- return val;
55
- }
56
-
57
- if (chkPort >= 0) {
58
- // port number
59
- return chkPort;
60
- }
61
-
62
- return false;
63
- }
64
-
65
- /**
66
- * Event listener for HTTP/HTTPS server "error" event.
67
- */
68
-
69
- function formErrorHandler(optionalPort) {
70
- return function onError(error) {
71
- if (error.syscall !== 'listen') {
72
- throw error;
73
- }
74
-
75
- const bind = typeof port === 'string' ? `Pipe ${optionalPort}`: `Port ${optionalPort}`;
76
-
77
- // handle specific listen errors with friendly messages
78
- switch (error.code) {
79
- case 'EACCES':
80
- console.error(`${bind} requires elevated privileges`);// eslint-disable-line no-console, no-undef
81
- process.exit(1);// eslint-disable-line no-process-exit, no-undef
82
- break;
83
- case 'EADDRINUSE':
84
- console.error(`${bind} is already in use`);// eslint-disable-line no-console, no-undef
85
- process.exit(1);// eslint-disable-line no-process-exit, no-undef
86
- break;
87
- default:
88
- throw error;
89
- }
90
- }
91
- }
92
-
93
- /**
94
- * Event listener for HTTP/HTTPS server "listening" event.
95
- */
96
- function formListeningHandler(optionalServer) {
97
- return function onListening() {
98
- const addr = optionalServer.address();
99
- const bind = typeof addr === 'string' ? `pipe ${addr}` : `port ${addr.port}`;
100
- debug(`Listening on ${bind}`);
101
- }
102
- }
@@ -1,8 +0,0 @@
1
- import { createWorker } from '@loaders.gl/worker-utils';
2
- import B3dmConverter from '../3d-tiles-converter/helpers/b3dm-converter';
3
- const b3dmConverter = new B3dmConverter();
4
- createWorker(async function (data) {
5
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6
- return b3dmConverter.convert(data, options.featureAttributes);
7
- });
8
- //# sourceMappingURL=3d-tiles-attributes-worker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"3d-tiles-attributes-worker.js","names":["createWorker","B3dmConverter","b3dmConverter","data","options","arguments","length","undefined","convert","featureAttributes"],"sources":["../../../src/workers/3d-tiles-attributes-worker.ts"],"sourcesContent":["import {createWorker} from '@loaders.gl/worker-utils';\nimport B3dmConverter from '../3d-tiles-converter/helpers/b3dm-converter';\n\nconst b3dmConverter = new B3dmConverter();\n\ncreateWorker(async (data, options = {}) => b3dmConverter.convert(data, options.featureAttributes));\n"],"mappings":"AAAA,SAAQA,YAAY,QAAO,0BAA0B;AACrD,OAAOC,aAAa,MAAM,8CAA8C;AAExE,MAAMC,aAAa,GAAG,IAAID,aAAa,CAAC,CAAC;AAEzCD,YAAY,CAAC,gBAAOG,IAAI;EAAA,IAAEC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAAA,OAAKH,aAAa,CAACM,OAAO,CAACL,IAAI,EAAEC,OAAO,CAACK,iBAAiB,CAAC;AAAA,EAAC"}
@@ -1,7 +0,0 @@
1
- import { createWorker } from '@loaders.gl/worker-utils';
2
- import { convertAttributes } from '../i3s-converter/helpers/geometry-converter';
3
- createWorker(async function (data) {
4
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5
- return await convertAttributes(data, options.materialAndTextureList, options.useCartesianPositions);
6
- });
7
- //# sourceMappingURL=i3s-attributes-worker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i3s-attributes-worker.js","names":["createWorker","convertAttributes","data","options","arguments","length","undefined","materialAndTextureList","useCartesianPositions"],"sources":["../../../src/workers/i3s-attributes-worker.ts"],"sourcesContent":["import {createWorker} from '@loaders.gl/worker-utils';\nimport {convertAttributes} from '../i3s-converter/helpers/geometry-converter';\n\ncreateWorker(\n async (data, options = {}) =>\n await convertAttributes(data, options.materialAndTextureList, options.useCartesianPositions)\n);\n"],"mappings":"AAAA,SAAQA,YAAY,QAAO,0BAA0B;AACrD,SAAQC,iBAAiB,QAAO,6CAA6C;AAE7ED,YAAY,CACV,gBAAOE,IAAI;EAAA,IAAEC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAAA,OACvB,MAAMH,iBAAiB,CAACC,IAAI,EAAEC,OAAO,CAACI,sBAAsB,EAAEJ,OAAO,CAACK,qBAAqB,CAAC;AAAA,CAChG,CAAC"}
@@ -1,45 +0,0 @@
1
- import type { WorkerObject } from '@loaders.gl/worker-utils';
2
- import type { ConvertedAttributes } from './i3s-converter/types';
3
- import type { Matrix4, Vector3 } from '@math.gl/core';
4
- import type { GLTFNodePostprocessed } from '@loaders.gl/gltf';
5
- export type I3SAttributesWorkerOptions = {
6
- _nodeWorkers: boolean;
7
- reuseWorkers: boolean;
8
- useCartesianPositions: boolean;
9
- source: string;
10
- };
11
- export type TextureImageProperties = {
12
- data: Uint8Array;
13
- compressed?: boolean;
14
- height?: number;
15
- width?: number;
16
- components?: number;
17
- mimeType?: string;
18
- };
19
- export type B3DMAttributesData = {
20
- gltfMaterials?: {
21
- id: string;
22
- }[];
23
- nodes: GLTFNodePostprocessed[];
24
- images: (null | TextureImageProperties)[];
25
- cartographicOrigin: Vector3;
26
- cartesianModelMatrix: Matrix4;
27
- };
28
- /**
29
- * I3S Attributes Worker to handle B3DM object
30
- */
31
- export declare const I3SAttributesWorker: {
32
- id: string;
33
- name: string;
34
- module: string;
35
- version: any;
36
- options: {
37
- useCartesianPositions: boolean;
38
- };
39
- };
40
- /**
41
- * Performs I3S attributes transformation
42
- */
43
- export declare function transformI3SAttributesOnWorker(attributesData: B3DMAttributesData, options: I3SAttributesWorkerOptions): Promise<Map<string, ConvertedAttributes>>;
44
- export declare const _typecheckI3SAttributesWorker: WorkerObject;
45
- //# sourceMappingURL=i3s-attributes-worker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i3s-attributes-worker.d.ts","sourceRoot":"","sources":["../src/i3s-attributes-worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAQ5D,MAAM,MAAM,0BAA0B,GAAG;IACvC,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,aAAa,CAAC,EAAE;QAAC,EAAE,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IAC/B,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC/B,MAAM,EAAE,CAAC,IAAI,GAAG,sBAAsB,CAAC,EAAE,CAAC;IAC1C,kBAAkB,EAAE,OAAO,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;CAQ/B,CAAC;AAEF;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,cAAc,EAAE,kBAAkB,EAClC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAE3C;AAED,eAAO,MAAM,6BAA6B,EAAE,YAAkC,CAAC"}