gisat-panther / deck.gl-geotiff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

3DFLUS - Geolib Visualizer

The Geolib Visualizer is a library that extends the functionality of the deck.gl library to visualize geospatial data. Currently, it supports Cloud-Optimized GeoTIFF (COG). It provides an easy and efficient way to render both bitmap and terrain representations of COG datasets using CogBitmapLayer and CogTerrainLayer, and GeoImage and CogTiles libraries

Additionally, we provide a guide for COG data preparation which currently includes step-by-step instructions on converting GeoTIFFs into COG files. This resource enables seamless integration with Geolib Visualizer.

Installation

To use the Geolib Visualizer library, you need to have deck.gl and its dependencies installed.

Install the Geolib Visualizer via npm or yarn:

npm install @gisatcz/deckgl-geolib

or

yarn add @gisatcz/deckgl-geolib

The npm package can be found here. You can visit the package page to explore further versions and additional information.

Usage

Import package into project

import geolib from '@gisatcz/deckgl-geolib'

Create bitmap layer

const CogBitmapLayer = geolib.CogBitmapLayer;

const cogLayer = new CogBitmapLayer(
    'CogBitmapLayer',
    'cog_data_url.tif',
    {
        type: 'image', 
        useChannel: 0, 
        useHeatMap: true, 
        colorScale: ['#fde725', '#5dc962', '#20908d', '#3a528b', '#440154'], 
        colorScaleValueRange: [1, 100, 200, 300, 366],
    },
);

or create terrain layer

const CogTerrainLayer = geolib.CogTerrainLayer;

const cogLayer = new CogTerrainLayer(
    'CogTerrainLayer',
    'cog_data_url.tif',
    { type: 'terrain'},
);

add layer to DeckGL instance, visit deck.gl for more about deck.gl compoments.

<DeckGL
    initialViewState={INITIAL_VIEW_STATE}
    controller={true}
    layers={cogLayer} />

Development

Clone the repository and install dependencies

yarn install

Start an example

yarn start

The example is defaultly running at http://localhost:3000/

The bitmap and terrain example files are located here example/src/examples

About


Languages

Language:TypeScript 82.1%Language:JavaScript 14.6%Language:HTML 2.9%Language:CSS 0.4%