Skip to content

Commit

Permalink
Deploy preview for PR 1 🛫
Browse files Browse the repository at this point in the history
  • Loading branch information
hrodmn committed Nov 18, 2024
1 parent dd0ef72 commit 6b29133
Showing 1 changed file with 28 additions and 14 deletions.
42 changes: 28 additions & 14 deletions pr-preview/pr-1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,23 @@ <h2>How is it going?</h2>
</div></div>
</section></section>
<section>
<section id="stac-powered-applications" class="title-slide slide level1 center">
<h1>STAC-powered applications</h1>

<section id="the-stac-spec-advantage" class="title-slide slide level1 center">
<h1>The STAC spec advantage</h1>
<aside class="notes">
<ul>
<li>a few applications that show how application developers can build to the STAC spec</li>
</ul>
<style type="text/css">
span.MJX_Assistive_MathML {
position:absolute!important;
clip: rect(1px, 1px, 1px, 1px);
padding: 1px 0 0 0!important;
border: 0!important;
height: 1px!important;
width: 1px!important;
overflow: hidden!important;
display:block!important;
}</style></aside>
</section>
<section id="stac-browser" class="slide level2 hide-title center">
<h2>STAC Browser</h2>
Expand Down Expand Up @@ -805,7 +819,7 @@ <h2>Example workflow</h2>
<ul>
<li>thanks to the STAC spec we only need a few libraries to interact with data from any collection!</li>
</ul>
<div id="1b9dd7b4" class="cell" data-execution_count="1">
<div id="4954ff83" class="cell" data-execution_count="1">
<div class="sourceCode cell-code" id="cb1" data-code-line-numbers="|1|3|5|"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a></a><span class="im">import</span> odc.stac</span>
<span id="cb1-2"><a></a><span class="im">import</span> pyproj</span>
<span id="cb1-3"><a></a><span class="im">import</span> pystac_client</span>
Expand All @@ -820,7 +834,7 @@ <h2>Define AOI</h2>
<ul>
<li>set up an AOI</li>
</ul>
<div id="363f0206" class="cell" data-execution_count="2">
<div id="d998d482" class="cell" data-execution_count="2">
<div class="sourceCode cell-code" id="cb2" data-code-line-numbers="|1|3-5|7-14|"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb2-1"><a></a>crs <span class="op">=</span> pyproj.CRS.from_string(<span class="st">"epsg:5070"</span>)</span>
<span id="cb2-2"><a></a></span>
<span id="cb2-3"><a></a><span class="co"># bounding box that surrounds the North Shore of Lake Superior</span></span>
Expand All @@ -846,7 +860,7 @@ <h2>Collection search</h2>
<ul>
<li>find DEM collections in a STAC API</li>
</ul>
<div id="77d11ce2" class="cell" data-execution_count="3">
<div id="dcb0c2ae" class="cell" data-execution_count="3">
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb4-1"><a></a>client <span class="op">=</span> pystac_client.Client.<span class="bu">open</span>(</span>
<span id="cb4-2"><a></a> <span class="st">"https://dev.asdi-catalog.org/"</span></span>
<span id="cb4-3"><a></a>)</span>
Expand All @@ -872,7 +886,7 @@ <h2>Item search</h2>
<ul>
<li>query STAC items</li>
</ul>
<div id="229e2a62" class="cell columns column-output-location" data-execution_count="4">
<div id="07db62b6" class="cell columns column-output-location" data-execution_count="4">
<div class="column">
<div class="sourceCode cell-code" id="cb6"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb6-1"><a></a>stac_items <span class="op">=</span> client.search(</span>
<span id="cb6-2"><a></a> collections<span class="op">=</span><span class="st">"cop-dem-glo-30"</span>,</span>
Expand Down Expand Up @@ -3166,7 +3180,7 @@ <h2><code>odc.stac.load</code></h2>
<li>load into an <code>xarray.Dataset</code> with <code>odc.stac.load</code></li>
<li>don’t read any data yet, though (just metadata!)</li>
</ul>
<div id="4fa1f40b" class="cell" data-execution_count="5">
<div id="fe35feb0" class="cell" data-execution_count="5">
<div class="sourceCode cell-code" id="cb7" data-code-line-numbers="|3|5|6-7|"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb7-1"><a></a>dem_ds <span class="op">=</span> odc.stac.load(</span>
<span id="cb7-2"><a></a> stac_items,</span>
<span id="cb7-3"><a></a> crs<span class="op">=</span>crs, <span class="co"># assets get reprojected to match crs</span></span>
Expand Down Expand Up @@ -3197,7 +3211,7 @@ <h2><code>xarray</code> API</h2>
<li>access to the <code>xarray</code> API for visualization and analysis</li>
<li>read data from cloud storage “just-in-time”</li>
</ul>
<div id="9d799b0c" class="cell" data-execution_count="6">
<div id="b76852d3" class="cell" data-execution_count="6">
<div class="sourceCode cell-code" id="cb9"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb9-1"><a></a><span class="cf">with</span> rasterio.Env(aws_no_sign_request<span class="op">=</span><span class="va">True</span>):</span>
<span id="cb9-2"><a></a> dem_ds[<span class="st">"data"</span>].squeeze().plot.imshow()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
Expand All @@ -3214,7 +3228,7 @@ <h2>New source, same tools</h2>
<ul>
<li>read another dataset from a different source</li>
</ul>
<div id="25c9139b" class="cell" data-execution_count="7">
<div id="b6a5a60e" class="cell" data-execution_count="7">
<div class="sourceCode cell-code" id="cb10"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb10-1"><a></a>client <span class="op">=</span> pystac_client.Client.<span class="bu">open</span>(</span>
<span id="cb10-2"><a></a> <span class="st">"https://services.terrascope.be/stac"</span></span>
<span id="cb10-3"><a></a>)</span>
Expand All @@ -3233,7 +3247,7 @@ <h2>New source, same tools</h2>
</section>
<section id="load-land-cover" class="slide level2 hide-title center">
<h2>Load land cover</h2>
<div id="4965491a" class="cell" data-execution_count="8">
<div id="2fd54a06" class="cell" data-execution_count="8">
<div class="sourceCode cell-code" id="cb11"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb11-1"><a></a>landcover_ds <span class="op">=</span> odc.stac.load(</span>
<span id="cb11-2"><a></a> stac_items,</span>
<span id="cb11-3"><a></a> crs<span class="op">=</span>crs, <span class="co"># assets get reprojected to match crs</span></span>
Expand Down Expand Up @@ -3265,7 +3279,7 @@ <h2>Merge datasets</h2>
<ul>
<li>combine the two Datasets into a single <code>xarray.Dataset</code></li>
</ul>
<div id="0e40f7f8" class="cell" data-execution_count="9">
<div id="7243f160" class="cell" data-execution_count="9">
<div class="sourceCode cell-code" id="cb13"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb13-1"><a></a>merged <span class="op">=</span> xr.merge(</span>
<span id="cb13-2"><a></a> [</span>
<span id="cb13-3"><a></a> landcover_ds.squeeze().rename({<span class="st">"ESA_WORLDCOVER_10M_MAP"</span>: <span class="st">"land_cover"</span>}),</span>
Expand Down Expand Up @@ -3298,7 +3312,7 @@ <h2>Analyze disparate datasets</h2>
</ul>
<div class="columns">
<div class="column">
<div id="879c6263" class="cell" data-execution_count="10">
<div id="37cda211" class="cell" data-execution_count="10">
<div class="sourceCode cell-code" id="cb15"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb15-1"><a></a><span class="cf">with</span> rasterio.Env(aws_no_sign_request<span class="op">=</span><span class="va">True</span>):</span>
<span id="cb15-2"><a></a> stats <span class="op">=</span> (</span>
<span id="cb15-3"><a></a> merged.elevation_m.groupby(</span>
Expand All @@ -3307,7 +3321,7 @@ <h2>Analyze disparate datasets</h2>
<span id="cb15-6"><a></a> )</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div><div class="column">
<div id="ddd38573" class="cell" data-execution_count="11">
<div id="ef0d6f19" class="cell" data-execution_count="11">
<div class="cell-output cell-output-display">
<div>
<style scoped="">
Expand Down

0 comments on commit 6b29133

Please sign in to comment.