Skip to content

Commit a9b5776

Browse files
dem central europe added
1 parent d879748 commit a9b5776

File tree

2 files changed

+171
-0
lines changed

2 files changed

+171
-0
lines changed

dem/dem-central-europe/index.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
title: DEM colormap for Central Europe
3+
parent: dem
4+
layout: script
5+
nav_exclude: true
6+
examples:
7+
- zoom: '7'
8+
lat: '47.2233'
9+
lng: '21.57715'
10+
datasetId: DEM
11+
fromTime: '2020-07-12T00:00:00.000Z'
12+
toTime: '2020-07-12T23:59:59.999Z'
13+
platform:
14+
- CDSE
15+
- EOB
16+
evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/dem/dem-central-europe/script.js
17+
---
18+
19+
This color ramp is defined to make interpreting topography on the Copernicus 30 DEM in Central Europe easy. Therefore, it runs between -200 and 3500 m above sea level. It uses classical colours typical for elevation maps: brown and white for high mountains and greens for lowland areas. Note that since the Copernicus 30 DEM does not include a seafloor model, the elevations below 0 m ASL are not used.
20+
21+
## Example location
22+
23+
The example is a site near Kosice, Slovakia, showing an elevation gradient between the Zemplín mountains and the Ondava river floodplain
24+
25+
```yaml
26+
examples:
27+
- zoom: '11'
28+
lat: '48.81432'
29+
lng: '21.52702'
30+
datasetId: DEM
31+
fromTime: '2020-07-12T00:00:00.000Z'
32+
toTime: '2020-07-12T23:59:59.999Z'
33+
platform:
34+
- CDSE
35+
- EOB
36+
evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/dem/dem-central-europe/script.js
37+
```
38+
39+
40+
## General description of the script
41+
42+
43+
44+
## Color Table
45+
46+
<table>
47+
<tr>
48+
<th>Value</th>
49+
<th>Color Code</th>
50+
<th>Color Patch</th>
51+
</tr>
52+
<tr>
53+
<td>3500</td>
54+
<td>#f7eafd</td>
55+
<td style="background-color: #f7eafd;"></td>
56+
</tr>
57+
<tr>
58+
<td>3000</td>
59+
<td>#ebebeb</td>
60+
<td style="background-color: #ebebeb;"></td>
61+
</tr>
62+
<tr>
63+
<td>1000</td>
64+
<td>#a76b18</td>
65+
<td style="background-color: #a76b18;"></td>
66+
</tr>
67+
<tr>
68+
<td>500</td>
69+
<td>#dca620</td>
70+
<td style="background-color: #dca620;"></td>
71+
</tr>
72+
<tr>
73+
<td>200</td>
74+
<td>#A2AE32</td>
75+
<td style="background-color: #A2AE32;"></td>
76+
</tr>
77+
<tr>
78+
<td>100</td>
79+
<td>#18a722</td>
80+
<td style="background-color: #18a722;"></td>
81+
</tr>
82+
<tr>
83+
<td>50</td>
84+
<td>#018643</td>
85+
<td style="background-color: #018643;"></td>
86+
</tr>
87+
<tr>
88+
<td>30</td>
89+
<td>#015965</td>
90+
<td style="background-color: #015965;"></td>
91+
</tr>
92+
<tr>
93+
<td>10</td>
94+
<td>#01471c</td>
95+
<td style="background-color: #01471c;"></td>
96+
</tr>
97+
<tr>
98+
<td>0</td>
99+
<td>#bbbcbc</td>
100+
<td style="background-color: #bbbcbc;"></td>
101+
</tr>
102+
<tr>
103+
<td>-10</td>
104+
<td>#2754de</td>
105+
<td style="background-color: #2754de;"></td>
106+
</tr>
107+
<tr>
108+
<td>-20</td>
109+
<td>#0d027e</td>
110+
<td style="background-color: #0d027e;"></td>
111+
</tr>
112+
<tr>
113+
<td>-50</td>
114+
<td>#08014c</td>
115+
<td style="background-color: #08014c;"></td>
116+
</tr>
117+
<tr>
118+
<td>-200</td>
119+
<td>#4a4a4a</td>
120+
<td style="background-color: #4a4a4a;"></td>
121+
</tr>
122+
</table>
123+

dem/dem-central-europe/script.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
//VERSION=3
2+
// To set custom max and min values, set
3+
// choose your max and min values.
4+
// The color map will then be scaled
5+
// to those max and min values
6+
const max = 3500;
7+
const min = -200;
8+
9+
function setup() {
10+
return {
11+
input: ["DEM", "dataMask"],
12+
output: [
13+
{ id: "default", bands: 4, sampleType: "AUTO" },
14+
{ id: "index", bands: 1, sampleType: "FLOAT32" },
15+
{ id: "dataMask", bands: 1 },
16+
],
17+
};
18+
}
19+
20+
const map = [
21+
[3500, 0xf7eafd],
22+
[3000, 0xebebeb],
23+
[1000, 0xa76b18],
24+
[500, 0xdca620],
25+
[200, 0xA2AE32],
26+
[100, 0x18a722],
27+
[50, 0x018643],
28+
[30, 0x15965],
29+
[10, 0x01471c],
30+
[0, 0xbbbcbc],
31+
[-10, 0x2754de],
32+
[-20, 0x0d027e],
33+
[-50, 0x08014c],
34+
[-200, 0x4a4a4a],
35+
];
36+
37+
const visualizer = new ColorRampVisualizer(map, min, max);
38+
39+
function evaluatePixel(samples) {
40+
const imgVals = visualizer.process(samples.DEM)
41+
42+
// Return the 4 inputs and define content for each one
43+
return {
44+
default: [...imgVals, samples.dataMask],
45+
index: [samples.DEM],
46+
dataMask: [samples.dataMask],
47+
}
48+
}

0 commit comments

Comments
 (0)