Skip to content

Commit

Permalink
Merge pull request #1 from xycarto/solar
Browse files Browse the repository at this point in the history
Solar
  • Loading branch information
xycarto authored Jan 17, 2024
2 parents 8373242 + e970495 commit 2b44608
Show file tree
Hide file tree
Showing 6 changed files with 195 additions and 13 deletions.
137 changes: 137 additions & 0 deletions docs/assets/index-4ppFjZpd.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/assets/index-4ppFjZpd.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/assets/lerc-QYCplKBl.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/assets/lerc-QYCplKBl.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>WESM LiDAR Viewer POC</title>
<script type="module" crossorigin src="./assets/index-K1JON49l.js"></script>
<script type="module" crossorigin src="./assets/index-4ppFjZpd.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-uiXX5pdq.css">
</head>
<body onload="openNav()">
Expand Down
65 changes: 53 additions & 12 deletions site-dev/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,19 @@ const tinHSCogLoad = new GeoTIFF({
],
});

const solarCogLoad = new GeoTIFF({
interpolate: false,
normalize: false,
sources: [
{
url: 'https://xyc-wesm-viewer.s3.us-west-2.amazonaws.com/data/cog/California/CA_NoCAL_Wildfires_B1_2018/solar-cog.tif',
min: 45,
max: 1100,
nodata: 0,
},
],
});

const cogBand = ['band', 1]

const surfaceColor = {
Expand All @@ -111,6 +124,20 @@ const surfaceColor = {
],
};

const solarColor = {
color: [
'interpolate',
['linear'],
cogBand,
40, [0, 0, 4, 0],
41, [0, 0, 4, 1],
305, [80, 18, 123, 1],
564, [182, 55, 122, 1],
822, [252, 135, 97, 1],
1100, [252, 253, 191, 1]
],
};

const hsColor = {
color: ['case',
['==', ['band', 1], 0],
Expand Down Expand Up @@ -156,23 +183,32 @@ const tinHsCog = new TileLayer({
style: hsColor,
});

// Make CHM
const solarCog = new TileLayer({
title: 'Solar Average',
visible: false,
crossOrigin: 'anonymous',
source: solarCogLoad,
style: solarColor,
});

// // Make CHM

// const chmSource = new GeoTIFF({
// interpolate: false,
// normalize: false,
// sources: [
// {
// url: 'https://xyc-wesm-viewer.s3.us-west-2.amazonaws.com/data/cog/California/CA_NoCAL_Wildfires_B1_2018/tin-cog.tif',
// min: 1400,
// max: 3000,
// nodata: -9999,
// },
// {
// url: 'https://xyc-wesm-viewer.s3.us-west-2.amazonaws.com/data/cog/California/CA_NoCAL_Wildfires_B1_2018/dsm-cog.tif',
// min: 1400,
// max: 3000,
// max: 3500,
// nodata: -9999,
// },
// {
// url: 'https://xyc-wesm-viewer.s3.us-west-2.amazonaws.com/data/cog/California/CA_NoCAL_Wildfires_B1_2018/tin-cog.tif',
// min: 1400,
// max: 3500,
// nodata: -9999,
// },
// ]
// });

Expand All @@ -185,9 +221,8 @@ const tinHsCog = new TileLayer({
// 'interpolate',
// ['linear'],
// chm,
// 1400, [255, 255, 255, 0],
// 1401, [255, 255, 255, 1],
// 2500, [1, 1, 1, 1]
// -0.2, [255, 255, 255, 1],
// 0.5, [1, 1, 1, 1]
// ],
// };

Expand All @@ -210,9 +245,15 @@ const overlayMaps = new LayerGroup({
layers: [dsmCog, tinCog, tinHsCog, dsmHsCog, vectorTiles]
});

// Map Stuff
const derivedMaps = new LayerGroup({
title: 'Calculated Layers',
layers: [solarCog,]
});

const map = new Map({
target: 'map',
layers: [osm, overlayMaps],
layers: [osm, overlayMaps, derivedMaps],
view: new View({
center: fromLonLat([-120.8, 39.3]),
zoom: 10,
Expand Down

0 comments on commit 2b44608

Please sign in to comment.