voxelkloudBack to the project

DOCS / PACKAGE GUIDE

@voxelkloud/loader
URL-driven loading and driver selection

The loader resolves a URL, chooses the matching format driver, and hands back source, tree, and reader factory objects.

npm install @voxelkloud/loaderpublic

High-level load

Use the loader when you want one call that resolves the driver and returns the full point-cloud contract the renderer expects.

import { ensureDefaultFormats, formats, loadPointCloud } from '@voxelkloud/loader'
import { copcFormat } from '@voxelkloud/format-copc'

ensureDefaultFormats()
formats.register(copcFormat)

const { source, tree, openPoints } = await loadPointCloud('/pointclouds/autzen/')

Why registration exists

Potree, COPC, EPT, and single-file LAS all claim the same kinds of URLs in different ways, so the registry decides which driver gets first look.

  • Default formats keep the common cases available with one import.
  • Optional drivers can be registered only by the apps that need them.
  • The loader stays format-agnostic after the registry resolves the match.