-
Notifications
You must be signed in to change notification settings - Fork 27
/
cog-with-only-one-band.html
43 lines (41 loc) · 1.4 KB
/
cog-with-only-one-band.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<style>
#map {
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<script src="https://unpkg.com/browse/[email protected]/dist/fetch.umd.js"></script>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script src="https://unpkg.com/georaster"></script>
<script src="https://unpkg.com/georaster-layer-for-leaflet"></script>
<script>
// initalize leaflet map
var map = L.map("map").setView([40.761888, -122.316234], 11);
// add OpenStreetMap basemap
L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png", {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
var url_to_geotiff_file = "https://geoblaze.s3.amazonaws.com/LC08_L1TP_045032_20180811_20180815_01_T1_B5.TIF";
parseGeoraster(url_to_geotiff_file).then(function (georaster) {
console.log("georaster:", georaster);
const layer = new GeoRasterLayer({
debugLevel: 0,
georaster,
resolution: 512
});
layer.addTo(map);
});
</script>
</body>
</html>