{"name":"copc","version":"0.0.3","license":"UNLICENSED","_id":"copc@0.0.3","maintainers":[{"name":"connormanning","email":"connor@hobu.co"}],"dist":{"shasum":"9dd8a86a679b110a520871e3c964f07ac5330da9","tarball":"http://registry-npm.ywwl.com/copc/download/copc-0.0.3.tgz","fileCount":78,"integrity":"sha512-w7AVpmOyivX+xkyRQyy6BHbqhWauCqJmR0/WyqqKy8sACyfrfN9Z8CsDhQONujGi9zFQ73bDgFMfwK49tUc1wQ==","signatures":[{"sig":"MEQCIEEi0w/EHzSyW0QyAWQAyGv3f8TrlcOBK1xWG00a6U8jAiAOPcmY6oSY9aZMOr4jlR26OIoWwPWDbdfPtkWfakRXRg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":234230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5BKfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpd8w//SeTGlwLTfRaLHAwlCaSM6p06qj7+bdbDvsh4+uNV6CQQ0PMc\r\n2fs5sYPvg/ClvrpPoNvHu91W9a/qokjr47lEGAvauODrRAQ15MzsaEsNrSA3\r\nO7EhiguhFhrOovvTpm38+nMqZxRHg6+EyMbjhbVrrfB1bNoF+QFAXaSqCWKJ\r\ntr6WIfVqaUj+pV8rQqrJgKLY0aGgT3F7U5RBzdQ+WvA9ZnKelrThsGZRWDZn\r\ndyFnWf0iOchcZ1lnvWUvwHA/FnioWD5GhA32nfh2YmueL59T0FE+LhQkaOH9\r\np5vosWR5dOSpUiO41oCYJ42DWwTO38gua99NGUDpm8twwKk99ac/WHEJNqJp\r\nWsE+fjcJgT1S8lpaxdsmcmSl7PKs5CYvIF7vWOAU3ELxUzFq7G6UTZj1OBfU\r\nxn3AfKBOTVohmnOGBtUOkSv5HhQWjQfc+mPKi7MyBHEAmxSO1C793Xam8XZz\r\nMcnaftu30a2fmLBb5pbn2eJX7uwZ5miDxV9jdkaV1i2pMDiVzAaUD8kzRtua\r\nYoPZMj34Q9uo2RcV9ipzrtzI7wGjhnY6Ix3+NZHTOLx9r+QTiPS9l17wwTTd\r\n0CN5xzz6EfDTGUmkhOwYULKLTuPtxXf+iwayrFmVXt30d6j14VOFuSsdXv0w\r\nPwQtM/tbYxJXGt7dSzYOgsH+DTlJ57xkuAU=\r\n=lpKl\r\n-----END PGP SIGNATURE-----\r\n","size":46330,"noattachment":false,"key":"/copc/-/copc-0.0.3.tgz"},"main":"lib/index.js","husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"scripts":{"tsc":"ttsc --project tsconfig.production.json","test":"jest","build":"rollup -c && ttsc --project tsconfig.production.json --emitDeclarationOnly","prepare":"yarn build"},"_npmUser":{"name":"connormanning","email":"connor@hobu.co"},"description":"![test](https://github.com/connormanning/copc/workflows/test/badge.svg)","directories":{},"licenseText":"MIT License\n\nCopyright (c) 2021 Connor Manning\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","dependencies":{"laz-perf":"^0.0.3","cross-fetch":"^3.1.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.6","husky":"^7.0.1","tslib":"^2.3.1","rollup":"^2.67.2","ts-jest":"^27.0.5","ts-node":"^10.2.0","prettier":"^2.3.2","ts-loader":"^9.2.5","typescript":"^4.5.5","@types/jest":"^27.0.1","@types/node":"^16.6.1","ttypescript":"^1.5.12","pretty-quick":"^3.1.1","@types/emscripten":"^1.39.5","@rollup/plugin-json":"^4.1.0","@rollup/plugin-commonjs":"^21.0.3","@rollup/plugin-typescript":"^8.3.0","rollup-plugin-includepaths":"^0.2.4","@rollup/plugin-node-resolve":"^13.1.3","@zerollup/ts-transform-paths":"^1.7.18"},"_npmOperationalInternal":{"tmp":"tmp/copc_0.0.3_1659114142962_0.8522437221216892","host":"s3://npm-registry-packages"},"readme":"# COPC\n![test](https://github.com/connormanning/copc/workflows/test/badge.svg)\n\nA TypeScript library for reading and parsing [COPC](https://copc.io/) data.\n\n`npm install copc`\n\n## Usage\n\n### Initialize a COPC object\n```typescript\n// Can also pass a getter instead of a filename string.\nconst copc = await Copc.create(filename)\nconsole.log(copc)\n```\n```\n{\n  header: {\n    fileSignature: 'LASF',\n    fileSourceId: 0,\n    globalEncoding: 16,\n    projectId: '00000000-0000-0000-0000000000000000',\n    majorVersion: 1,\n    minorVersion: 4,\n    systemIdentifier: '',\n    generatingSoftware: '',\n    fileCreationDayOfYear: 1,\n    fileCreationYear: 1,\n    headerLength: 375,\n    pointDataOffset: 1424,\n    vlrCount: 3,\n    pointDataRecordFormat: 7,\n    pointDataRecordLength: 36,\n    pointCount: 100000,\n    pointCountByReturn: [\n      50002, 49998, 0, 0,\n          0,     0, 0, 0,\n          0,     0, 0, 0,\n          0,     0, 0\n    ],\n    scale: [ 0.01, 0.01, 0.01 ],\n    offset: [ -8242596, 4966606, 0 ],\n    min: [ -8242746, 4966506, -50 ],\n    max: [ -8242446, 4966706, 50 ],\n    waveformDataOffset: 0,\n    evlrOffset: 630520,\n    evlrCount: 1\n  },\n  vlrs: [\n    {\n      userId: 'copc',\n      recordId: 1,\n      contentOffset: 429,\n      contentLength: 160,\n      description: 'COPC info VLR',\n      isExtended: false\n    },\n    {\n      userId: 'laszip encoded',\n      recordId: 22204,\n      contentOffset: 643,\n      contentLength: 46,\n      description: 'lazperf variant',\n      isExtended: false\n    },\n    {\n      userId: 'LASF_Projection',\n      recordId: 2112,\n      contentOffset: 743,\n      contentLength: 681,\n      description: '',\n      isExtended: false\n    },\n    {\n      userId: 'copc',\n      recordId: 1000,\n      contentOffset: 630580,\n      contentLength: 160,\n      description: 'COPC Hierarchy',\n      isExtended: true\n    }\n  ],\n  info: {\n    cube: [ -8242746, 4966506, -50, -8242446, 4966806, 250 ],\n    spacing: 2.34375,\n    rootHierarchyPage: { pageOffset: 630580, pageLength: 160 },\n    gpsTimeRange: [ 42, 42 ]\n  },\n  wkt: 'PROJCS[\"WGS 84 / Pseudo-Mercator\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Mercator_1SP\"],PARAMETER[\"central_meridian\",0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],EXTENSION[\"PROJ4\",\"+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs\"],AUTHORITY[\"EPSG\",\"3857\"]]',\n  eb: []\n}\n```\n\n### Traverse hierarchy and read point data\n```typescript\nconst { nodes, pages } = await Copc.loadHierarchyPage(\n  filename,\n  copc.info.rootHierarchyPage\n)\nconst root = nodes['0-0-0-0']!\nconst view = await Copc.loadPointDataView(filename, copc, root)\nconsole.log('Dimensions:', view.dimensions)\n\nconst getters = ['X', 'Y', 'Z', 'Intensity'].map(view.getter)\nfunction getXyzi(index: number) {\n  return getters.map(get => get(index))\n}\nconst point = getXyzi(0)\nconsole.log('Point:', point)\n```\n```\nDimensions: {\n  X: { type: 'float', size: 8 },\n  Y: { type: 'float', size: 8 },\n  Z: { type: 'float', size: 8 },\n  Intensity: { type: 'unsigned', size: 2 },\n  ReturnNumber: { type: 'unsigned', size: 1 },\n  NumberOfReturns: { type: 'unsigned', size: 1 },\n  Synthetic: { type: 'unsigned', size: 1 },\n  KeyPoint: { type: 'unsigned', size: 1 },\n  Withheld: { type: 'unsigned', size: 1 },\n  Overlap: { type: 'unsigned', size: 1 },\n  ScannerChannel: { type: 'unsigned', size: 1 },\n  ScanDirectionFlag: { type: 'unsigned', size: 1 },\n  EdgeOfFlightLine: { type: 'unsigned', size: 1 },\n  Classification: { type: 'unsigned', size: 1 },\n  UserData: { type: 'unsigned', size: 1 },\n  ScanAngle: { type: 'float', size: 4 },\n  PointSourceId: { type: 'unsigned', size: 2 },\n  GpsTime: { type: 'float', size: 8 },\n  Red: { type: 'unsigned', size: 2 },\n  Green: { type: 'unsigned', size: 2 },\n  Blue: { type: 'unsigned', size: 2 }\n}\nPoint: [-8242596, 4966706, 50, 128]\n```\n","publish_time":1659114143551,"_cnpm_publish_time":1659114143551,"dist-tags":{"latest":"0.0.9"}}