Skip to content

Commit c22a3c2

Browse files
Merge branch 'main' into andras-experimenting
2 parents 4c2bb52 + 22f4f19 commit c22a3c2

File tree

184 files changed

+3316
-1324
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+3316
-1324
lines changed

.github/workflows/page.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,24 @@ jobs:
3030
runs-on: ubuntu-latest
3131
steps:
3232
- name: Checkout
33-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
3434
- name: Setup Ruby
35-
uses: ruby/setup-ruby@v1
35+
uses: ruby/setup-ruby@v1.191.0
3636
with:
37-
ruby-version: '3.1' # Not needed with a .ruby-version file
37+
ruby-version: '3.2.1' # Not needed with a .ruby-version file
3838
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
39-
cache-version: 0 # Increment this number if you need to re-download cached gems
39+
cache-version: 1 # Increment this number if you need to re-download cached gems
4040
- name: Setup Pages
4141
id: pages
42-
uses: actions/configure-pages@v2
42+
uses: actions/configure-pages@v5
4343
- name: Build with Jekyll
4444
# Outputs to the './_site' directory by default
4545
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
4646
env:
4747
JEKYLL_ENV: production
4848
- name: Upload artifact
4949
# Automatically uploads an artifact from the './_site' directory by default
50-
uses: actions/upload-pages-artifact@v1
50+
uses: actions/upload-pages-artifact@v3
5151

5252
# Deployment job
5353
deploy:
@@ -59,4 +59,4 @@ jobs:
5959
steps:
6060
- name: Deploy to GitHub Pages
6161
id: deployment
62-
uses: actions/deploy-pages@v1
62+
uses: actions/deploy-pages@v4

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
_site
22
Gemfile.lock
3-
.DS_Store
3+
.DS_Store
4+
5+
example-0.jpg

Gemfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
source 'https://rubygems.org'
2-
gem "github-pages", "231", group: :jekyll_plugins
3-
gem "just-the-docs", "0.8.2"
2+
3+
gem "github-pages", "232", group: :jekyll_plugins
4+
gem "just-the-docs", "0.9.0"
45
gem "webrick"
56
gem "rake"
6-
gem "jekyll", "3.9.5"
7+
gem "jekyll", "3.10"
78
gem "html-proofer", git: "https://github.com/jonasViehweger/html-proofer"

_layouts/script.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
S5_SO2: S5_SO2_CDAS
1717
S1_AWS_EW_HHHV: S1_CDAS_EW_HHHV
1818
S1_MOSAIC: 3c662330-108b-4378-8899-525fd5a225cb
19+
DEM_MAPZEN: DEM_COPERNICUS_30_CDAS
20+
1921
---
2022

2123
<h1 class="d-inline" id={{page.slug}}> {{page.title}} </h1>
@@ -55,7 +57,7 @@ <h1 class="d-inline" id={{page.slug}}> {{page.title}} </h1>
5557
</div>
5658

5759
{% if page.examples %}
58-
<h2 class="d-inline"> Evaluate and Visualize </h2>
60+
<h2 id="evaluate-and-visualize"> <a href="#evaluate-and-visualize" class="anchor-heading" aria-labelledby="evaluate-and-visualize"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Evaluate and Visualize </h2>
5961
{% for example in page.examples %}
6062
{% if example.name %}
6163
<h3 class="d-inline"> {{example.name}} </h2>

analysis_ready_planetscope/ndvi/raw.js

-15
This file was deleted.

analysis_ready_planetscope/true_color/README.md

-19
This file was deleted.

dem/dem-color/README.md

+16-6
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,24 @@ parent: DEM
44
layout: script
55
permalink: /dem/dem-color/
66
nav_exclude: true
7+
scripts:
8+
- - Visualization
9+
- script.js
10+
- - EO Browser
11+
- eob.js
12+
examples:
13+
- zoom: '10'
14+
lat: '42.40876'
15+
lng: '12.00634'
16+
datasetId: DEM_MAPZEN
17+
fromTime: '2023-10-02T00:00:00.000Z'
18+
toTime: '2023-10-02T23:59:59.999Z'
19+
platform:
20+
- CDSE
21+
- EOB
22+
evalscripturl: https://custom-scripts.sentinel-hub.com/dem/dem-color/eob.js
723
---
824

9-
10-
## Evaluate and visualize
11-
12-
- [EO Browser](https://sentinelshare.page.link/HNQV)
13-
- [Copernicus Browser](https://sentinelshare.page.link/h2as)
14-
1525
## Description
1626

1727
This script returns a color visualization of a digital elevation model, assigning continuous colors to the elevation borders.

dem/dem-color/eob.js

+4-14
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
//VERSION=3
22
// To set custom max and min values, set
3-
// defaultVis to false and choose your max and
4-
// min values. The color map will then be scaled
3+
// choose your max and min values.
4+
// The color map will then be scaled
55
// to those max and min values
6-
const defaultVis = true
76
const max = 9000
8-
const min = -9000
7+
const min = -12000
98

109
function setup() {
1110
return {
@@ -18,14 +17,6 @@ function setup() {
1817
};
1918
}
2019

21-
function updateMap(max, min) {
22-
const numIntervals = map.length
23-
const intervalLength = (max - min) / (numIntervals - 1);
24-
for (let i = 0; i < numIntervals; i++) {
25-
map[i][0] = max - intervalLength * i
26-
}
27-
}
28-
2920
const map = [
3021
[9000, 0xffffff],
3122
[7000, 0xdcefff],
@@ -51,8 +42,7 @@ const map = [
5142
[-12000, 0x000028],
5243
];
5344

54-
if (!defaultVis) updateMap(max, min);
55-
const visualizer = new ColorRampVisualizer(map);
45+
const visualizer = new ColorRampVisualizer(map, min, max);
5646

5747
function evaluatePixel(sample) {
5848
let val = sample.DEM;

dem/dem-color/script.js

+4-14
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
//VERSION=3
22
// To set custom max and min values, set
3-
// defaultVis to false and choose your max and
4-
// min values. The color map will then be scaled
3+
// choose your max and min values.
4+
// The color map will then be scaled
55
// to those max and min values
6-
const defaultVis = true
76
const max = 9000
8-
const min = -9000
7+
const min = -12000
98

109
function setup() {
1110
return {
@@ -14,14 +13,6 @@ function setup() {
1413
};
1514
}
1615

17-
function updateMap(max, min) {
18-
const numIntervals = map.length
19-
const intervalLength = (max - min) / (numIntervals - 1);
20-
for (let i = 0; i < numIntervals; i++) {
21-
map[i][0] = max - intervalLength * i
22-
}
23-
}
24-
2516
const map = [
2617
[9000, 0xffffff],
2718
[7000, 0xdcefff],
@@ -47,8 +38,7 @@ const map = [
4738
[-12000, 0x000028],
4839
];
4940

50-
if (!defaultVis) updateMap(max, min);
51-
const visualizer = new ColorRampVisualizer(map);
41+
const visualizer = new ColorRampVisualizer(map, min, max);
5242

5343
function evaluatePixel(sample) {
5444
let val = sample.DEM;

dem/dem-difference/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ parent: DEM
44
layout: script
55
permalink: /dem/dem-difference/
66
nav_exclude: true
7+
examples:
8+
- zoom: '12'
9+
lat: '42.40876'
10+
lng: '12.00634'
11+
datasetId: DEM_MAPZEN
12+
fromTime: '2023-10-02T00:00:00.000Z'
13+
toTime: '2023-10-02T23:59:59.999Z'
14+
platform:
15+
- CDSE
16+
- EOB
17+
evalscripturl: https://custom-scripts.sentinel-hub.com/dem/dem-difference/script.js
718
---
819

920

dem/dem-difference/script.js

+22-24
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
// Mapzen and Copernicus DEM difference Visualization
22
//VERSON = 3
33
function setup() {
4-
return {
5-
input: [
6-
{datasource: "map", bands:["DEM"]},
7-
{datasource: "cop", bands:["DEM"]}
8-
],
9-
output: [
10-
{id: "default", bands: 3, sampleType: "UINT8"}
11-
]
12-
};
13-
}
14-
15-
function evaluatePixel(samples) {
16-
var map = samples.map[0];
17-
var cop = samples.cop[0];
18-
let d_dem = map.DEM - cop.DEM;
19-
const ramps = [
4+
return {
5+
input: [
6+
{ datasource: "map", bands: ["DEM"] },
7+
{ datasource: "cop", bands: ["DEM"] },
8+
],
9+
output: [{ id: "default", bands: 3, sampleType: "UINT8" }],
10+
};
11+
}
12+
13+
function evaluatePixel(samples) {
14+
var map = samples.map[0];
15+
var cop = samples.cop[0];
16+
let d_dem = map.DEM - cop.DEM;
17+
const ramps = [
2018
[-300, [202, 0, 32]],
2119
[-100, [244, 128, 85]],
2220
[-40, [255, 160, 125]],
@@ -26,11 +24,11 @@ function setup() {
2624
[10, [196, 209, 255]],
2725
[40, [155, 127, 255]],
2826
[100, [73, 98, 222]],
29-
[300, [8, 0, 176]]
30-
];
31-
const visualizer = new ColorRampVisualizer(ramps);
32-
vis_dem = visualizer.process(d_dem);
33-
return {
34-
default: vis_dem
35-
};
36-
}
27+
[300, [8, 0, 176]],
28+
];
29+
const visualizer = new ColorRampVisualizer(ramps);
30+
vis_dem = visualizer.process(d_dem);
31+
return {
32+
default: vis_dem,
33+
};
34+
}

dem/dem-grayscale/README.md

+16-6
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,24 @@ parent: DEM
44
layout: script
55
permalink: /dem/dem-grayscale/
66
nav_exclude: true
7+
scripts:
8+
- - Visualization
9+
- script.js
10+
- - EO Browser
11+
- eob.js
12+
examples:
13+
- zoom: '10'
14+
lat: '42.40876'
15+
lng: '12.00634'
16+
datasetId: DEM_MAPZEN
17+
fromTime: '2023-10-02T00:00:00.000Z'
18+
toTime: '2023-10-02T23:59:59.999Z'
19+
platform:
20+
- CDSE
21+
- EOB
22+
evalscripturl: https://custom-scripts.sentinel-hub.com/dem/dem-grayscale/eob.js
723
---
824

9-
10-
## Evaluate and visualize
11-
12-
- [EO Browser](https://sentinelshare.page.link/2dbx)
13-
- [Copernicus Browser](https://sentinelshare.page.link/3nLx)
14-
1525
## Description
1626

1727
This script returns a grayscale visualization of a digital elevation model, assigning continuous colors to the elevation borders.

dem/dem-grayscale/eob.js

+4-14
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
//VERSION=3
22
// To set custom max and min values, set
3-
// defaultVis to false and choose your max and
4-
// min values. The color map will then be scaled
3+
// choose your max and min values.
4+
// The color map will then be scaled
55
// to those max and min values
6-
const defaultVis = true
76
const max = 9000
8-
const min = -9000
7+
const min = -12000
98

109
function setup() {
1110
return {
@@ -18,14 +17,6 @@ function setup() {
1817
};
1918
}
2019

21-
function updateMap(max, min) {
22-
const numIntervals = map.length
23-
const intervalLength = (max - min) / (numIntervals - 1);
24-
for (let i = 0; i < numIntervals; i++) {
25-
map[i][0] = max - intervalLength * i
26-
}
27-
}
28-
2920
const map = [
3021
[9000, 0xffffff],
3122
[7000, 0xf9f9f9],
@@ -51,8 +42,7 @@ const map = [
5142
[-12000, 0x000000],
5243
];
5344

54-
if (!defaultVis) updateMap(max, min);
55-
const visualizer = new ColorRampVisualizer(map);
45+
const visualizer = new ColorRampVisualizer(map, min, max);
5646

5747
function evaluatePixel(sample) {
5848
let val = sample.DEM;

0 commit comments

Comments
 (0)