Registry / data / copc
library0.0.8jsnpmunverified

A TypeScript library for reading and parsing Cloud Optimized Point Cloud (COPC) data, version 0.0.8. It provides utilities to initialize a COPC object from a file or getter, traverse the hierarchy pages, and read point data views with typed dimension access. The library is pre-1.0 and actively maintained on GitHub with CI. It differentiates from other point cloud libraries by focusing specifically on the COPC format, offering a simple async API, and shipping TypeScript types.

npm install copc
INSTALL
IMPORT
SIG · COPC
C
copc
datajavascriptv0.0.8
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Copc
import { Copc } from 'copc'
const copc = require('copc')
ESM-only; CommonJS require will not work. Use named import.
Node
import type { Node } from 'copc'
import { Node } from 'copc'
Node is only a TypeScript type, cannot be used as a value.
CopcHeader
import type { CopcHeader } from 'copc'
import { Copc } from 'copc' and access Copc.Header
CopcHeader is a separate exported type, not a member of Copc class.

Shows how to initialize a Copc object, load the root hierarchy page, and read point data using dimension getters.

import { Copc } from 'copc'; async function main() { const filename = 'path/to/file.copc.laz'; const copc = await Copc.create(filename); console.log('Header:', copc.header); console.log('Info:', copc.info); const { nodes } = await Copc.loadHierarchyPage(filename, copc.info.rootHierarchyPage); const root = nodes['0-0-0-0']; if (root) { const view = await Copc.loadPointDataView(filename, copc, root); console.log('Dimensions:', view.dimensions); const getX = view.getter('X'); const getY = view.getter('Y'); const getZ = view.getter('Z'); const x = getX(0); const y = getY(0); const z = getZ(0); console.log(`Point 0: (${x}, ${y}, ${z})`); } } main().catch(console.error);
Debug
Known issues
breakingVersion 0.x may have breaking changes between minor versions. The API is not stable.
fix
Pin to a specific version and test after upgrades.
affects: >=0.0.0
gotchaThe library requires a file path or getter, not a URL. For remote files, you must implement a getter that fetches byte ranges.
fix
Provide a custom async getter function that returns ArrayBuffer for given byte offset and length.
affects: *
deprecatedAs of v0.0.8, no deprecations are known. However, pre-1.0 releases may deprecate features without notice.
fix
Watch the GitHub repository for changelog.
affects: *
Errors
Common errors & fixes
Error: Could not find module 'copc'
Missing npm install or ESM import syntax not transpiled.
fix
npm install copc and ensure your project is set up for ESM (e.g., "type": "module" in package.json).
TypeError: Copc.create is not a constructor
Using CommonJS require instead of ESM import.
fix
Replace 'const Copc = require("copc")' with 'import { Copc } from "copc"'.
Cannot find name 'CopcHeader'
Trying to use CopcHeader as a value, but it is only a type.
fix
Import as a type: 'import type { CopcHeader } from "copc"'.
Upgrade
Version history
0.0.8latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
copc — npm install copc · libregistry