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

@gisatcz/deckgl-geolib

v2.7.0

Published

Deck.gl extension for rendering Cloud-Optimized GeoTIFF (COG) data

Readme

@gisatcz/deckgl-geolib

A Deck.gl extension for rendering Cloud-Optimized GeoTIFF (COG) data.

This library allows you to efficiently visualize high-resolution bitmap and terrain data directly from COG sources. It includes the CogBitmapLayer for 2D imagery and thematic layers and the CogTerrainLayer for 3D terrain meshes.

Features

  • COG Rendering: Efficiently loads and displays COG files directly without a backend server.
  • Bitmap and Terrain Layers: Supports visualizing both raster and elevation data.
  • Customizable Rendering: Custom color scales, multichannel support, heatmaps, categorical classification, and opacity control.
  • Terrain Texturing: Drape a styled visualization (elevation heatmap, external imagery) directly onto the 3D terrain mesh — no separate layer needed.
  • Kernel Analysis: Compute slope and hillshade directly from elevation data using 3×3 neighborhood kernels (Horn's method / ESRI algorithm).
  • Swiss Relief Shading: Apply hypsometric color blending with hillshade and slope for superior terrain perception. Supports both terrain baking and transparent glaze overlays on satellite imagery.
  • Raw Value Picking: Access original raster values (elevation, band values, slope, hillshade) at hover/click locations with no extra network requests.

Installation

To use this library, you need to have deck.gl and its dependencies installed.

npm install @gisatcz/deckgl-geolib
# or
yarn add @gisatcz/deckgl-geolib

For more information, visit the npm package page.

Documentation

Usage

1. CogBitmapLayer

Used for displaying 2D rasters: Raw Observation (Satellite/Aerial), Data Structure (Multi-band/Single-band), and Analysis Output (Thematic/Categorical).

import { CogBitmapLayer } from '@gisatcz/deckgl-geolib';

const cogLayer = new CogBitmapLayer({
  id: 'cog_bitmap_name',
  rasterData:  'cog_bitmap_data_url.tif',
  isTiled: true,
  cogBitmapOptions: {
    type: 'image'
  }
});

2. CogTerrainLayer

Used for displaying 3D terrain from elevation data. Supports draping a styled texture derived from the elevation itself.

import { CogTerrainLayer } from '@gisatcz/deckgl-geolib';

const cogLayer = new CogTerrainLayer({
  id: 'cog_terrain_name',
  elevationData: 'cog_terrain_data_url.tif',
  isTiled: true,
  tileSize: 256,
  operation: 'terrain+draw',
  terrainOptions: {
    type: 'terrain',
    useHeatMap: true,
    useChannel: 1,
    colorScale: ['#440154', '#20908d', '#fde725'],
    colorScaleValueRange: [0, 3000],
  }
});

3. Kernel Analysis (Slope & Hillshade)

Compute slope or hillshade directly from elevation data and drape it as a texture on the terrain mesh.

import { CogTerrainLayer } from '@gisatcz/deckgl-geolib';

const slopeLayer = new CogTerrainLayer({
  id: 'cog_slope',
  elevationData: 'cog_terrain_data_url.tif',
  isTiled: true,
  tileSize: 256,
  operation: 'terrain+draw',
  terrainOptions: {
    type: 'terrain',
    useChannel: 1,
    useSlope: true,           // or useHillshade: true
    useHeatMap: true,
    colorScale: [[255, 255, 255], [235, 200, 150], [200, 80, 50], [100, 40, 30]],
    colorScaleValueRange: [0, 90], // degrees
  },
});

Data Preparation

For this library to work efficiently, your COG must be Web-Optimized and projected in Web Mercator (EPSG:3857).

Quick Checklist:

  1. Projection: Web Mercator EPSG:3857
  2. Tiling: 256x256 tiles
  3. Compression: DEFLATE is recommended

Use the following rio-cogeo command to generate compatible files:

rio cogeo create \
  --cog-profile=deflate \
  --blocksize=256 \
  --overview-blocksize=256 \
  --web-optimized \
  --nodata=nan \
  --forward-band-tags \
  [input_file.tif] \
  [output_cog_file.tif]

Architecture & Development

This repository is a monorepo containing the core library and example applications.

  • geoimage/: The core library source code.
  • example/: A React application for testing the layers.

Building Locally

# 1. Install dependencies
yarn install

# 2. Build the library
yarn build

# 3. Run the example app
yarn start