@gisatcz/deckgl-geolib 1.12.0-dev.5 → 2.1.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -64
- package/dist/cjs/index.js +5252 -4865
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.min.js +3 -3
- package/dist/cjs/index.min.js.map +1 -1
- package/dist/{esm/types/cogtiles/cogtiles.d.ts → cjs/types/core/CogTiles.d.ts} +17 -47
- package/dist/cjs/types/{geoimage/geoimage.d.ts → core/GeoImage.d.ts} +7 -6
- package/dist/cjs/types/core/index.d.ts +3 -0
- package/dist/cjs/types/index.d.ts +3 -11
- package/dist/{esm/types/cogbitmaplayer → cjs/types/layers}/CogBitmapLayer.d.ts +6 -5
- package/dist/cjs/types/{cogterrainlayer → layers}/CogTerrainLayer.d.ts +15 -8
- package/dist/cjs/types/layers/index.d.ts +2 -0
- package/dist/esm/index.js +5248 -4864
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +3 -3
- package/dist/esm/index.min.js.map +1 -1
- package/dist/{cjs/types/cogtiles/cogtiles.d.ts → esm/types/core/CogTiles.d.ts} +17 -47
- package/dist/esm/types/{geoimage/geoimage.d.ts → core/GeoImage.d.ts} +7 -6
- package/dist/esm/types/core/index.d.ts +3 -0
- package/dist/esm/types/index.d.ts +3 -11
- package/dist/{cjs/types/cogbitmaplayer → esm/types/layers}/CogBitmapLayer.d.ts +6 -5
- package/dist/esm/types/{cogterrainlayer → layers}/CogTerrainLayer.d.ts +15 -8
- package/dist/esm/types/layers/index.d.ts +2 -0
- package/package.json +67 -26
- package/.eslintignore +0 -2
- package/.eslintrc.cjs +0 -3
- package/CHANGELOG.md +0 -166
- package/rollup.config.mjs +0 -77
- package/src/cogbitmaplayer/CogBitmapLayer.ts +0 -337
- package/src/cogbitmaplayer/README.md +0 -113
- package/src/cogterrainlayer/CogTerrainLayer.ts +0 -445
- package/src/cogterrainlayer/README.md +0 -118
- package/src/cogtiles/README.md +0 -72
- package/src/cogtiles/cogtiles.ts +0 -483
- package/src/cogtiles/lzw.js +0 -256
- package/src/geoimage/README.md +0 -129
- package/src/geoimage/delatin/index.ts +0 -495
- package/src/geoimage/geoimage.ts +0 -602
- package/src/geoimage/helpers/skirt.ts +0 -171
- package/src/index.ts +0 -11
- package/src/utilities/tileurls.ts +0 -21
- package/tsconfig.json +0 -6
- /package/dist/cjs/types/{geoimage → core}/delatin/index.d.ts +0 -0
- /package/dist/cjs/types/{geoimage → core}/helpers/skirt.d.ts +0 -0
- /package/dist/cjs/types/{utilities → utils}/tileurls.d.ts +0 -0
- /package/dist/esm/types/{geoimage → core}/delatin/index.d.ts +0 -0
- /package/dist/esm/types/{geoimage → core}/helpers/skirt.d.ts +0 -0
- /package/dist/esm/types/{utilities → utils}/tileurls.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,121 +1,126 @@
|
|
|
1
|
-
|
|
1
|
+
# @gisatcz/deckgl-geolib
|
|
2
|
+
|
|
3
|
+
<p style="text-align: right;">
|
|
2
4
|
<a href="https://www.npmjs.com/package/@gisatcz/deckgl-geolib">
|
|
3
5
|
<img src="https://img.shields.io/npm/v/@gisatcz/deckgl-geolib.svg?style=flat-square" alt="version" />
|
|
4
6
|
</a>
|
|
5
7
|
</p>
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
**A Deck.gl extension for rendering Cloud-Optimized GeoTIFF (COG) data.**
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
currently supporting Cloud-Optimized GeoTIFF (COG) files. This library offers an efficient way to display bitmap and
|
|
11
|
-
terrain data in applications with advanced customization options using [CogBitmapLayer](../geoimage/src/cogbitmaplayer/README.md)
|
|
12
|
-
and [CogTerrainLayer](../geoimage/src/cogterrainlayer/README.md). Another developed libraries [GeoImage](../geoimage/src/geoimage/README.md)
|
|
13
|
-
and [CogTiles](../geoimage/src/cogtiles/README.md) enhance rendering options.
|
|
11
|
+
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.
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
[//]: # ()
|
|
16
14
|
|
|
17
|
-
##
|
|
15
|
+
## Features
|
|
18
16
|
|
|
19
|
-
- **COG Rendering**: Efficiently loads and displays
|
|
20
|
-
- **Bitmap and Terrain Layers**: Supports visualizing both
|
|
21
|
-
- **Customizable Rendering**: Allows custom color scales,
|
|
17
|
+
- **COG Rendering**: Efficiently loads and displays COG files directly without a backend server.
|
|
18
|
+
- **Bitmap and Terrain Layers**: Supports visualizing both raster and elevation data.
|
|
19
|
+
- **Customizable Rendering**: Allows custom color scales, multichannel support, and opacity control.
|
|
22
20
|
|
|
23
21
|
|
|
24
22
|
## Installation
|
|
25
23
|
|
|
26
|
-
To use
|
|
27
|
-
|
|
28
|
-
Install the Geolib Visualizer via npm or yarn:
|
|
24
|
+
To use this library, you need to have deck.gl and its dependencies installed.
|
|
29
25
|
|
|
30
|
-
```
|
|
26
|
+
```bash
|
|
31
27
|
npm install @gisatcz/deckgl-geolib
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
or
|
|
35
|
-
```
|
|
28
|
+
# or
|
|
36
29
|
yarn add @gisatcz/deckgl-geolib
|
|
37
30
|
```
|
|
38
31
|
|
|
39
|
-
For more information, visit the [npm package page](https://www.npmjs.com/package/@gisatcz/deckgl-geolib).
|
|
40
|
-
You can visit the package page to explore further versions and additional information.
|
|
41
|
-
|
|
42
|
-
## COG Data Preparation
|
|
43
|
-
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).
|
|
32
|
+
For more information, visit the [npm package page](https://www.npmjs.com/package/@gisatcz/deckgl-geolib).
|
|
44
33
|
|
|
34
|
+
## Documentation
|
|
45
35
|
|
|
36
|
+
* **[Layer Showcase](docs/showcase-layers.md)** – Visual examples (RGB, Heatmaps, Terrain).
|
|
37
|
+
* **[API Reference](docs/api-reference.md)** – Detailed property configuration.
|
|
46
38
|
|
|
47
39
|
## Usage
|
|
48
40
|
|
|
49
|
-
|
|
41
|
+
### 1. CogBitmapLayer
|
|
50
42
|
|
|
51
|
-
|
|
52
|
-
import geolib from '@gisatcz/deckgl-geolib'
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### 1. COG Bitmap Layer
|
|
56
|
-
|
|
57
|
-
The `CogBitmapLayer` is designed for visualizing Cloud-Optimized GeoTIFF files as raster layers.
|
|
58
|
-
The example below demonstrates its implementation, for more information and examples refer to the [CogBitmapLayer](../geoimage/src/cogbitmaplayer/README.md).
|
|
43
|
+
Used for displaying 2D rasters: Raw Observation (Satellite/Aerial), Data Structure (Multi-band/Single-band), and Analysis Output (Thematic/Categorical).
|
|
59
44
|
|
|
60
45
|
```typescript
|
|
61
|
-
|
|
46
|
+
import { CogBitmapLayer } from '@gisatcz/deckgl-geolib';
|
|
62
47
|
|
|
63
|
-
const cogLayer = new CogBitmapLayer(
|
|
48
|
+
const cogLayer = new CogBitmapLayer({
|
|
64
49
|
id: 'cog_bitmap_name',
|
|
65
50
|
rasterData: 'cog_bitmap_data_url.tif',
|
|
66
51
|
isTiled: true,
|
|
67
52
|
cogBitmapOptions: {
|
|
68
53
|
type: 'image'
|
|
69
54
|
}
|
|
70
|
-
);
|
|
55
|
+
});
|
|
71
56
|
```
|
|
72
|
-
### 2. COG Terrain Layer
|
|
73
57
|
|
|
74
|
-
|
|
75
|
-
|
|
58
|
+
### 2. CogTerrainLayer
|
|
59
|
+
|
|
60
|
+
Used for displaying 3D terrain from elevation data.
|
|
76
61
|
|
|
77
62
|
|
|
78
63
|
```typescript
|
|
79
|
-
|
|
64
|
+
import { CogTerrainLayer } from '@gisatcz/deckgl-geolib';
|
|
80
65
|
|
|
81
|
-
const cogLayer = new CogTerrainLayer(
|
|
66
|
+
const cogLayer = new CogTerrainLayer({
|
|
82
67
|
id: 'cog_terrain_name',
|
|
83
68
|
elevationData: 'cog_terrain_data_url.tif',
|
|
84
69
|
isTiled: true,
|
|
85
70
|
tileSize: 256,
|
|
86
|
-
meshMaxError: 1,
|
|
87
71
|
operation: 'terrain+draw',
|
|
88
72
|
terrainOptions: {
|
|
89
73
|
type: 'terrain',
|
|
90
74
|
}
|
|
91
|
-
);
|
|
75
|
+
});
|
|
92
76
|
```
|
|
93
77
|
|
|
94
|
-
add layer to `DeckGL` instance, visit [deck.gl](https://deck.gl/docs/get-started/using-with-react) for more about deck.gl compoments.
|
|
95
|
-
```javascript
|
|
96
|
-
<DeckGL
|
|
97
|
-
initialViewState={INITIAL_VIEW_STATE}
|
|
98
|
-
controller={true}
|
|
99
|
-
layers={cogLayer} />
|
|
100
|
-
```
|
|
101
78
|
|
|
102
|
-
##
|
|
103
|
-
|
|
79
|
+
## Data Preparation
|
|
80
|
+
|
|
81
|
+
For this library to work efficiently, your COG must be Web-Optimized and projected in Web Mercator (EPSG:3857).
|
|
82
|
+
|
|
83
|
+
Quick Checklist:
|
|
84
|
+
1. **Projection:** Web Mercator EPSG:3857
|
|
85
|
+
2. **Tiling:** 256x256 tiles
|
|
86
|
+
3. **Compression:** DEFLATE is recommended
|
|
87
|
+
|
|
88
|
+
Use the following `rio-cogeo` command to generate compatible files:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
rio cogeo create \
|
|
92
|
+
--cog-profile=deflate \
|
|
93
|
+
--blocksize=256 \
|
|
94
|
+
--overview-blocksize=256 \
|
|
95
|
+
--web-optimized \
|
|
96
|
+
--nodata=nan \
|
|
97
|
+
--forward-band-tags \
|
|
98
|
+
[input_file.tif] \
|
|
99
|
+
[output_cog_file.tif]
|
|
104
100
|
```
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
## Architecture & Development
|
|
104
|
+
|
|
105
|
+
This repository is a monorepo containing the core library and example applications.
|
|
106
|
+
|
|
107
|
+
* `geoimage/`: The core library source code.
|
|
108
|
+
* `example/`: A React application for testing the layers.
|
|
109
|
+
|
|
110
|
+
### Building Locally
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# 1. Install dependencies
|
|
105
114
|
yarn install
|
|
106
|
-
```
|
|
107
|
-
Start an example
|
|
108
115
|
|
|
109
|
-
|
|
116
|
+
# 2. Build the library
|
|
117
|
+
yarn build
|
|
118
|
+
|
|
119
|
+
# 3. Run the example app
|
|
110
120
|
yarn start
|
|
111
121
|
```
|
|
112
|
-
The example is defaultly running at http://localhost:5173/
|
|
113
122
|
|
|
114
|
-
The bitmap and terrain example files are located here [example/src/examples](../example/src/examples)
|
|
115
123
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
[//]: # ()
|
|
121
|
-
[//]: # (## License)
|
|
124
|
+
<p style="text-align: center;">
|
|
125
|
+
<sub>Maintained by <a href="https://gisat.cz">Gisat</a></sub>
|
|
126
|
+
</p>
|