npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sitn/gg-lidar-viewer

v0.4.2

Published

GeoGirafe plugin to browse LiDAR tile indexes (GeoJSON or STAC) and view COPC point clouds in 3D with Giro3D

Readme

@sitn/gg-lidar-viewer

A GeoGirafe panel to browse LiDAR tile indexes (a GeoJSON file or a STAC catalog) on the 2D map and view the selected COPC point clouds in a 3D split view powered by Giro3D.

Installation steps

  1. Create your project based on GeoGirafe. To create a new GeoGirafe project, follow the instruction on https://gitlab.com/geogirafe/gg-viewer

  2. Install this plugin using npm i @sitn/gg-lidar-viewer

  3. In index.html add <lidar-viewer slot="main"></lidar-viewer> in the tag <girafe-lr-panel class="panel-right" dock="right">

  4. Add a button to open the panel, with the following code in the buttonbar-grid

<button
  tip="lidar-viewer-panel"
  slot="menu-content"
  class="gg-icon-button gg-big"
  onclick="
    document.geogirafe.state.interface.lidarViewerVisible =
      !document.geogirafe.state.interface.lidarViewerVisible
  ">
  <svg viewBox="0 0 24 24" width="22" height="22" fill="currentColor" aria-hidden="true">
    <circle cx="3"  cy="9"  r="1.8"/>
    <circle cx="8"  cy="4"  r="1.8"/>
    <circle cx="14" cy="2"  r="1.8"/>
    <circle cx="20" cy="5"  r="1.8"/>
    <circle cx="21" cy="12" r="1.8"/>
    <circle cx="5"  cy="15" r="1.8"/>
    <circle cx="12" cy="13" r="1.8"/>
    <circle cx="18" cy="18" r="1.8"/>
    <circle cx="9"  cy="20" r="1.8"/>
    <circle cx="2"  cy="21" r="1.8"/>
  </svg>
</button>
  1. In main.ts, import and register the plugin :
  • Add import LidarViewerComponent from '@sitn/gg-lidar-viewer' in the list of imports
  • Add iface['lidarViewerVisible'] = false; to the block that seeds custom panel toggle paths in the state before defining the elements
  • Add customElements.define('lidar-viewer', LidarViewerComponent); in the girafeApp.isReady() promise

STAC catalogs

With STAC API as source, Load tiles loads the tile footprints of the catalog when it has some: the GeoJSON assets with role index of its collections (/collections), one Feature per item with its file URL (file_url) and item URL (item_url), as published by stac-lidar-aggregator, one per source collection. All of them are loaded at once:

  • footprints of collections whose item_assets declare a point cloud (or no item_assets) are the COPC tiles of the map;
  • footprints of collections whose item_assets declare a GeoTIFF list raster models (COG), which Raster models adds to the 2D map, under the tiles (raw elevations, lidar:render = raw, stretched from 200 to 2500 m).

A catalog without footprints is searched instead (/search), in the visible area only: move the map and load again for other areas.

The Collections list holds the collections that directly contain the tiles, grouped by the collection holding their footprints (e.g. a provider): one per footprint file, or the last of the items' properties.collection hierarchy (else their collection) for searches. They are unchecked at first: check one, or all for a group, to show its tiles on the map. Year keeps the tiles of one acquisition year (datetime).

Panel

  • Source (collapsed at first) chooses the tile index: a GeoJSON URL or a STAC catalog.
  • Click a tile on the map to select it and show it in 3D, shift-click to add or remove one; check tiles in the list to show them in 3D. Each tile has links to its STAC page (in STAC Browser when browserUrl is set), its file and a copy of its URL. A warning appears above maxVisibleTiles tiles shown at once.
  • Copy link copies a link opening the tiles shown in 3D from the same point of view; the page's URL follows them (?stac_items=<item URL>,<item URL>&lidar_camera=<x,y,z of the camera and of its target>). A link with stac_items alone opens these STAC items in 3D, e.g. from stac-lidar-aggregator's "Voir en 3D" links.
  • Classes shown drops the points of the unchecked ASPRS classes (ground, vegetation, buildings…) when loading them.
  • Measures: coordinates of a point, distance, height, and a cross-section profile of the loaded points within 1 m of a line.
  • View: fit the camera, follow the 2D map, and an orthophoto (SWISSIMAGE) laid flat under the points. The 3D view has a north arrow and its width can be dragged.
  • The panel is in French, German, Italian and English, following GeoGirafe's language.

Configuration

Optional, in the extendedConfig section of your project's config.json:

"extendedConfig": {
  "lidarViewer": {
    "stacUrl": "https://example.com/stac/",
    "browserUrl": "https://example.com/browser/",
    "lazPerfPath": "laz-perf",
    "maxVisibleTiles": 10,
    "orthophoto": { "capabilities": "https://wmts.geo.admin.ch/EPSG/2056/1.0.0/WMTSCapabilities.xml", "layer": "ch.swisstopo.swissimage" }
  }
}
  • stacUrl: default STAC catalog: the panel opens on STAC API and loads it the first time it opens.
  • browserUrl: the STAC Browser of that catalog, for the tiles' STAC pages (item URLs starting with stacUrl).
  • lazPerfPath: directory serving laz-perf.wasm (copy node_modules/laz-perf/lib/laz-perf.wasm into your public/), relative to the page; by default it is loaded from a CDN.
  • maxVisibleTiles (default 10) and orthophoto (WMTS capabilities and layer, default SWISSIMAGE).

The 3D view is in Swiss LV95 (EPSG:2056), the coordinate system of the COPC files it is made for.