The cloud point path
Let the hierarchy choose the ranges.
COPC puts an octree directory beside the point data. A viewport or bounded query can use that directory first, then fetch only the compressed nodes that can contribute results.
bounded request
application result
Arrow point batchespositions · color · attributes ↗The same source can serve progressive viewport tiles or a bounded scan without changing the underlying point representation.
What this loader does
Discover, select, fetch, emit.
The source keeps hierarchy and point decoding separate, so viewport traversal or a scan query can stop before unrelated nodes are fetched.
Discover
Bounds, CRS, schema, hierarchy, and point count
Select
Nodes by bounds, level, spacing, or query
Fetch
COPC hierarchy and LAZ payload ranges
Emit
Point tiles or progressive Arrow point batches
COPCLoader creates a point-cloud tile source for Cloud Optimized Point Cloud (.copc.laz) datasets.
Detailed guide
Source construction and loading
The sections below document source creation, tile methods, column selection, batching, cancellation, and range scheduling.
| Property | Value |
|---|---|
| Data source | COPCTileSource |
Usage
import {createDataSourceSync} from '@loaders.gl/core';
import {COPCLoader} from '@loaders.gl/tiles-3d/copc';
import {PointCloudTileset} from '@loaders.gl/tiles-3d/point-cloud';
const dataSource = createDataSourceSync(url, [COPCLoader], {
copc: {}
});
const tileset = new PointCloudTileset(dataSource);
await tileset.selectTiles(viewport);
Data Source
The created data source exposes the point-cloud tile methods used by PointCloudTileset:
getMetadata()returns COPC metadata, inferred bounds, and an initial view state.getRootTile()returns the root octree tile header.getChildren(tile)returns available child tile headers.loadTileContent(tile, options)returns normalized point positions, optional colors, point count, and cartographic origin.options.signalcancels queued work, the active range request, or worker decode.loadTileContentInBatches(tile, options)yields normalized Arrow point tables progressively as the selected node range is fetched.options.batchSizecontrols the maximum points per table,options.columnsselects the attributes listed below, andoptions.signalcancels the request/decode.loadHierarchyInBatches(options)yields hierarchy pages and their discovered nodes as they are fetched.close()invalidates cached and physical reads, cancels pending range and atomic node work, and closes the underlying file once. Subsequent node loads reject, including Blob-backed sources.
The source uses the native TypeScript COPC and LAZ readers for PDRF 6-8. Atomic loadTileContent calls created through @loaders.gl/core use the package's single prebuilt TypeScript LAS worker pool when workers are enabled; direct source construction and unavailable workers fall back to main-thread decoding. copc.decodeConcurrency bounds each source's combined node fetch and decode work to control peak compressed and decoded memory.
loadTileContentInBatches remains on the calling thread because its async iterator is the streaming boundary. It splits the node range into requests and emits rows as soon as the requested independent layers arrive. PDRF 7 RGB waits for Point14 and RGB; PDRF 8 RGB/NIR waits for the layers requested through options.columns. options.rangeChunkSize controls request size, while options.rangeConcurrency can fetch later ranges ahead of in-order decoding.
Options
For shared loading controls and parser configuration, see Source options. The settings below are specific to this source.
| Option | Type | Default | Description |
|---|---|---|---|
copc.sourceCoordinateSystem | string | Auto-detected from COPC WKT | Coordinate system definition used when the source metadata does not include WKT. |
copc.rangeChunkSize | number | 65536 | Default byte size for TypeScript COPC node range requests. |
copc.rangeConcurrency | number | 1 | Maximum number of node ranges fetched ahead of decoding. Results are still decoded and yielded in range order. |
copc.decodeConcurrency | number | core.maxConcurrency or 3 | Maximum number of complete atomic node fetches and worker decodes active for one source. |
Progressive Columns
POSITION is always present. PDRF 7/8 color remains enabled by default; all other attributes are opt-in through options.columns.
| Column request | Arrow output |
|---|---|
COLOR_0, NIR | 16-bit RGB and PDRF 8 near-infrared channels. |
intensity, classification, GPS_TIME, scanAngle, userData, pointSourceId | Standard LAS 1.4 scalar fields. |
synthetic, keyPoint, withheld, overlap | LAS 1.4 classification flags as 0/1 byte columns. |
returnNumber, numberOfReturns, scannerChannel | Pulse-return and scanner metadata. |
scanDirectionFlag, edgeOfFlightLine | Flight-line flags as 0/1 byte columns. |
EXTRA_BYTES | One named typed EXTRA_BYTES_* Arrow attribute per VLR descriptor, including vector size and scale/offset transforms. |
Low-Level Range APIs
The package exports the native parsing primitives used by COPCLoader:
| API | Description |
|---|---|
openCOPC(readRange) | Reads and validates the LAS 1.4 header, VLR/EVLR descriptors, COPC info VLR, WKT, and Extra Bytes metadata. |
loadCOPCHierarchyPage(readRange, page) | Fetches and parses one hierarchy page. |
loadCOPCNodeData(readRange, node) | Fetches one exact compressed node range. |
parseCOPCHeader(bytes) | Parses and validates a 375-byte COPC LAS header. |
parseCOPCInfo(bytes) | Parses a 160-byte COPC info payload. |
parseCOPCHierarchy(bytes) | Parses native 32-byte hierarchy entries. |
readRange(begin, end, signal) returns exactly the requested half-open range as a Uint8Array. Offsets and lengths must remain within JavaScript's safe integer range.
