itowns 2.45.1 → 2.45.2-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/dist/455.js +1 -1
  2. package/dist/455.js.map +1 -1
  3. package/dist/debug.js +1 -1
  4. package/dist/debug.js.LICENSE.txt +8 -2
  5. package/dist/debug.js.map +1 -1
  6. package/dist/itowns.js +1 -1
  7. package/dist/itowns.js.LICENSE.txt +1 -1
  8. package/dist/itowns.js.map +1 -1
  9. package/dist/itowns_lasparser.js +1 -1
  10. package/dist/itowns_lasparser.js.map +1 -1
  11. package/dist/itowns_lasworker.js +1 -1
  12. package/dist/itowns_lasworker.js.map +1 -1
  13. package/dist/itowns_potree2worker.js +1 -1
  14. package/dist/itowns_potree2worker.js.map +1 -1
  15. package/dist/itowns_widgets.js +1 -1
  16. package/dist/itowns_widgets.js.map +1 -1
  17. package/examples/copc_simple_loader.html +3 -3
  18. package/examples/entwine_3d_loader.html +2 -2
  19. package/examples/entwine_simple_loader.html +10 -6
  20. package/examples/potree2_25d_map.html +2 -2
  21. package/examples/potree_25d_map.html +2 -2
  22. package/examples/potree_3d_map.html +2 -2
  23. package/examples/view_3d_map_webxr.html +2 -5
  24. package/lib/Controls/FirstPersonControls.d.ts +90 -0
  25. package/lib/Controls/FlyControls.d.ts +36 -0
  26. package/lib/Controls/GlobeControls.d.ts +274 -0
  27. package/lib/Controls/PlanarControls.d.ts +339 -0
  28. package/lib/Controls/StateControl.d.ts +140 -0
  29. package/lib/Controls/StreetControls.d.ts +134 -0
  30. package/lib/Controls/VRControls.d.ts +56 -0
  31. package/lib/Controls/VRControls.js +409 -0
  32. package/lib/Converter/Feature2Mesh.d.ts +42 -0
  33. package/lib/Converter/Feature2Texture.d.ts +5 -0
  34. package/lib/Converter/convertToTile.d.ts +5 -0
  35. package/lib/Converter/convertToTile.js +2 -2
  36. package/lib/Converter/textureConverter.d.ts +4 -0
  37. package/lib/Core/3DTiles/C3DTBatchTable.d.ts +49 -0
  38. package/lib/Core/3DTiles/C3DTBatchTableHierarchyExtension.d.ts +37 -0
  39. package/lib/Core/3DTiles/C3DTBoundingVolume.d.ts +39 -0
  40. package/lib/Core/3DTiles/C3DTExtensions.d.ts +75 -0
  41. package/lib/Core/3DTiles/C3DTFeature.d.ts +47 -0
  42. package/lib/Core/3DTiles/C3DTilesEnums.d.ts +14 -0
  43. package/lib/Core/3DTiles/C3DTileset.d.ts +46 -0
  44. package/lib/Core/3DTiles/utils/BinaryPropertyAccessor.d.ts +14 -0
  45. package/lib/Core/AnimationPlayer.d.ts +53 -0
  46. package/lib/Core/CopcNode.d.ts +68 -0
  47. package/lib/Core/CopcNode.js +57 -74
  48. package/lib/Core/Deprecated/Undeprecator.d.ts +6 -0
  49. package/lib/Core/EntwinePointTileNode.d.ts +59 -0
  50. package/lib/Core/EntwinePointTileNode.js +16 -41
  51. package/lib/Core/Feature.d.ts +323 -0
  52. package/lib/Core/Geographic/GeoidGrid.d.ts +86 -0
  53. package/lib/Core/Label.d.ts +86 -0
  54. package/lib/Core/MainLoop.d.ts +23 -0
  55. package/lib/Core/Picking.d.ts +6 -0
  56. package/lib/Core/Picking.js +4 -0
  57. package/lib/Core/PointCloudNode.d.ts +16 -0
  58. package/lib/Core/PointCloudNode.js +34 -4
  59. package/lib/Core/Potree2Node.d.ts +11 -0
  60. package/lib/Core/Potree2Node.js +5 -60
  61. package/lib/Core/Potree2PointAttributes.d.ts +97 -0
  62. package/lib/Core/PotreeNode.d.ts +14 -0
  63. package/lib/Core/PotreeNode.js +28 -18
  64. package/lib/Core/Prefab/Globe/Atmosphere.d.ts +66 -0
  65. package/lib/Core/Prefab/Globe/Atmosphere.js +10 -5
  66. package/lib/Core/Prefab/Globe/GlobeLayer.d.ts +48 -0
  67. package/lib/Core/Prefab/Globe/GlobeTileBuilder.d.ts +38 -0
  68. package/lib/Core/Prefab/Globe/SkyShader.d.ts +5 -0
  69. package/lib/Core/Prefab/Globe/SkyShader.js +3 -3
  70. package/lib/Core/Prefab/GlobeView.d.ts +65 -0
  71. package/lib/Core/Prefab/GlobeView.js +9 -0
  72. package/lib/Core/Prefab/Planar/PlanarLayer.d.ts +38 -0
  73. package/lib/Core/Prefab/Planar/PlanarTileBuilder.d.ts +32 -0
  74. package/lib/Core/Prefab/PlanarView.d.ts +33 -0
  75. package/lib/Core/Prefab/TileBuilder.d.ts +63 -0
  76. package/lib/Core/Prefab/computeBufferTileGeometry.d.ts +17 -0
  77. package/lib/Core/Scheduler/Cache.d.ts +25 -0
  78. package/lib/Core/Scheduler/CancelledCommandException.d.ts +12 -0
  79. package/lib/Core/Scheduler/Scheduler.d.ts +106 -0
  80. package/lib/Core/Style.d.ts +248 -0
  81. package/lib/Core/StyleOptions.d.ts +455 -0
  82. package/lib/Core/System/Capabilities.d.ts +9 -0
  83. package/lib/Core/Tile/Tile.d.ts +70 -0
  84. package/lib/Core/Tile/TileGrid.d.ts +12 -0
  85. package/lib/Core/TileGeometry.d.ts +46 -0
  86. package/lib/Core/TileMesh.d.ts +50 -0
  87. package/lib/Core/TileMesh.js +2 -4
  88. package/lib/Core/View.d.ts +403 -0
  89. package/lib/Core/View.js +1 -7
  90. package/lib/Layer/C3DTilesLayer.d.ts +140 -0
  91. package/lib/Layer/ColorLayer.d.ts +128 -0
  92. package/lib/Layer/ColorLayer.js +4 -4
  93. package/lib/Layer/CopcLayer.d.ts +42 -0
  94. package/lib/Layer/CopcLayer.js +3 -6
  95. package/lib/Layer/ElevationLayer.d.ts +96 -0
  96. package/lib/Layer/ElevationLayer.js +3 -3
  97. package/lib/Layer/EntwinePointTileLayer.d.ts +56 -0
  98. package/lib/Layer/EntwinePointTileLayer.js +4 -3
  99. package/lib/Layer/FeatureGeometryLayer.d.ts +62 -0
  100. package/lib/Layer/GeoidLayer.d.ts +41 -0
  101. package/lib/Layer/GeometryLayer.d.ts +120 -0
  102. package/lib/Layer/InfoLayer.d.ts +24 -0
  103. package/lib/Layer/InfoLayer.js +1 -1
  104. package/lib/Layer/LabelLayer.d.ts +93 -0
  105. package/lib/Layer/LabelLayer.js +2 -2
  106. package/lib/Layer/Layer.d.ts +185 -0
  107. package/lib/Layer/LayerUpdateState.d.ts +24 -0
  108. package/lib/Layer/LayerUpdateStrategy.d.ts +11 -0
  109. package/lib/Layer/LayerUpdateStrategy.js +2 -7
  110. package/lib/Layer/OGC3DTilesLayer.d.ts +277 -0
  111. package/lib/Layer/OGC3DTilesLayer.js +21 -0
  112. package/lib/Layer/OrientedImageLayer.d.ts +53 -0
  113. package/lib/Layer/PointCloudLayer.d.ts +103 -0
  114. package/lib/Layer/PointCloudLayer.js +8 -11
  115. package/lib/Layer/Potree2Layer.d.ts +56 -0
  116. package/lib/Layer/Potree2Layer.js +0 -2
  117. package/lib/Layer/PotreeLayer.d.ts +55 -0
  118. package/lib/Layer/RasterLayer.d.ts +8 -0
  119. package/lib/Layer/RasterLayer.js +2 -2
  120. package/lib/Layer/ReferencingLayerProperties.d.ts +2 -0
  121. package/lib/Layer/ReferencingLayerProperties.js +0 -12
  122. package/lib/Layer/TiledGeometryLayer.d.ts +192 -0
  123. package/lib/Layer/TiledGeometryLayer.js +4 -3
  124. package/lib/Main.d.ts +89 -0
  125. package/lib/Main.js +3 -1
  126. package/lib/Parser/B3dmParser.d.ts +26 -0
  127. package/lib/Parser/CameraCalibrationParser.d.ts +32 -0
  128. package/lib/Parser/GDFParser.d.ts +24 -0
  129. package/lib/Parser/GTXParser.d.ts +28 -0
  130. package/lib/Parser/GeoJsonParser.d.ts +12 -0
  131. package/lib/Parser/GpxParser.d.ts +12 -0
  132. package/lib/Parser/ISGParser.d.ts +23 -0
  133. package/lib/Parser/KMLParser.d.ts +12 -0
  134. package/lib/Parser/LASParser.d.ts +61 -0
  135. package/lib/Parser/MapBoxUrlParser.d.ts +9 -0
  136. package/lib/Parser/PntsParser.d.ts +4 -0
  137. package/lib/Parser/Potree2BinParser.d.ts +8 -0
  138. package/lib/Parser/PotreeBinParser.d.ts +4 -0
  139. package/lib/Parser/PotreeCinParser.d.ts +4 -0
  140. package/lib/Parser/ShapefileParser.d.ts +25 -0
  141. package/lib/Parser/VectorTileParser.d.ts +34 -0
  142. package/lib/Parser/XbilParser.d.ts +18 -0
  143. package/lib/Parser/deprecated/LegacyGLTFLoader.d.ts +32 -0
  144. package/lib/Parser/iGLTFLoader.d.ts +104 -0
  145. package/lib/Process/3dTilesProcessing.d.ts +43 -0
  146. package/lib/Process/FeatureProcessing.d.ts +4 -0
  147. package/lib/Process/LayeredMaterialNodeProcessing.d.ts +3 -0
  148. package/lib/Process/LayeredMaterialNodeProcessing.js +12 -12
  149. package/lib/Process/ObjectRemovalHelper.d.ts +32 -0
  150. package/lib/Process/handlerNodeError.d.ts +1 -0
  151. package/lib/Provider/3dTilesProvider.d.ts +7 -0
  152. package/lib/Provider/DataSourceProvider.d.ts +4 -0
  153. package/lib/Provider/Fetcher.d.ts +101 -0
  154. package/lib/Provider/PointCloudProvider.d.ts +4 -0
  155. package/lib/Provider/TileProvider.d.ts +4 -0
  156. package/lib/Provider/URLBuilder.d.ts +28 -0
  157. package/lib/Renderer/Camera.d.ts +95 -0
  158. package/lib/Renderer/Color.d.ts +3 -0
  159. package/lib/Renderer/ColorLayersOrdering.d.ts +38 -0
  160. package/lib/Renderer/ColorLayersOrdering.js +2 -2
  161. package/lib/Renderer/CommonMaterial.d.ts +6 -0
  162. package/lib/Renderer/Label2DRenderer.d.ts +31 -0
  163. package/lib/Renderer/LayeredMaterial.d.ts +121 -0
  164. package/lib/Renderer/LayeredMaterial.js +221 -141
  165. package/lib/Renderer/OBB.d.ts +65 -0
  166. package/lib/Renderer/OrientedImageCamera.d.ts +36 -0
  167. package/lib/Renderer/OrientedImageMaterial.d.ts +68 -0
  168. package/lib/Renderer/PointsMaterial.d.ts +226 -0
  169. package/lib/Renderer/PointsMaterial.js +60 -22
  170. package/lib/Renderer/RasterTile.d.ts +53 -0
  171. package/lib/Renderer/RasterTile.js +8 -9
  172. package/lib/Renderer/RenderMode.d.ts +11 -0
  173. package/lib/Renderer/RenderMode.js +1 -0
  174. package/lib/Renderer/Shader/ShaderChunk.d.ts +78 -0
  175. package/lib/Renderer/Shader/ShaderUtils.d.ts +5 -0
  176. package/lib/Renderer/WebXR.d.ts +33 -0
  177. package/lib/Renderer/WebXR.js +128 -47
  178. package/lib/Renderer/c3DEngine.d.ts +55 -0
  179. package/lib/Renderer/c3DEngine.js +5 -1
  180. package/lib/Source/C3DTilesGoogleSource.d.ts +38 -0
  181. package/lib/Source/C3DTilesIonSource.d.ts +31 -0
  182. package/lib/Source/C3DTilesSource.d.ts +17 -0
  183. package/lib/Source/CopcSource.d.ts +79 -0
  184. package/lib/Source/EntwinePointTileSource.d.ts +40 -0
  185. package/lib/Source/EntwinePointTileSource.js +0 -5
  186. package/lib/Source/FileSource.d.ts +118 -0
  187. package/lib/Source/OGC3DTilesGoogleSource.d.ts +24 -0
  188. package/lib/Source/OGC3DTilesIonSource.d.ts +26 -0
  189. package/lib/Source/OGC3DTilesSource.d.ts +21 -0
  190. package/lib/Source/OrientedImageSource.d.ts +48 -0
  191. package/lib/Source/Potree2Source.d.ts +157 -0
  192. package/lib/Source/PotreeSource.d.ts +69 -0
  193. package/lib/Source/Source.d.ts +122 -0
  194. package/lib/Source/TMSSource.d.ts +77 -0
  195. package/lib/Source/VectorTilesSource.d.ts +56 -0
  196. package/lib/Source/WFSSource.d.ts +110 -0
  197. package/lib/Source/WMSSource.d.ts +85 -0
  198. package/lib/Source/WMTSSource.d.ts +65 -0
  199. package/lib/ThreeExtended/capabilities/WebGL.d.ts +9 -0
  200. package/lib/ThreeExtended/libs/ktx-parse.module.d.ts +274 -0
  201. package/lib/ThreeExtended/libs/motion-controllers.module.d.ts +64 -0
  202. package/lib/ThreeExtended/libs/motion-controllers.module.js +375 -0
  203. package/lib/ThreeExtended/libs/zstddec.module.d.ts +6 -0
  204. package/lib/ThreeExtended/loaders/DDSLoader.js +40 -1
  205. package/lib/ThreeExtended/loaders/DRACOLoader.d.ts +41 -0
  206. package/lib/ThreeExtended/loaders/GLTFLoader.d.ts +16 -0
  207. package/lib/ThreeExtended/loaders/GLTFLoader.js +22 -3
  208. package/lib/ThreeExtended/loaders/KTX2Loader.d.ts +116 -0
  209. package/lib/ThreeExtended/loaders/KTX2Loader.js +9 -2
  210. package/lib/ThreeExtended/math/ColorSpaces.d.ts +56 -0
  211. package/lib/ThreeExtended/utils/BufferGeometryUtils.d.ts +62 -0
  212. package/lib/ThreeExtended/utils/BufferGeometryUtils.js +2 -2
  213. package/lib/ThreeExtended/utils/WorkerPool.d.ts +19 -0
  214. package/lib/ThreeExtended/webxr/XRControllerModelFactory.d.ts +25 -0
  215. package/lib/ThreeExtended/webxr/XRControllerModelFactory.js +209 -0
  216. package/lib/Utils/CameraUtils.d.ts +132 -0
  217. package/lib/Utils/DEMUtils.d.ts +84 -0
  218. package/lib/Utils/DEMUtils.js +2 -2
  219. package/lib/Utils/FeaturesUtils.d.ts +17 -0
  220. package/lib/Utils/Gradients.d.ts +13 -0
  221. package/lib/Utils/ThreeUtils.d.ts +14 -0
  222. package/lib/Utils/placeObjectOnGround.d.ts +28 -0
  223. package/lib/global.d.js +0 -0
  224. package/package.json +18 -15
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("itowns_lasparser",[],t):"object"==typeof exports?exports.itowns_lasparser=t():e.itowns_lasparser=t()}(self,(()=>(()=>{var e,t,r={10539:()=>{},56794:(e,t,r)=>{"use strict";var n=r(15702),a=r(26977),o=r(15234);function i(e){return 1===e.majorVersion&&e.minorVersion<=2?8:16}const s=new class{constructor(){this._wasmPath="https://cdn.jsdelivr.net/npm/laz-perf@0.0.6/lib",this._wasmPromise=null}_initDecoder(){return this._wasmPromise||(this._wasmPromise=a.LazPerf.create({locateFile:e=>`${this._wasmPath}/${e}`})),this._wasmPromise}_parseView(e,t){const r=t.colorDepth??16,n=["X","Y","Z"].map(e.getter),a=e.getter("Intensity"),o=e.getter("ReturnNumber"),i=e.getter("NumberOfReturns"),s=e.getter("Classification"),p=e.getter("PointSourceId"),c=e.dimensions.Red?["Red","Green","Blue"].map(e.getter):void 0,u=e.getter("ScanAngle"),l=new Float32Array(3*e.pointCount),f=new Uint16Array(e.pointCount),h=new Uint8Array(e.pointCount),m=new Uint8Array(e.pointCount),w=new Uint8Array(e.pointCount),d=new Uint16Array(e.pointCount),y=c?new Uint8Array(4*e.pointCount):void 0,g=new Float32Array(e.pointCount),b=n.map((e=>e(0))).map((e=>Math.floor(e)));for(let t=0;t<e.pointCount;t++){const[e,v,C]=n.map((e=>e(t)));if(l[3*t]=e-b[0],l[3*t+1]=v-b[1],l[3*t+2]=C-b[2],f[t]=a(t),h[t]=o(t),m[t]=i(t),c){let[e,n,a]=c.map((e=>e(t)));16===r&&(e/=256,n/=256,a/=256),y[4*t]=e,y[4*t+1]=n,y[4*t+2]=a,y[4*t+3]=255}w[t]=s(t),d[t]=p(t),g[t]=u(t)}return{position:l,intensity:f,returnNumber:h,numberOfReturns:m,classification:w,pointSourceID:d,color:y,scanAngle:g,origin:b}}set lazPerf(e){this._wasmPath=e,this._wasmPromise=null}async parseChunk(e,t){const{header:r,eb:n,pointCount:a}=t,{pointDataRecordFormat:s,pointDataRecordLength:p}=r,c=t.colorDepth??i(r),u=new Uint8Array(e),l=await o.Las.PointData.decompressChunk(u,{pointCount:a,pointDataRecordFormat:s,pointDataRecordLength:p},this._initDecoder()),f=o.Las.View.create(l,r,n);return{attributes:this._parseView(f,{colorDepth:c})}}async parseFile(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=new Uint8Array(e),n=await o.Las.PointData.decompressFile(r,this._initDecoder()),a=o.Las.Header.parse(r),s=t.colorDepth??i(a),p=async(e,t)=>r.slice(e,t),c=await o.Las.Vlr.walk(p,a),u=o.Las.Vlr.find(c,"LASF_Spec",4),l=u&&o.Las.ExtraBytes.parse(await o.Las.Vlr.fetch(p,u)),f=o.Las.View.create(n,a,l);return{header:a,attributes:this._parseView(f,{colorDepth:s})}}};function p(e){return Object.values(e).filter(ArrayBuffer.isView).map((e=>e.buffer))}(0,n.p)({lazPerf(e){s.lazPerf=e},async parseChunk(e,t){const r=await s.parseChunk(e,t);return(0,n.mr)(r,p(r.attributes))},async parseFile(e,t){const r=await s.parseFile(e,t);return(0,n.mr)(r,p(r.attributes))}})}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return r[e].call(o.exports,o,o.exports,a),o.exports}return a.m=r,a.x=()=>{var e=a.O(void 0,[455],(()=>a(56794)));return a.O(e)},e=[],a.O=(t,r,n,o)=>{if(!r){var i=1/0;for(u=0;u<e.length;u++){for(var[r,n,o]=e[u],s=!0,p=0;p<r.length;p++)(!1&o||i>=o)&&Object.keys(a.O).every((e=>a.O[e](r[p])))?r.splice(p--,1):(s=!1,o<i&&(i=o));if(s){e.splice(u--,1);var c=n();void 0!==c&&(t=c)}}return t}o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[r,n,o]},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,r)=>(a.f[r](e,t),t)),[])),a.u=e=>e+".js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={899:1};a.f.i=(t,r)=>{e[t]||importScripts(a.p+a.u(t))};var t=self.webpackChunk=self.webpackChunk||[],r=t.push.bind(t);t.push=t=>{var[n,o,i]=t;for(var s in o)a.o(o,s)&&(a.m[s]=o[s]);for(i&&i(a);n.length;)e[n.pop()]=1;r(t)}})(),t=a.x,a.x=()=>a.e(455).then(t),a.x()})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("itowns_lasparser",[],t):"object"==typeof exports?exports.itowns_lasparser=t():e.itowns_lasparser=t()}(self,(()=>(()=>{var e,t,r={10539:()=>{},56794:(e,t,r)=>{"use strict";var n=r(15702),o=r(26977),a=r(15234);function i(e){return 1===e.majorVersion&&e.minorVersion<=2?8:16}const s=new class{constructor(){this._wasmPath="https://cdn.jsdelivr.net/npm/laz-perf@0.0.6/lib",this._wasmPromise=null}_initDecoder(){return this._wasmPromise||(this._wasmPromise=o.LazPerf.create({locateFile:e=>`${this._wasmPath}/${e}`})),this._wasmPromise}_parseView(e,t){const r=t.colorDepth??16,n=["X","Y","Z"].map(e.getter),o=e.getter("Intensity"),a=e.getter("ReturnNumber"),i=e.getter("NumberOfReturns"),s=e.getter("Classification"),p=e.getter("PointSourceId"),c=e.dimensions.Red?["Red","Green","Blue"].map(e.getter):void 0,u=e.getter("ScanAngle"),l=new Float32Array(3*e.pointCount),f=new Uint16Array(e.pointCount),h=new Uint8Array(e.pointCount),m=new Uint8Array(e.pointCount),w=new Uint8Array(e.pointCount),d=new Uint16Array(e.pointCount),y=c?new Uint8Array(4*e.pointCount):void 0,b=new Float32Array(e.pointCount),g=n.map((e=>e(0))).map((e=>Math.floor(e)));for(let t=0;t<e.pointCount;t++){const[e,v,C]=n.map((e=>e(t)));if(l[3*t]=e-g[0],l[3*t+1]=v-g[1],l[3*t+2]=C-g[2],f[t]=o(t),h[t]=a(t),m[t]=i(t),c){let[e,n,o]=c.map((e=>e(t)));16===r&&(e/=256,n/=256,o/=256),y[4*t]=e,y[4*t+1]=n,y[4*t+2]=o,y[4*t+3]=255}w[t]=s(t),d[t]=p(t),b[t]=u(t)}return{position:l,intensity:f,returnNumber:h,numberOfReturns:m,classification:w,pointSourceID:d,color:y,scanAngle:b,origin:g}}set lazPerf(e){this._wasmPath=e,this._wasmPromise=null}async parseChunk(e,t){const{header:r,eb:n,pointCount:o}=t,{pointDataRecordFormat:s,pointDataRecordLength:p}=r,c=t.colorDepth??i(r),u=new Uint8Array(e),l=await a.Las.PointData.decompressChunk(u,{pointCount:o,pointDataRecordFormat:s,pointDataRecordLength:p},this._initDecoder()),f=a.Las.View.create(l,r,n);return{attributes:this._parseView(f,{colorDepth:c})}}async parseFile(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=new Uint8Array(e),n=await a.Las.PointData.decompressFile(r,this._initDecoder()),o=a.Las.Header.parse(r),s=t.colorDepth??i(o),p=async(e,t)=>r.slice(e,t),c=await a.Las.Vlr.walk(p,o),u=a.Las.Vlr.find(c,"LASF_Spec",4),l=u&&a.Las.ExtraBytes.parse(await a.Las.Vlr.fetch(p,u)),f=a.Las.View.create(n,o,l);return{header:o,attributes:this._parseView(f,{colorDepth:s})}}};function p(e){return Object.values(e).filter(ArrayBuffer.isView).map((e=>e.buffer))}(0,n.p)({lazPerf(e){s.lazPerf=e},async parseChunk(e,t){const r=await s.parseChunk(e,t);return(0,n.mr)(r,p(r.attributes))},async parseFile(e,t){const r=await s.parseFile(e,t);return(0,n.mr)(r,p(r.attributes))}})}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var a=n[e]={exports:{}};return r[e].call(a.exports,a,a.exports,o),a.exports}return o.m=r,o.x=()=>{var e=o.O(void 0,[455],(()=>o(56794)));return o.O(e)},e=[],o.O=(t,r,n,a)=>{if(!r){var i=1/0;for(u=0;u<e.length;u++){for(var[r,n,a]=e[u],s=!0,p=0;p<r.length;p++)(!1&a||i>=a)&&Object.keys(o.O).every((e=>o.O[e](r[p])))?r.splice(p--,1):(s=!1,a<i&&(i=a));if(s){e.splice(u--,1);var c=n();void 0!==c&&(t=c)}}return t}a=a||0;for(var u=e.length;u>0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[r,n,a]},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,r)=>(o.f[r](e,t),t)),[])),o.u=e=>e+".js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e={899:1};o.f.i=(t,r)=>{e[t]||importScripts(o.p+o.u(t))};var t=self.webpackChunkitowns_repository=self.webpackChunkitowns_repository||[],r=t.push.bind(t);t.push=t=>{var[n,a,i]=t;for(var s in a)o.o(a,s)&&(o.m[s]=a[s]);for(i&&i(o);n.length;)e[n.pop()]=1;r(t)}})(),t=o.x,o.x=()=>o.e(455).then(t),o.x()})()));
2
2
  //# sourceMappingURL=itowns_lasparser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"itowns_lasparser.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,mB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AQ,IAAIA,QAAQ,QAAS,IAAIA,QAAQ,YAAa,KACpFnD,EAAoBoD,EAAIb,C,WCdxB,IAAIc,EAAkB,CACrB,IAAK,GAgBNrD,EAAoB3D,EAAEI,EAAI,CAACiF,EAASI,KAE/BuB,EAAgB3B,IAElBc,cAAcxC,EAAoBoD,EAAIpD,EAAoB+B,EAAEL,GAE9D,EAGD,IAAI4B,EAAqBhK,KAAmB,aAAIA,KAAmB,cAAK,GACpEiK,EAA6BD,EAAmBE,KAAKC,KAAKH,GAC9DA,EAAmBE,KAvBC9F,IACnB,IAAK8C,EAAUkD,EAAaC,GAAWjG,EACvC,IAAI,IAAIuC,KAAYyD,EAChB1D,EAAoBqB,EAAEqC,EAAazD,KACrCD,EAAoBK,EAAEJ,GAAYyD,EAAYzD,IAIhD,IADG0D,GAASA,EAAQ3D,GACdQ,EAASjC,QACd8E,EAAgB7C,EAASoD,OAAS,EACnCL,EAA2B7F,EAAK,C,KVnB7BlE,EAAOwG,EAAoBtD,EAC/BsD,EAAoBtD,EAAI,IAChBsD,EAAoByB,EAAE,KAAKoC,KAAKrK,GWDdwG,EAAoBtD,G","sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/runtime/chunk loaded","webpack:///webpack/runtime/startup chunk dependencies","webpack:///./packages/Main/src/Loader/LASLoader.js","webpack:///./packages/Main/src/Worker/LASLoaderWorker.js","webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/ensure chunk","webpack:///webpack/runtime/get javascript chunk filename","webpack:///webpack/runtime/global","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/publicPath","webpack:///webpack/runtime/importScripts chunk loading","webpack:///webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"itowns_lasparser\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"itowns_lasparser\"] = factory();\n\telse\n\t\troot[\"itowns_lasparser\"] = factory();\n})(self, () => {\nreturn ","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn __webpack_require__.e(455).then(next);\n};","import { LazPerf } from 'laz-perf';\nimport { Las } from 'copc';\n\n/**\n * @typedef {Object} Header - Partial LAS header.\n * @property {number} header.pointDataRecordFormat - Type of point data\n * records contained by the buffer.\n * @property {number} header.pointDataRecordLength - Size (in bytes) of the\n * point data records. If the specified size is larger than implied by the\n * point data record format (see above) the remaining bytes are user-specfic\n * \"extra bytes\". Those are described by an Extra Bytes VLR.\n * @property {number[]} header.scale - Scale factors (an array `[xScale,\n * yScale, zScale]`) multiplied to the X, Y, Z point record values.\n * @property {number[]} header.offset - Offsets (an array `[xOffset,\n * xOffset, zOffset]`) added to the scaled X, Y, Z point record values.\n */\n\nfunction defaultColorEncoding(header) {\n return header.majorVersion === 1 && header.minorVersion <= 2 ? 8 : 16;\n}\n\n/**\n * @classdesc\n * Loader for LAS and LAZ (LASZip) point clouds. It uses the copc.js library and\n * the laz-perf decoder under the hood.\n *\n * The laz-perf web assembly module is lazily fetched at runtime when a parsing\n * request is initiated. Location of laz-perf wasm defaults to the unpkg\n * repository.\n */\nclass LASLoader {\n constructor() {\n this._wasmPath = 'https://cdn.jsdelivr.net/npm/laz-perf@0.0.6/lib';\n this._wasmPromise = null;\n }\n _initDecoder() {\n if (this._wasmPromise) {\n return this._wasmPromise;\n }\n this._wasmPromise = LazPerf.create({\n locateFile: file => `${this._wasmPath}/${file}`\n });\n return this._wasmPromise;\n }\n _parseView(view, options) {\n const colorDepth = options.colorDepth ?? 16;\n const getPosition = ['X', 'Y', 'Z'].map(view.getter);\n const getIntensity = view.getter('Intensity');\n const getReturnNumber = view.getter('ReturnNumber');\n const getNumberOfReturns = view.getter('NumberOfReturns');\n const getClassification = view.getter('Classification');\n const getPointSourceID = view.getter('PointSourceId');\n const getColor = view.dimensions.Red ? ['Red', 'Green', 'Blue'].map(view.getter) : undefined;\n const getScanAngle = view.getter('ScanAngle');\n const positions = new Float32Array(view.pointCount * 3);\n const intensities = new Uint16Array(view.pointCount);\n const returnNumbers = new Uint8Array(view.pointCount);\n const numberOfReturns = new Uint8Array(view.pointCount);\n const classifications = new Uint8Array(view.pointCount);\n const pointSourceIDs = new Uint16Array(view.pointCount);\n const colors = getColor ? new Uint8Array(view.pointCount * 4) : undefined;\n /*\n As described by the LAS spec, Scan Angle is encoded:\n - as signed char in a valid range from -90 to +90 (degrees) prior to the LAS 1.4 Point Data Record Formats (PDRF) 6\n - as a signed short in a valid range from -30 000 to +30 000. Those values represents scan angles from -180 to +180\n degrees with an increment of 0.006 for PDRF >= 6.\n The copc.js library does the degree convertion and stores it as a `Float32`.\n */\n const scanAngles = new Float32Array(view.pointCount);\n\n // For precision we take the first point that will be use as origin for a local referentiel.\n const origin = getPosition.map(f => f(0)).map(val => Math.floor(val));\n for (let i = 0; i < view.pointCount; i++) {\n // `getPosition` apply scale and offset transform to the X, Y, Z\n // values. See https://github.com/connormanning/copc.js/blob/master/src/las/extractor.ts.\n const [x, y, z] = getPosition.map(f => f(i));\n positions[i * 3] = x - origin[0];\n positions[i * 3 + 1] = y - origin[1];\n positions[i * 3 + 2] = z - origin[2];\n intensities[i] = getIntensity(i);\n returnNumbers[i] = getReturnNumber(i);\n numberOfReturns[i] = getNumberOfReturns(i);\n if (getColor) {\n // Note that we do not infer color depth as it is expensive\n // (i.e. traverse the whole view to check if there exists a red,\n // green or blue value > 255).\n let [r, g, b] = getColor.map(f => f(i));\n if (colorDepth === 16) {\n r /= 256;\n g /= 256;\n b /= 256;\n }\n colors[i * 4] = r;\n colors[i * 4 + 1] = g;\n colors[i * 4 + 2] = b;\n colors[i * 4 + 3] = 255;\n }\n classifications[i] = getClassification(i);\n pointSourceIDs[i] = getPointSourceID(i);\n scanAngles[i] = getScanAngle(i);\n }\n return {\n position: positions,\n intensity: intensities,\n returnNumber: returnNumbers,\n numberOfReturns,\n classification: classifications,\n pointSourceID: pointSourceIDs,\n color: colors,\n scanAngle: scanAngles,\n origin\n };\n }\n\n /**\n * Set LazPerf decoder path.\n * @param {string} path - path to `laz-perf.wasm` folder.\n */\n set lazPerf(path) {\n this._wasmPath = path;\n this._wasmPromise = null;\n }\n\n /**\n * Parses a LAS or LAZ (LASZip) chunk. Note that this function is\n * **CPU-bound** and shall be parallelised in a dedicated worker.\n * @param {Uint8Array} data - File chunk data.\n * @param {Object} options - Parsing options.\n * @param {Header} options.header - Partial LAS header.\n * @param {number} options.pointCount - Number of points encoded in this\n * data chunk.\n * @param {Las.ExtraBytes[]} [options.eb] - Extra bytes LAS VLRs\n * headers.\n * @param {8 | 16} [options.colorDepth] - Color depth encoding (in bits).\n * Either 8 or 16 bits. Defaults to 8 bits for LAS 1.2 and 16 bits for later\n * versions (as mandatory by the specification).\n */\n async parseChunk(data, options) {\n const {\n header,\n eb,\n pointCount\n } = options;\n const {\n pointDataRecordFormat,\n pointDataRecordLength\n } = header;\n const colorDepth = options.colorDepth ?? defaultColorEncoding(header);\n const bytes = new Uint8Array(data);\n const pointData = await Las.PointData.decompressChunk(bytes, {\n pointCount,\n pointDataRecordFormat,\n pointDataRecordLength\n }, this._initDecoder());\n const view = Las.View.create(pointData, header, eb);\n const attributes = this._parseView(view, {\n colorDepth\n });\n return {\n attributes\n };\n }\n\n /**\n * Parses a LAS or LAZ (LASZip) file. Note that this function is\n * **CPU-bound** and shall be parallelised in a dedicated worker.\n * @param {ArrayBuffer} data - Binary data to parse.\n * @param {Object} [options] - Parsing options.\n * @param {8 | 16} [options.colorDepth] - Color depth encoding (in bits).\n * Either 8 or 16 bits. Defaults to 8 bits for LAS 1.2 and 16 bits for later\n * versions (as mandatory by the specification)\n */\n async parseFile(data) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const bytes = new Uint8Array(data);\n const pointData = await Las.PointData.decompressFile(bytes, this._initDecoder());\n const header = Las.Header.parse(bytes);\n const colorDepth = options.colorDepth ?? defaultColorEncoding(header);\n const getter = async (begin, end) => bytes.slice(begin, end);\n const vlrs = await Las.Vlr.walk(getter, header);\n const ebVlr = Las.Vlr.find(vlrs, 'LASF_Spec', 4);\n const eb = ebVlr && Las.ExtraBytes.parse(await Las.Vlr.fetch(getter, ebVlr));\n const view = Las.View.create(pointData, header, eb);\n const attributes = this._parseView(view, {\n colorDepth\n });\n return {\n header,\n attributes\n };\n }\n}\nexport default LASLoader;","import { expose, Transfer } from 'threads/worker';\nimport LASLoader from \"../Loader/LASLoader.js\";\nconst loader = new LASLoader();\nfunction transferable(attributes) {\n return Object.values(attributes).filter(ArrayBuffer.isView).map(a => a.buffer);\n}\nexpose({\n lazPerf(path) {\n loader.lazPerf = path;\n },\n async parseChunk(data, options) {\n const result = await loader.parseChunk(data, options);\n return Transfer(result, transferable(result.attributes));\n },\n async parseFile(data, options) {\n const result = await loader.parseFile(data, options);\n return Transfer(result, transferable(result.attributes));\n }\n});","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [455], () => (__webpack_require__(56794)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t899: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = self[\"webpackChunk\"] = self[\"webpackChunk\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["root","factory","exports","module","define","amd","self","deferred","next","defaultColorEncoding","header","majorVersion","minorVersion","loader","constructor","this","_wasmPath","_wasmPromise","_initDecoder","LazPerf","create","locateFile","file","_parseView","view","options","colorDepth","getPosition","map","getter","getIntensity","getReturnNumber","getNumberOfReturns","getClassification","getPointSourceID","getColor","dimensions","Red","undefined","getScanAngle","positions","Float32Array","pointCount","intensities","Uint16Array","returnNumbers","Uint8Array","numberOfReturns","classifications","pointSourceIDs","colors","scanAngles","origin","f","val","Math","floor","i","x","y","z","r","g","b","position","intensity","returnNumber","classification","pointSourceID","color","scanAngle","lazPerf","path","parseChunk","data","eb","pointDataRecordFormat","pointDataRecordLength","bytes","pointData","Las","PointData","decompressChunk","View","attributes","parseFile","arguments","length","decompressFile","Header","parse","async","begin","end","slice","vlrs","Vlr","walk","ebVlr","find","ExtraBytes","fetch","transferable","Object","values","filter","ArrayBuffer","isView","a","buffer","result","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","call","m","__webpack_exports__","O","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","j","keys","every","key","splice","d","definition","o","defineProperty","enumerable","get","e","chunkId","Promise","all","reduce","promises","u","globalThis","Function","window","obj","prop","prototype","hasOwnProperty","scriptUrl","importScripts","location","document","currentScript","tagName","toUpperCase","src","scripts","getElementsByTagName","test","Error","replace","p","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","push","bind","moreModules","runtime","pop","then"],"sourceRoot":""}
1
+ {"version":3,"file":"itowns_lasparser.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,mBAA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,IAAIA,QAAQ,OAAQ,IAAIA,QAAQ,QAAS,IAAIA,QAAQ,YAAa,KAC1GnD,EAAoBoD,EAAIb,C,WCdxB,IAAIc,EAAkB,CACrB,IAAK,GAgBNrD,EAAoB3D,EAAEI,EAAI,CAACiF,EAASI,KAE/BuB,EAAgB3B,IAElBc,cAAcxC,EAAoBoD,EAAIpD,EAAoB+B,EAAEL,GAE9D,EAGD,IAAI4B,EAAqBhK,KAAoC,8BAAIA,KAAoC,+BAAK,GACtGiK,EAA6BD,EAAmBE,KAAKC,KAAKH,GAC9DA,EAAmBE,KAvBC9F,IACnB,IAAK8C,EAAUkD,EAAaC,GAAWjG,EACvC,IAAI,IAAIuC,KAAYyD,EAChB1D,EAAoBqB,EAAEqC,EAAazD,KACrCD,EAAoBK,EAAEJ,GAAYyD,EAAYzD,IAIhD,IADG0D,GAASA,EAAQ3D,GACdQ,EAASjC,QACd8E,EAAgB7C,EAASoD,OAAS,EACnCL,EAA2B7F,EAAK,C,KVnB7BlE,EAAOwG,EAAoBtD,EAC/BsD,EAAoBtD,EAAI,IAChBsD,EAAoByB,EAAE,KAAKoC,KAAKrK,GWDdwG,EAAoBtD,G","sources":["webpack://itowns-repository/webpack/universalModuleDefinition","webpack://itowns-repository/webpack/runtime/chunk loaded","webpack://itowns-repository/webpack/runtime/startup chunk dependencies","webpack://itowns-repository/./packages/Main/src/Loader/LASLoader.js","webpack://itowns-repository/./packages/Main/src/Worker/LASLoaderWorker.js","webpack://itowns-repository/webpack/bootstrap","webpack://itowns-repository/webpack/runtime/define property getters","webpack://itowns-repository/webpack/runtime/ensure chunk","webpack://itowns-repository/webpack/runtime/get javascript chunk filename","webpack://itowns-repository/webpack/runtime/global","webpack://itowns-repository/webpack/runtime/hasOwnProperty shorthand","webpack://itowns-repository/webpack/runtime/publicPath","webpack://itowns-repository/webpack/runtime/importScripts chunk loading","webpack://itowns-repository/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"itowns_lasparser\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"itowns_lasparser\"] = factory();\n\telse\n\t\troot[\"itowns_lasparser\"] = factory();\n})(self, () => {\nreturn ","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn __webpack_require__.e(455).then(next);\n};","import { LazPerf } from 'laz-perf';\nimport { Las } from 'copc';\n\n/**\n * @typedef {Object} Header - Partial LAS header.\n * @property {number} header.pointDataRecordFormat - Type of point data\n * records contained by the buffer.\n * @property {number} header.pointDataRecordLength - Size (in bytes) of the\n * point data records. If the specified size is larger than implied by the\n * point data record format (see above) the remaining bytes are user-specfic\n * \"extra bytes\". Those are described by an Extra Bytes VLR.\n * @property {number[]} header.scale - Scale factors (an array `[xScale,\n * yScale, zScale]`) multiplied to the X, Y, Z point record values.\n * @property {number[]} header.offset - Offsets (an array `[xOffset,\n * xOffset, zOffset]`) added to the scaled X, Y, Z point record values.\n */\n\nfunction defaultColorEncoding(header) {\n return header.majorVersion === 1 && header.minorVersion <= 2 ? 8 : 16;\n}\n\n/**\n * @classdesc\n * Loader for LAS and LAZ (LASZip) point clouds. It uses the copc.js library and\n * the laz-perf decoder under the hood.\n *\n * The laz-perf web assembly module is lazily fetched at runtime when a parsing\n * request is initiated. Location of laz-perf wasm defaults to the unpkg\n * repository.\n */\nclass LASLoader {\n constructor() {\n this._wasmPath = 'https://cdn.jsdelivr.net/npm/laz-perf@0.0.6/lib';\n this._wasmPromise = null;\n }\n _initDecoder() {\n if (this._wasmPromise) {\n return this._wasmPromise;\n }\n this._wasmPromise = LazPerf.create({\n locateFile: file => `${this._wasmPath}/${file}`\n });\n return this._wasmPromise;\n }\n _parseView(view, options) {\n const colorDepth = options.colorDepth ?? 16;\n const getPosition = ['X', 'Y', 'Z'].map(view.getter);\n const getIntensity = view.getter('Intensity');\n const getReturnNumber = view.getter('ReturnNumber');\n const getNumberOfReturns = view.getter('NumberOfReturns');\n const getClassification = view.getter('Classification');\n const getPointSourceID = view.getter('PointSourceId');\n const getColor = view.dimensions.Red ? ['Red', 'Green', 'Blue'].map(view.getter) : undefined;\n const getScanAngle = view.getter('ScanAngle');\n const positions = new Float32Array(view.pointCount * 3);\n const intensities = new Uint16Array(view.pointCount);\n const returnNumbers = new Uint8Array(view.pointCount);\n const numberOfReturns = new Uint8Array(view.pointCount);\n const classifications = new Uint8Array(view.pointCount);\n const pointSourceIDs = new Uint16Array(view.pointCount);\n const colors = getColor ? new Uint8Array(view.pointCount * 4) : undefined;\n /*\n As described by the LAS spec, Scan Angle is encoded:\n - as signed char in a valid range from -90 to +90 (degrees) prior to the LAS 1.4 Point Data Record Formats (PDRF) 6\n - as a signed short in a valid range from -30 000 to +30 000. Those values represents scan angles from -180 to +180\n degrees with an increment of 0.006 for PDRF >= 6.\n The copc.js library does the degree convertion and stores it as a `Float32`.\n */\n const scanAngles = new Float32Array(view.pointCount);\n\n // For precision we take the first point that will be use as origin for a local referentiel.\n const origin = getPosition.map(f => f(0)).map(val => Math.floor(val));\n for (let i = 0; i < view.pointCount; i++) {\n // `getPosition` apply scale and offset transform to the X, Y, Z\n // values. See https://github.com/connormanning/copc.js/blob/master/src/las/extractor.ts.\n const [x, y, z] = getPosition.map(f => f(i));\n positions[i * 3] = x - origin[0];\n positions[i * 3 + 1] = y - origin[1];\n positions[i * 3 + 2] = z - origin[2];\n intensities[i] = getIntensity(i);\n returnNumbers[i] = getReturnNumber(i);\n numberOfReturns[i] = getNumberOfReturns(i);\n if (getColor) {\n // Note that we do not infer color depth as it is expensive\n // (i.e. traverse the whole view to check if there exists a red,\n // green or blue value > 255).\n let [r, g, b] = getColor.map(f => f(i));\n if (colorDepth === 16) {\n r /= 256;\n g /= 256;\n b /= 256;\n }\n colors[i * 4] = r;\n colors[i * 4 + 1] = g;\n colors[i * 4 + 2] = b;\n colors[i * 4 + 3] = 255;\n }\n classifications[i] = getClassification(i);\n pointSourceIDs[i] = getPointSourceID(i);\n scanAngles[i] = getScanAngle(i);\n }\n return {\n position: positions,\n intensity: intensities,\n returnNumber: returnNumbers,\n numberOfReturns,\n classification: classifications,\n pointSourceID: pointSourceIDs,\n color: colors,\n scanAngle: scanAngles,\n origin\n };\n }\n\n /**\n * Set LazPerf decoder path.\n * @param {string} path - path to `laz-perf.wasm` folder.\n */\n set lazPerf(path) {\n this._wasmPath = path;\n this._wasmPromise = null;\n }\n\n /**\n * Parses a LAS or LAZ (LASZip) chunk. Note that this function is\n * **CPU-bound** and shall be parallelised in a dedicated worker.\n * @param {Uint8Array} data - File chunk data.\n * @param {Object} options - Parsing options.\n * @param {Header} options.header - Partial LAS header.\n * @param {number} options.pointCount - Number of points encoded in this\n * data chunk.\n * @param {Las.ExtraBytes[]} [options.eb] - Extra bytes LAS VLRs\n * headers.\n * @param {8 | 16} [options.colorDepth] - Color depth encoding (in bits).\n * Either 8 or 16 bits. Defaults to 8 bits for LAS 1.2 and 16 bits for later\n * versions (as mandatory by the specification).\n */\n async parseChunk(data, options) {\n const {\n header,\n eb,\n pointCount\n } = options;\n const {\n pointDataRecordFormat,\n pointDataRecordLength\n } = header;\n const colorDepth = options.colorDepth ?? defaultColorEncoding(header);\n const bytes = new Uint8Array(data);\n const pointData = await Las.PointData.decompressChunk(bytes, {\n pointCount,\n pointDataRecordFormat,\n pointDataRecordLength\n }, this._initDecoder());\n const view = Las.View.create(pointData, header, eb);\n const attributes = this._parseView(view, {\n colorDepth\n });\n return {\n attributes\n };\n }\n\n /**\n * Parses a LAS or LAZ (LASZip) file. Note that this function is\n * **CPU-bound** and shall be parallelised in a dedicated worker.\n * @param {ArrayBuffer} data - Binary data to parse.\n * @param {Object} [options] - Parsing options.\n * @param {8 | 16} [options.colorDepth] - Color depth encoding (in bits).\n * Either 8 or 16 bits. Defaults to 8 bits for LAS 1.2 and 16 bits for later\n * versions (as mandatory by the specification)\n */\n async parseFile(data) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const bytes = new Uint8Array(data);\n const pointData = await Las.PointData.decompressFile(bytes, this._initDecoder());\n const header = Las.Header.parse(bytes);\n const colorDepth = options.colorDepth ?? defaultColorEncoding(header);\n const getter = async (begin, end) => bytes.slice(begin, end);\n const vlrs = await Las.Vlr.walk(getter, header);\n const ebVlr = Las.Vlr.find(vlrs, 'LASF_Spec', 4);\n const eb = ebVlr && Las.ExtraBytes.parse(await Las.Vlr.fetch(getter, ebVlr));\n const view = Las.View.create(pointData, header, eb);\n const attributes = this._parseView(view, {\n colorDepth\n });\n return {\n header,\n attributes\n };\n }\n}\nexport default LASLoader;","import { expose, Transfer } from 'threads/worker';\nimport LASLoader from \"../Loader/LASLoader.js\";\nconst loader = new LASLoader();\nfunction transferable(attributes) {\n return Object.values(attributes).filter(ArrayBuffer.isView).map(a => a.buffer);\n}\nexpose({\n lazPerf(path) {\n loader.lazPerf = path;\n },\n async parseChunk(data, options) {\n const result = await loader.parseChunk(data, options);\n return Transfer(result, transferable(result.attributes));\n },\n async parseFile(data, options) {\n const result = await loader.parseFile(data, options);\n return Transfer(result, transferable(result.attributes));\n }\n});","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [455], () => (__webpack_require__(56794)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/^blob:/, \"\").replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t899: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = self[\"webpackChunkitowns_repository\"] = self[\"webpackChunkitowns_repository\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["root","factory","exports","module","define","amd","self","deferred","next","defaultColorEncoding","header","majorVersion","minorVersion","loader","constructor","this","_wasmPath","_wasmPromise","_initDecoder","LazPerf","create","locateFile","file","_parseView","view","options","colorDepth","getPosition","map","getter","getIntensity","getReturnNumber","getNumberOfReturns","getClassification","getPointSourceID","getColor","dimensions","Red","undefined","getScanAngle","positions","Float32Array","pointCount","intensities","Uint16Array","returnNumbers","Uint8Array","numberOfReturns","classifications","pointSourceIDs","colors","scanAngles","origin","f","val","Math","floor","i","x","y","z","r","g","b","position","intensity","returnNumber","classification","pointSourceID","color","scanAngle","lazPerf","path","parseChunk","data","eb","pointDataRecordFormat","pointDataRecordLength","bytes","pointData","Las","PointData","decompressChunk","View","attributes","parseFile","arguments","length","decompressFile","Header","parse","async","begin","end","slice","vlrs","Vlr","walk","ebVlr","find","ExtraBytes","fetch","transferable","Object","values","filter","ArrayBuffer","isView","a","buffer","result","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","call","m","__webpack_exports__","O","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","j","keys","every","key","splice","d","definition","o","defineProperty","enumerable","get","e","chunkId","Promise","all","reduce","promises","u","globalThis","Function","window","obj","prop","prototype","hasOwnProperty","scriptUrl","importScripts","location","document","currentScript","tagName","toUpperCase","src","scripts","getElementsByTagName","test","Error","replace","p","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","push","bind","moreModules","runtime","pop","then"],"sourceRoot":""}