Dependencies have been installed successfully.
npm run devAfter running:
- The browser opens automatically (
autzen.html- the Autzen Stadium COPC demo) - View the demo at http://localhost:5173/autzen.html
- Auto-reloads on file changes
Other demos are available too - see Project Structure below.
npm run buildBuild output:
dist/
├── index.cjs # CommonJS bundle
├── index.esm.js # ES Module bundle
├── index.d.ts # TypeScript type definitions
└── *.map # Source maps
# After building
npm run build
# Start an HTTP server
npx http-server . -p 8080
# Open in browser
# http://localhost:8080/examples/basic.htmlimport { COPCPointCloudProvider } from 'copc-cesium';
import { Viewer } from 'cesium';
// Create a Cesium Viewer
const viewer = new Viewer('cesiumContainer');
// Create a COPC provider
const provider = new COPCPointCloudProvider({
url: 'https://example.com/data.copc.laz',
colorMode: 'rgb',
pointSize: 2,
maximumScreenSpaceError: 16
});
// Initialize and load
await provider.initialize();
await provider.loadRootNode();
// Add to the scene (pass getPrimitive()'s return value, not the provider itself)
viewer.scene.primitives.add(provider.getPrimitive());
// Camera-based LOD/culling isn't automatic - drive it yourself every frame
viewer.scene.postRender.addEventListener(() => {
provider.update(viewer.scene.frameState);
});colorMode: 'rgb' // RGB color (default)
colorMode: 'elevation' // Elevation-based color
colorMode: 'intensity' // Intensity-based color
colorMode: 'classification' // Classification-based colormaximumMemoryUsage is the budget (in MB) for the LRU cache that holds
decoded data for nodes that have scrolled out of view. Nodes currently
visible on screen are never evicted regardless of this budget - a wide
view with many simultaneously-visible nodes can still use more memory
than this value.
workerUrl: new URL('../src/workers/laz-decoder.worker.ts', import.meta.url),
workerPoolSize: 4 // optional, default 4maximumScreenSpaceError: 32 // faster loading
maximumScreenSpaceError: 16 // balanced (default)
maximumScreenSpaceError: 4 // higher qualitypointSize: 1 // small (dense data)
pointSize: 2 // medium (default)
pointSize: 4 // large (sparse data)# If the port is already in use
npm run dev -- --port 5174
# Or kill the process and retry
lsof -ti:5173 | xargs kill -9
npm run dev# Reinstall node_modules
rm -rf node_modules package-lock.json
npm install
# Clear the build output
rm -rf dist
npm run build# Use a server that allows CORS
npx http-server . -p 8080 --corscopc-cesium/
├── src/ # Source code
│ ├── index.ts # Entry point
│ ├── types.ts # Type definitions
│ ├── COPCPointCloudProvider.ts
│ ├── core/ # COPC parsing
│ ├── render/ # GPU rendering
│ ├── network/ # HTTP Range requests
│ ├── culling/ # LOD & frustum culling
│ ├── cache/ # Memory management
│ ├── transform/ # Coordinate transforms
│ └── workers/ # Worker pool + laz-decoder.worker.ts
├── demo/ # Demo pages
│ ├── autzen.html # Autzen Stadium COPC (LOD/culling walkthrough)
│ ├── canelevation.html # CanElevation LiDAR (remote S3 streaming)
│ ├── sofi.html # SoFi Stadium LiDAR (large ~364M point file)
│ └── with-3d-tiles.html # COPC + a native Cesium3DTileset in one scene
├── examples/ # Examples
│ └── basic.html
└── dist/ # Build output (generated)
- QUICKSTART.md - Quick start
- SETUP.md - Detailed guide
- API.md - API documentation
- README.md - Project overview
- ✅ Node.js 18+
- ✅ npm 9+
- ✅ A modern browser (WebGL support)
- ✅ HTTP Range Request support
- Web Workers support is only needed if you use the
workerUrloption
-
Start the dev server
npm run dev
-
Check out the example files
- examples/basic.html
- demo/autzen.html (the main working demo)
-
Test with your own COPC file
- Place a COPC file in a
public/data/folder (served by Vite'spublicDir) - Point the
urloption at/data/your-file.copc.laz
- Place a COPC file in a
-
Read the docs
- See API.md for the full list of options
- See SETUP.md for advanced configuration
The demos work out of the box using CesiumJS's bundled default community token - no setup required. If you use your own Cesium Ion assets (World Terrain/Imagery, etc.) in production, get your own token:
- Create a free account at https://cesium.com/ion/signup
- Copy your token
- Set it on the page that uses it:
Cesium.Ion.defaultAccessToken = 'YOUR_TOKEN_HERE';
COPC files must be hosted on a server that supports HTTP Range Requests:
- ✅ AWS S3
- ✅ Google Cloud Storage
- ✅ Azure Blob Storage
- ✅ A local http-server (for development)
npm run devHappy Coding! 🎉