The Problem
Standard web maps handle 2D vector and raster tiles well, but large LiDAR point clouds (millions to billions of points) are impractical to load as a single file. Existing solutions require custom servers or heavy desktop software. This plugin solves that by bringing viewport-based streaming of COPC and EPT point clouds directly into a MapLibre GL JS map, using deck.gl for GPU rendering.
What This Does
maplibre-gl-lidar is a MapLibre GL JS plugin that renders LiDAR point clouds as an interactive layer. The core logic lives in src/lib/: loaders/ handles streaming from COPC and EPT sources, layers/PointCloudManager.ts manages the deck.gl point cloud layer with chunking, and core/LidarControl.ts provides the map control with a GUI panel (gui/) for color scheme, point size, elevation filter, and classification toggles.
The repo includes three usage modes: a vanilla TypeScript API (src/index.ts), a React integration with hooks (src/react.ts, src/lib/hooks/), and a standalone online viewer (viewer/main.ts) that loads any COPC URL via a query parameter.
How To Use It
Setup – Install via npm:
npm install maplibre-gl-lidar
Configuration – No environment variables or API keys required. Point clouds are loaded directly from public URLs (e.g., S3-hosted COPC files) or EPT server endpoints.
Running it – Add the control to a MapLibre map after load:
const lidarControl = new LidarControl({ colorScheme: "elevation", pointSize: 2 }); map.addControl(lidarControl, "top-right"); lidarControl.loadPointCloud("https://s3.amazonaws.com/hobu-lidar/autzen-classified.copc.laz");
For local development, run npm install then npm run dev (Vite config is present). The examples/basic/ and examples/ept/ folders show minimal working setups. A Dockerfile is included for containerized builds.
Real-World Use
A typical scenario: an environmental consulting firm hosts classified LiDAR (ground, vegetation, buildings) as COPC on S3. A field team opens a web map, loads the point cloud by URL, toggles off the "ground" classification via the legend, and applies an elevation filter to inspect surface features. The viewer/ page supports shareable links:
https://opengeos.org/maplibre-gl-lidar/viewer/?url=https://s3.amazonaws.com/hobu-lidar/autzen-classified.copc.laz
Code Health & Issues
Med – Untested streaming logic: The loaders (CopcStreamingLoader.ts, EptStreamingLoader.ts) handle network requests and chunk merging, but only tests/helpers.test.ts exists. No tests cover loader behavior, error handling, or viewport culling. Med – WASM binary duplication: laz-perf.wasm and lazrswasm_bg.wasm appear in both public/ and public/libs/. This is a maintenance and bundle-size concern. Low – Single-maintainer risk: Forked from opengeos/maplibre-gl-lidar with 0 stars on this fork. CI is configured (GitHub Actions for publish and Docker), but bus-factor risk is real. Low – No input validation on URLs: The viewer and loadPointCloud accept arbitrary URLs with no obvious validation or size limits, which could be abused if exposed publicly. Clean signals: MIT license, dependabot config, pre-commit hooks, TypeScript throughout, and a structured src/lib/ separation of concerns are all present.
The Bottom Line
This is a well-architected plugin that solves a genuinely hard problem—streaming massive point clouds in a browser map—with a clean API and good documentation. It's production-usable for demos and internal tools, but the thin test coverage and single-maintainer status make it a moderate risk for mission-critical deployments. Best suited for teams that need LiDAR visualization on the web and are comfortable forking or contributing fixes.