Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package documentation #61

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="right">
<a href="https://npmjs.org/package/deck.gl">
<a href="https://www.npmjs.com/package/@gisatcz/deckgl-geolib">
<img src="https://img.shields.io/npm/v/@gisatcz/deckgl-geolib.svg?style=flat-square" alt="version" />
</a>
</p>
Expand Down
121 changes: 121 additions & 0 deletions geoimage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<p align="right">
<a href="https://www.npmjs.com/package/@gisatcz/deckgl-geolib">
<img src="https://img.shields.io/npm/v/@gisatcz/deckgl-geolib.svg?style=flat-square" alt="version" />
</a>
</p>

# 3DFLUS - Geolib Visualizer

The Geolib Visualizer is a library that extends the `deck.gl` framework to enable the visualization of geospatial data,
currently supporting Cloud-Optimized GeoTIFF (COG) files. This library offers an efficient way to display bitmap and
terrain data in applications with advanced customization options using [CogBitmapLayer](../geoimage/src/cogbitmaplayer/README.md)
and [CogTerrainLayer](../geoimage/src/cogterrainlayer/README.md). Another developed libraries [GeoImage](../geoimage/src/geoimage/README.md)
and [CogTiles](../geoimage/src/cogtiles/README.md) enhance rendering options.

<img src = "/images/ManillaCogHeatmap.png" width = "100%">

## Key Features

- **COG Rendering**: Efficiently loads and displays Cloud-Optimized GeoTIFF files.
- **Bitmap and Terrain Layers**: Supports visualizing both bitmap and elevation data.
- **Customizable Rendering**: Allows custom color scales, opacity control, and flexible geographic bounds.


## 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
```

For more information, visit the [npm package page](https://www.npmjs.com/package/@gisatcz/deckgl-geolib).
You can visit the package page to explore further versions and additional information.

## COG Data Preparation
For seamless integration of Geolib Visualizer library, please make sure you have followed our workflow [Data Preparation Guide for converting GeoTIFFs to COG files](../dataPreparation.md).



## Usage

Import package into project:

```typescript
import geolib from '@gisatcz/deckgl-geolib'
```

### 1. COG Bitmap Layer

The `CogBitmapLayer` is designed for visualizing Cloud-Optimized GeoTIFF files as raster layers.
The example below demonstrates its implementation, for more information and examples refer to the [CogBitmapLayer](../geoimage/src/cogbitmaplayer/README.md).

```typescript
const CogBitmapLayer = geolib.CogBitmapLayer;

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

For 3D terrain rendering, use `CogTerrainLayer` to visualize elevation data stored
in Cloud-Optimized GeoTIFF format, for more information and examples refer to the [CogTerrainLayer](../geoimage/src/cogterrainlayer/README.md).


```typescript
const CogTerrainLayer = geolib.CogTerrainLayer;

const cogLayer = new CogTerrainLayer(
id: 'cog_terrain_name',
elevationData: 'cog_terrain_data_url.tif',
isTiled: true,
tileSize: 256,
meshMaxError: 1,
operation: 'terrain+draw',
terrainOptions: {
type: 'terrain',
}
);
```

add layer to `DeckGL` instance, visit [deck.gl](https://deck.gl/docs/get-started/using-with-react) for more about deck.gl compoments.
```javascript
<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:5173/

The bitmap and terrain example files are located here [example/src/examples](../example/src/examples)

[//]: # (## Contributions)

[//]: # (Contributions and feedback are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.)

[//]: # ()
[//]: # (## License)
Loading