Skip to content

Commit f826f49

Browse files
author
Monja Šebela
committedApr 6, 2020
Adding Airbus Pleiades and PlanetScope scripts for COVID19 contest
1 parent a207eb3 commit f826f49

File tree

37 files changed

+602
-0
lines changed

37 files changed

+602
-0
lines changed
 

Diff for: ‎README.md

+42
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Scripts are organised by sensors supported on Sentinel Hub:
1212
- [Landsat 5 and 7](#landsat-57)
1313
- [Landsat-8](#landsat-8)
1414
- [MODIS](#modis)
15+
- [PlanetScope](#planet_scope)
16+
- [Airbus Pleiades](#airbus_pleiades)
1517

1618
You are invited to publish your own scripts - see [howto](#howto).
1719

@@ -208,6 +210,46 @@ The Moderate Resolution Imaging Spectroradiometer (MODIS) MCD43A4 version 6 on S
208210

209211
#### Remote sensing indices
210212
- [collection](modis/indexdb) of remote sensing indices from an extensive [Index database (IDB)](http://www.indexdatabase.de/){:target="_blank"}
213+
214+
## <a name="planet_scope"></a>PlanetScope (commercial)
215+
216+
<a href="https://www.planet.com/products/monitoring/">PlanetScope</a> satellite constellation consists of more than 130 small satellites called Doves. The satellites are launched in groups, which constantly improves mission's characteristics such as revisit times, spatial and spectral resolutions. PlanetScope data complements Sentinel-2 with better spatial resolution (3m) and almost global daily coverage. It is an excellent source for vegetation monitoring. For more information on PlanetScope, visit our <a href="https://docs.sentinel-hub.com/api/latest/#/data/PlanetScope">documentation page</a>.
217+
218+
The spectral bands of PlanetScope data are the following:
219+
220+
*B1 - Blue, resolution 3m*
221+
*B2 - Green, resolution 3m*
222+
*B3 - Red, resolution 3m*
223+
*B4 - Near Infrared, resolution 3m*
224+
225+
- [True Color](planet_scope/true_color)
226+
- [False Color](planet_scope/false_color)
227+
- [NDVI](planet_scope/ndvi)
228+
- [NDWI](planet_scope/ndwi)
229+
- [Green City](planet_scope/green_city)
230+
231+
## <a name="planet_scope"></a>Airbus Pleiades (commercial)
232+
233+
<a href="https://www.intelligence-airbusds.com/en/8692-pleiades">Pléiades</a> constelation is composed of two twin satellites orbiting the Earth 180° apart. The satellites deliver the incredible global 0.5 m spectral resolution imagery. Pleiades' satellites share the orbit with SPOT satellites, which makes it possible to combine the data form both sources.
234+
The Pléiades data with its high spatial resolution is suitable for a wide range of remote sensing applications such as vegetation monitoring, precise mapping, as well as risk and disaster management. To learn more about Pleiades, visit our <a href="https://docs.sentinel-hub.com/api/latest/#/data/Airbus-Pleiades"> documentation page.</a>
235+
236+
The spectral bands of Pleiades data are the following:
237+
238+
B0 - Blue (430-550 nm), resolution 2m
239+
B1 - Green (490-610 nm), resolution 2m
240+
B2 - Red (600-720 nm), resolution 2m
241+
B3 - Near Infrared (750-950 nm), resolution 2m
242+
PAN - Panchromatic (480-830 nm), resolution 0.5m
243+
244+
Pleiades's RGB bands are in 2 meter spatial resolution. To take advantage of the 0.5 m PAN band, the pansharpening process is required.
245+
246+
- [True Color](airbus_pleiades/true_color)
247+
- [Pansharpened True Color](airbus_pleiades/true_color_pansharpened)
248+
- [False Color](airbus_pleiades/false_color)
249+
- [NDVI](airbus_pleiades/ndvi)
250+
- [NDWI](airbus_pleiades/ndwi)
251+
- [Green City](airbus_pleiades/green_city)
252+
- [Pansharpened Green City](airbus_pleiades/green_city_pansharpened)
211253

212254
# <a name="howto"></a>Adding new custom scripts
213255
Have a look at the [template](example) and follow the procedure described there.

Diff for: ‎airbus_pleiades/false_color/README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# False color infrared product
2+
3+
<a href="#" id='togglescript'>Show</a> script or [download](script.js){:target="_blank"} it.
4+
<div id='script_view' style="display:none">
5+
{% highlight javascript %}
6+
{% include_relative script.js %}
7+
{% endhighlight %}
8+
</div>
9+
10+
## Evaluate and visualize
11+
12+
As Airbus Pleiades is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
13+
14+
## General description
15+
16+
The [False color](https://en.wikipedia.org/wiki/False_color) infrared composite maps near-infrared spectral band B8 with red and green bands, B4 and B3, to [sRGB](https://en.wikipedia.org/wiki/SRGB) components directly. It is most commonly used to assess plant density and healht, as plants reflect near infrared and green light, while absorbing red. Since they reflect more near infrared than green, plant-covered land appears deep red. Denser plant growth is darker red. Cities and exposed ground are gray or tan, and water appears blue or black.
17+
18+
## Description of representative images
19+
20+
False color composite of Rome.
21+
22+
![False color composite of Rome](fig/fig1.jpg)
23+
24+
## References
25+
- [1] Wikipedia, [False color](https://en.wikipedia.org/wiki/False_color). Accessed October 10th 2017.
26+
- [2] Wikipedia, [sRGB](https://en.wikipedia.org/wiki/SRGB). Accessed October 10th 2017.

Diff for: ‎airbus_pleiades/false_color/fig/fig1.jpg

349 KB
Loading

Diff for: ‎airbus_pleiades/false_color/script.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//VERSION=3
2+
//False Color
3+
4+
function setup() {
5+
return {
6+
input: ["B2", "B3", "B4"],
7+
output: { bands: 3 }
8+
};
9+
}
10+
11+
function evaluatePixel(sample) {
12+
return [sample.B4/3000, sample.B3/3000, sample.B2/3000];
13+
}
14+

Diff for: ‎airbus_pleiades/green_city/README.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Green City Script, Pleiades data
2+
3+
<a href="#" id='togglescript'>Show</a> script or [download](green_city.js){:target="_blank"} it.
4+
<div id='script_view' style="display:none">
5+
{% highlight javascript %}
6+
{% include_relative green_city.js %}
7+
{% endhighlight %}
8+
</div>
9+
10+
## Evaluate and visualize
11+
12+
As Airbus Pleiades is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
13+
14+
## General description of the script
15+
16+
Uses NDVI [1] to color Pleiades images and create awareness of green areas in cities around the World. The script was modified to fit PlanetScope spectral bands.
17+
See also <a href="https://custom-scripts.sentinel-hub.com/sentinel-2/green_city/#">Green City for Pleiades.</a>
18+
19+
## Author of the script
20+
21+
Carlos Bentes
22+
23+
## Description of representative images
24+
25+
Visualization of Rome with the Green City script. Acquisition date 2020-03-04, processed by Sentinel Hub.
26+
![Green City script over Tallinn](fig/fig1.jpg)
27+
28+
## References
29+
30+
[1] Normalized difference vegetation index:
31+
https://en.wikipedia.org/wiki/Normalized_difference_vegetation_index
32+
33+
## Credits
34+
35+
Y. Zha, J. Gao & S. Ni (2003) Use of normalized difference built-up index in automatically mapping urban areas from TM imagery, International Journal of Remote Sensing, 24:3, 583-594, DOI: 10.1080/01431160304987

Diff for: ‎airbus_pleiades/green_city/fig/fig1.jpg

315 KB
Loading

Diff for: ‎airbus_pleiades/green_city/script.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
Author of the script: Carlos Bentes
3+
*/
4+
5+
// Normalized Difference Vegetation Index
6+
var ndvi = (B3-B2)/(B3+B2);
7+
8+
// Threshold for vegetation
9+
var veg_th = 0.4;
10+
11+
// Simple RGB
12+
var R = B2/3000;
13+
var G = B1/3000;
14+
var B = B0/3000;
15+
16+
// Transform to Black and White
17+
var Y = 0.2*R + 0.7*G + 0.1*B;
18+
var pixel = [Y, Y, Y];
19+
20+
// Change vegetation color
21+
if(ndvi >= veg_th)
22+
pixel = [0.1*Y, 1.8*Y, 0.1*Y];
23+
24+
return pixel;

Diff for: ‎airbus_pleiades/green_city_pansharpened/README.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Green City - Pleiades Pansharpened Script, Pleiades
2+
3+
<a href="#" id='togglescript'>Show</a> script or [download](green_city.js){:target="_blank"} it.
4+
<div id='script_view' style="display:none">
5+
{% highlight javascript %}
6+
{% include_relative green_city.js %}
7+
{% endhighlight %}
8+
</div>
9+
10+
## Evaluate and visualize
11+
12+
As Airbus Pleiades is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
13+
14+
## General description of the script
15+
16+
Uses NDVI [1] to color Pleiades images and create awareness of green areas in cities around the World. The script was modified to fit PlanetScope spectral bands.
17+
See also <a href="https://custom-scripts.sentinel-hub.com/sentinel-2/green_city/#">Green City for Pleiades.</a>
18+
19+
## Author of the script
20+
21+
Carlos Bentes
22+
23+
## Description of representative images
24+
25+
Visualization of the port of Hamburg with the Green City script. Acquisition date 2019-04-30, processed by Sentinel Hub.
26+
![Green City script over Tallinn](fig/fig1.jpg)
27+
28+
## References
29+
30+
[1] Normalized difference vegetation index:
31+
https://en.wikipedia.org/wiki/Normalized_difference_vegetation_index
32+
33+
## Credits
34+
35+
Y. Zha, J. Gao & S. Ni (2003) Use of normalized difference built-up index in automatically mapping urban areas from TM imagery, International Journal of Remote Sensing, 24:3, 583-594, DOI: 10.1080/01431160304987

Diff for: ‎airbus_pleiades/green_city_pansharpened/fig/fig1.jpg

419 KB
Loading

Diff for: ‎airbus_pleiades/green_city_pansharpened/script.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
let weight = (B2 + B1 + B0 * 0.4) / 2.4;
2+
if (weight == 0) {
3+
return [0, 0, 0];
4+
}
5+
let ratio = PAN/weight * 2.5;
6+
/*
7+
Author of the script: Carlos Bentes
8+
*/
9+
10+
// Normalized Difference Vegetation Index
11+
var ndvi = (B3-B2)/(B3+B2);
12+
13+
// Threshold for vegetation
14+
var veg_th = 0.4;
15+
16+
// Simple RGB
17+
var R = (B2/10000)*ratio;
18+
var G = (B1/10000)*ratio
19+
var B = (B0/10000)*ratio
20+
21+
// Transform to Black and White
22+
var Y = 0.2*R + 0.7*G + 0.1*B;
23+
var pixel = [Y, Y, Y];
24+
25+
// Change vegetation color
26+
if(ndvi >= veg_th)
27+
pixel = [0.1*Y, 1.8*Y, 0.1*Y];
28+
29+
return pixel;

Diff for: ‎airbus_pleiades/ndvi/README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Normalized difference vegetation index, Pleiades
2+
3+
<a href="#" id='togglescript'>Show</a> script or [download](script.js){:target="_blank"} it.
4+
<div id='script_view' style="display:none">
5+
{% highlight javascript %}
6+
{% include_relative script.js %}
7+
{% endhighlight %}
8+
</div>
9+
10+
## Evaluate and visualize
11+
12+
As Airbus Pleiades is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
13+
14+
## General description
15+
16+
The well known and widely used NDVI is a simple, but effective index for quantifying green vegetation. It normalizes green leaf scattering in Near Infra-red wavelengths with chlorophyll absorption in red wavelengths.
17+
18+
The value range of the NDVI is -1 to 1. Negative values of NDVI (values approaching -1) correspond to water. Values close to zero (-0.1 to 0.1) generally correspond to barren areas of rock, sand, or snow. Low, positive values represent shrub and grassland (approximately 0.2 to 0.4), while high values indicate temperate and tropical rainforests (values approaching 1). It is a good proxy for live green vegetation; see [1] for details.
19+
20+
The normalized difference vegetation index, abbreviated NDVI, is defined as
21+
22+
$$NDVI := \mathtt{Index}(NIR,RED) = \frac{NIR-RED}{NIR+RED}.$$
23+
24+
For Pleiades, the index looks like this:
25+
26+
$$NDVI := \mathtt{Index}(B3,B2) = \frac{B3-B2}{B3+B2}.$$
27+
28+
## Description of representative images
29+
30+
NDVI of Rome.
31+
32+
![NDVI of Rome](fig/fig1.jpg)
33+
34+
## References
35+
[1] Wikipedia, [Normalized Difference Vegetation Index
36+
](https://en.wikipedia.org/wiki/Normalized_Difference_Vegetation_Index). Accessed on October 4th 2017.

Diff for: ‎airbus_pleiades/ndvi/fig/fig1.jpg

363 KB
Loading

Diff for: ‎airbus_pleiades/ndvi/script.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//NDVI
2+
var val = (B3 - B2) / (B3 + B2);
3+
4+
return colorBlend(val,
5+
[0.0, 0.5, 1.0],
6+
[
7+
[1,0,0],
8+
[1,1,0],
9+
[0.1,0.31,0],
10+
]);

Diff for: ‎airbus_pleiades/ndwi/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# NDWI Normalized Difference Water Index, Pleiades
2+
3+
<a href="#" id='togglescript'>Show</a> script or [download](script.js){:target="_blank"} it.
4+
<div id='script_view' style="display:none">
5+
{% highlight javascript %}
6+
{% include_relative script.js %}
7+
{% endhighlight %}
8+
</div>
9+
10+
## Evaluate and visualize
11+
12+
As Airbus Pleiades is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
13+
14+
## General description of the script
15+
16+
The NDWI is useful for water body mapping, as water bodies strongly absorb light in visible to infrared electromagnetic spectrum. NDWI uses green and near infrared bands to highlight water bodies. It is sensitive to built-up land and can result in over-estimation of water bodies.
17+
18+
**NDWI = (B01 - B03) / (B01 + B03)**
19+
20+
Values description: Index values greater than 0.5 usually correspond to water bodies. Vegetation usually corresponds to much smaller values and built-up areas to values between zero and 0.2.
21+
22+
## Description of representative images
23+
24+
NDWI (for water content in leaves) of Rome.
25+
26+
![NDWI of Rome](fig/fig1.jpg)
27+
28+
## References
29+
Source: https://en.wikipedia.org/wiki/Normalized_difference_water_index

Diff for: ‎airbus_pleiades/ndwi/fig/fig1.jpg

368 KB
Loading

Diff for: ‎airbus_pleiades/ndwi/script.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//NDWI
2+
3+
var val = (B1/3000 - B3/3000) / (B1/3000 + B3/3000);
4+
5+
return colorBlend(val,
6+
[-1, -0.5, -0.2, 0, 0.2, 0.5, 1.0],
7+
[
8+
[1,0,1],
9+
[1,0.5, 0],
10+
[1,1, 0],
11+
[0.2,1,0.5],
12+
[0,0,1],
13+
[0,0,0.3],
14+
[0,0,0],
15+
]);
16+

Diff for: ‎airbus_pleiades/true_color/README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# True color product, Pleiades
2+
3+
<a href="#" id='togglescript'>Show</a> script or [download](script.js){:target="_blank"} it.
4+
<div id='script_view' style="display:none">
5+
{% highlight javascript %}
6+
{% include_relative script.js %}
7+
{% endhighlight %}
8+
</div>
9+
10+
## Evaluate and visualize
11+
12+
As Airbus Pleiades is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
13+
14+
## General description
15+
16+
The true color product maps Sentinel-2 band values B3, B2, and B1 which roughly correspond to red, green, and blue part of the spectrum, respectively, to R, G, and B components.
17+
18+
## Description of representative images
19+
20+
True color visualization of Rome.
21+
22+
![True color visualization of Rome, on 8.10.2017.](fig/fig1.jpg)
23+
24+
25+
## References
26+
- Wikipedia, [False color](https://en.wikipedia.org/wiki/False_color#True_color). Accessed October 10th 2017.

Diff for: ‎airbus_pleiades/true_color/fig/fig1.jpg

317 KB
Loading

Diff for: ‎airbus_pleiades/true_color/script.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//VERSION=3
2+
//True Color
3+
4+
function setup() {
5+
return {
6+
input: ["B1", "B2", "B3"],
7+
output: { bands: 3 }
8+
};
9+
}
10+
11+
function evaluatePixel(sample) {
12+
return [sample.B3/3000, sample.B2/3000, sample.B1/3000];
13+
}

Diff for: ‎airbus_pleiades/true_color_pansharpened/README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# True Color Pansharpened, Pleiades
2+
3+
<a href="#" id='togglescript'>Show</a> script or [download](script.js){:target="_blank"} it.
4+
<div id='script_view' style="display:none">
5+
{% highlight javascript %}
6+
{% include_relative script.js %}
7+
{% endhighlight %}
8+
</div>
9+
10+
## Evaluate and visualize
11+
12+
As Airbus Pleiades is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
13+
14+
## General description
15+
16+
The true color product maps Sentinel-2 band values B3, B2, and B1 which roughly correspond to red, green, and blue part of the spectrum, respectively, to R, G, and B components. The RGB bands with spectral resolution of 2 meters were pansharpened using the PAN band with spectral resolution of 0.5 meters. The result is a true colorimage with the resolution of 0.5 meters.
17+
18+
## Description of representative images
19+
20+
True color visualization of Rome.
21+
22+
![True color visualization of Rome, on 8.10.2017.](fig/fig1.jpg)
23+
24+
25+
## References
26+
- Wikipedia, [False color](https://en.wikipedia.org/wiki/False_color#True_color). Accessed October 10th 2017.

Diff for: ‎airbus_pleiades/true_color_pansharpened/fig/fig1.jpg

379 KB
Loading

Diff for: ‎airbus_pleiades/true_color_pansharpened/script.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//VERSION=3
2+
//True Color
3+
4+
function setup() {
5+
return {
6+
input: ["B1", "B2", "B3"],
7+
output: { bands: 3 }
8+
};
9+
}
10+
11+
function evaluatePixel(sample) {
12+
return [sample.B3/3000, sample.B2/3000, sample.B1/3000];
13+
}

Diff for: ‎planet_scope/false_color/README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# False color infrared product, PlanetScope
2+
3+
<a href="#" id='togglescript'>Show</a> script or [download](script.js){:target="_blank"} it.
4+
<div id='script_view' style="display:none">
5+
{% highlight javascript %}
6+
{% include_relative script.js %}
7+
{% endhighlight %}
8+
</div>
9+
10+
## Evaluate and visualize
11+
12+
As PlanetScope is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
13+
14+
## General description
15+
16+
The [False color](https://en.wikipedia.org/wiki/False_color) infrared composite maps near-infrared spectral band B8 with red and green bands, B4 and B3, to [sRGB](https://en.wikipedia.org/wiki/SRGB) components directly. It is most commonly used to assess plant density and healht, as plants reflect near infrared and green light, while absorbing red. Since they reflect more near infrared than green, plant-covered land appears deep red. Denser plant growth is darker red. Cities and exposed ground are gray or tan, and water appears blue or black.
17+
18+
## Description of representative images
19+
20+
False color composite of Rome.
21+
22+
![False color composite of Rome](fig/fig1.jpg)
23+
24+
## References
25+
- [1] Wikipedia, [False color](https://en.wikipedia.org/wiki/False_color). Accessed October 10th 2017.
26+
- [2] Wikipedia, [sRGB](https://en.wikipedia.org/wiki/SRGB). Accessed October 10th 2017.

Diff for: ‎planet_scope/false_color/fig/fig1.jpg

155 KB
Loading

Diff for: ‎planet_scope/false_color/script.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//VERSION=3
2+
//False Color
3+
4+
function setup() {
5+
return {
6+
input: ["B2", "B3", "B4"],
7+
output: { bands: 3 }
8+
};
9+
}
10+
11+
function evaluatePixel(sample) {
12+
return [sample.B4/3000, sample.B3/3000, sample.B2/3000];
13+
}

Diff for: ‎planet_scope/green_city/README.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Green City Script
2+
3+
<a href="#" id='togglescript'>Show</a> script or [download](green_city.js){:target="_blank"} it.
4+
<div id='script_view' style="display:none">
5+
{% highlight javascript %}
6+
{% include_relative green_city.js %}
7+
{% endhighlight %}
8+
</div>
9+
10+
## Evaluate and visualize
11+
12+
As PlanetScope is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
13+
14+
## General description of the script
15+
16+
Uses NDVI [1] to color PlanetScope images and create awareness of green areas in cities around the World. The script was modified to fit PlanetScope spectral bands.
17+
See also <a href="https://custom-scripts.sentinel-hub.com/sentinel-2/green_city/#">Green City for PlanetScope.</a>
18+
19+
## Author of the script
20+
21+
Carlos Bentes
22+
23+
## Description of representative images
24+
25+
Visualization of the port of Hamburg with the Green City script. Acquisition date 2019-04-30, processed by Sentinel Hub.
26+
![Green City script over Tallinn](fig/fig1.jpg)
27+
28+
## References
29+
30+
[1] Normalized difference vegetation index:
31+
https://en.wikipedia.org/wiki/Normalized_difference_vegetation_index
32+
33+
## Credits
34+
35+
Y. Zha, J. Gao & S. Ni (2003) Use of normalized difference built-up index in automatically mapping urban areas from TM imagery, International Journal of Remote Sensing, 24:3, 583-594, DOI: 10.1080/01431160304987

Diff for: ‎planet_scope/green_city/fig/fig1.jpg

121 KB
Loading

Diff for: ‎planet_scope/green_city/script.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
Author of the script: Carlos Bentes
3+
*/
4+
5+
// Normalized Difference Vegetation Index
6+
var ndvi = (B4-B3)/(B4+B3);
7+
8+
// Threshold for vegetation
9+
var veg_th = 0.4;
10+
11+
// Simple RGB
12+
var R = B3/3000;
13+
var G = B2/3000;
14+
var B = B1/3000;
15+
16+
// Transform to Black and White
17+
var Y = 0.2*R + 0.7*G + 0.1*B;
18+
var pixel = [Y, Y, Y];
19+
20+
// Change vegetation color
21+
if(ndvi >= veg_th)
22+
pixel = [0.1*Y, 1.8*Y, 0.1*Y];
23+
24+
return pixel;

Diff for: ‎planet_scope/ndvi/README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Normalized difference vegetation index, PlanetScope
2+
3+
<a href="#" id='togglescript'>Show</a> script or [download](script.js){:target="_blank"} it.
4+
<div id='script_view' style="display:none">
5+
{% highlight javascript %}
6+
{% include_relative script.js %}
7+
{% endhighlight %}
8+
</div>
9+
10+
## Evaluate and visualize
11+
12+
As PlanetScope is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
13+
14+
## General description
15+
16+
The well known and widely used NDVI is a simple, but effective index for quantifying green vegetation. It normalizes green leaf scattering in Near Infra-red wavelengths with chlorophyll absorption in red wavelengths.
17+
18+
The value range of the NDVI is -1 to 1. Negative values of NDVI (values approaching -1) correspond to water. Values close to zero (-0.1 to 0.1) generally correspond to barren areas of rock, sand, or snow. Low, positive values represent shrub and grassland (approximately 0.2 to 0.4), while high values indicate temperate and tropical rainforests (values approaching 1). It is a good proxy for live green vegetation; see [1] for details.
19+
20+
The normalized difference vegetation index, abbreviated NDVI, is defined as
21+
22+
$$NDVI := \mathtt{Index}(NIR,RED) = \frac{NIR-RED}{NIR+RED}.$$
23+
24+
For PlanetScope, the index looks like this:
25+
26+
$$NDVI := \mathtt{Index}(B4,B3) = \frac{B4-B3}{B4+B3}.$$
27+
28+
## Description of representative images
29+
30+
NDVI of Rome.
31+
32+
![NDVI of Rome](fig/fig1.jpg)
33+
34+
## References
35+
[1] Wikipedia, [Normalized Difference Vegetation Index
36+
](https://en.wikipedia.org/wiki/Normalized_Difference_Vegetation_Index). Accessed on October 4th 2017.

Diff for: ‎planet_scope/ndvi/fig/fig1.jpg

168 KB
Loading

Diff for: ‎planet_scope/ndvi/script.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//NDVI
2+
var val = (B4 - B3) / (B4 + B3);
3+
4+
return colorBlend(val,
5+
[0.0, 0.5, 1.0],
6+
[
7+
[1,0,0],
8+
[1,1,0],
9+
[0.1,0.31,0],
10+
]);

Diff for: ‎planet_scope/ndwi/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# NDWI Normalized Difference Water Index, PlanetScope
2+
3+
<a href="#" id='togglescript'>Show</a> script or [download](script.js){:target="_blank"} it.
4+
<div id='script_view' style="display:none">
5+
{% highlight javascript %}
6+
{% include_relative script.js %}
7+
{% endhighlight %}
8+
</div>
9+
10+
## Evaluate and visualize
11+
12+
As PlanetScope is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
13+
14+
## General description of the script
15+
16+
The NDWI is useful for water body mapping, as water bodies strongly absorb light in visible to infrared electromagnetic spectrum. NDWI uses green and near infrared bands to highlight water bodies. It is sensitive to built-up land and can result in over-estimation of water bodies.
17+
18+
**NDWI = (B02 - B04) / (B02 + B04)**
19+
20+
Values description: Index values greater than 0.5 usually correspond to water bodies. Vegetation usually corresponds to much smaller values and built-up areas to values between zero and 0.2.
21+
22+
## Description of representative images
23+
24+
NDWI (for water content in leaves) of Rome.
25+
26+
![NDWI of Rome](fig/fig1.jpg)
27+
28+
## References
29+
Source: https://en.wikipedia.org/wiki/Normalized_difference_water_index

Diff for: ‎planet_scope/ndwi/fig/fig1.jpg

198 KB
Loading

Diff for: ‎planet_scope/ndwi/script.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//NDWI
2+
3+
var val = (B2/3000 - B4/3000) / (B2/3000 + B4/3000);
4+
5+
return colorBlend(val,
6+
[-1, -0.5, -0.2, 0, 0.2, 0.5, 1.0],
7+
[
8+
[1,0,1],
9+
[1,0.5, 0],
10+
[1,1, 0],
11+
[0.2,1,0.5],
12+
[0,0,1],
13+
[0,0,0.3],
14+
[0,0,0],
15+
]);
16+

Diff for: ‎planet_scope/true_color/README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# True color product, PlanetSpot
2+
3+
<a href="#" id='togglescript'>Show</a> script or [download](script.js){:target="_blank"} it.
4+
<div id='script_view' style="display:none">
5+
{% highlight javascript %}
6+
{% include_relative script.js %}
7+
{% endhighlight %}
8+
</div>
9+
10+
## Evaluate and visualize
11+
12+
As PlanetSpot is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
13+
14+
## General description
15+
16+
The true color product maps PlanetSpot band values B3, B2, and B1 which roughly correspond to red, green, and blue part of the spectrum, respectively, to R, G, and B components.
17+
18+
## Description of representative images
19+
20+
True color visualization of Rome.
21+
22+
![True color visualization of Rome, on 8.10.2017.](fig/fig1.jpg)
23+
24+
25+
## References
26+
- Wikipedia, [False color](https://en.wikipedia.org/wiki/False_color#True_color). Accessed October 10th 2017.

Diff for: ‎planet_scope/true_color/fig/fig1.jpg

139 KB
Loading

Diff for: ‎planet_scope/true_color/script.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//VERSION=3
2+
//True Color
3+
4+
function setup() {
5+
return {
6+
input: ["B1", "B2", "B3"],
7+
output: { bands: 3 }
8+
};
9+
}
10+
11+
function evaluatePixel(sample) {
12+
return [sample.B3/3000, sample.B2/3000, sample.B1/3000];
13+
}

0 commit comments

Comments
 (0)
Please sign in to comment.