<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:digitalearthafrica+DEA101+2021" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:digitalearthafrica+DEA101+2021+type@vertical+block@6386984608294d4fbe2d958ab208d8e5" data-request-token="ce67a7d04cf811f1b4d66b8c55c4de7e" data-graded="False" data-has-score="False">
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:digitalearthafrica+DEA101+2021+type@html+block@941a549934ae4622aceb8a6fd8cafaed">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:digitalearthafrica+DEA101+2021" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:digitalearthafrica+DEA101+2021+type@html+block@941a549934ae4622aceb8a6fd8cafaed" data-request-token="ce67a7d04cf811f1b4d66b8c55c4de7e" data-graded="False" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p>The <a href="https://docs.digitalearthafrica.org/en/latest/sandbox/notebooks/Frequently_used_code/Downloading_data_with_STAC.html" target="_blank">STAC API</a> provides a powerful way to search and load DE Africa data in code. The endpoint is at <strong>https://explorer.digitalearth.africa/stac/</strong>. You can query by area (bounding box), date range, product (collection), and other filters, then load the results into Python with <span style="color: #339966; font-family: monospace, serif;">odc-stac.</span><span style="font-size: 1em;">.</span></p>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:digitalearthafrica+DEA101+2021+type@html+block@1ce74792357447c4bee6ddb2e834812c">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:digitalearthafrica+DEA101+2021" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:digitalearthafrica+DEA101+2021+type@html+block@1ce74792357447c4bee6ddb2e834812c" data-request-token="ce67a7d04cf811f1b4d66b8c55c4de7e" data-graded="False" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p><strong>Setup (Local Environment):</strong> Outside the Sandbox (e.g., your laptop with VS Code), install the needed Python packages. For example, open a terminal or VS Code terminal (on Windows/Mac/Linux) and run:<br />___________________________________________________________</p>
<p><code>pip install pystac-client odc-stac</code><br />___________________________________________________________</p>
<p><br />This <a href="https://pypi.org/project/odc-stac/#:~:text=Using%20pip" target="_blank">installs</a> the STAC client and loading tools. (Alternatively use <span style="color: #339966; font-family: monospace, serif;">conda install -c conda-forge odc-stac</span><span style="font-size: 1em;">.)</span></p>
<p><strong>Configure S3 Access in Code:</strong> In your Python code, you must tell rasterio to use the Cape Town endpoint. In <code><span style="color: #339966;">odc-stac</span></code>, do:</p>
<p><strong><code></code></strong><span style="color: #313131; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;">___________________________________________________________<br /></span><code><b style="font-weight: normal;" id="docs-internal-guid-6f69e7e8-7fff-36aa-9cee-f7f8d2064b1b"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">odc.stac</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">configure_rio</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">configure_rio(</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">cloud_defaults=True,</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">aws={</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"aws_unsigned"</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True},</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">AWS_S3_ENDPOINT=</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"s3.af-south-1.amazonaws.com"</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></b><span id="docs-internal-guid-61150815-7fff-1895-0fd0-213e81ef20d0"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"><br /></span></span></code>___________________________________________________________<br /><br /></p>
<p><strong>Connect to STAC:</strong> Use the pystac-client library:<br />___________________________________________________________<br /><code><b style="font-weight: normal;" id="docs-internal-guid-3bdebceb-7fff-a465-06f4-4899dbd228c3"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">pystac_client</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Client</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">catalog</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Client.</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">open</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"https://explorer.digitalearth.africa/stac"</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></b></code><br />___________________________________________________________<br /><br /></p>
<p>This opens the DE Africa STAC catalog.</p>
<p><strong>Perform a Search:</strong> Define your query parameters, e.g.,:<br />___________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">bbox = [</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">34</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-2</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">35</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-1</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">] </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #b80672; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># [lon_min, lat_min, lon_max, lat_max]</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">start_date = </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"2021-01-01"</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">end_date = </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"2021-12-31"</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">collections = [</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"wofs_ls"</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">] </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #b80672; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># e.g. WOfS (Landsat) product</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">items = catalog.search(</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> bbox=bbox,</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> collections=collections,</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> datetime=</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">f"{start_date}/{end_date}"</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">).get_items()</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">items_list = </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">list</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(items)</span></p>
<p><b style="font-weight: normal;" id="docs-internal-guid-4cc8e3a6-7fff-92c2-e1a4-7cdd02e5a9a5"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">print</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">f"Found {len(items_list)} </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">scenes</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></b><br />___________________________________________________________</p>
<p></p>
<p>This finds all items matching the <a href="https://docs.digitalearthafrica.org/en/latest/platform_tools/odc_stac.html#:~:text=" target="_blank">criteria</a>. You can also filter by properties like <code><span style="color: #339966;">eo:cloud_cover or sat:relative_orbit</span></code> if needed. Each <em>item</em> returned has common STAC fields: <span style="color: #339966;"><code>id</code><span style="color: #000000;">,</span> <code>geometry</code></span> (footprint), <code><span style="color: #339966;">properties</span> </code>(e.g., <code><span style="color: #339966;">datetime</span></code>, <code><span style="color: #339966;">eo:cloud_cover</span></code>, <code><span style="color: #339966;">proj:epsg</span></code>), and <code><span style="color: #339966;">assets</span></code> (links to the actual data files). For example, <code><span style="color: #339966;">properties['datetime']</span></code> is the scene date, and <code><span style="color: #339966;">properties['eo:cloud_cover']</span></code> is cloud cover percentage.</p>
<p><strong>Load Data into xarray:</strong> Use <code><span style="color: #339966;">odc-stac.stac_load</span></code> to load selected bands into an <code><span style="color: #339966;">xarray.Dataset.</span></code> e.g.,:<br />___________________________________________________________<br /><b style="font-weight: normal;"></b></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">odc.stac</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">stac_load</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ds</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">stac_load(</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">items_list,</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">measurements=[</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"red"</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"nir"</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">],</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">resolution=</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">30</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">crs=</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"EPSG:6933"</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></p>
<p><b style="font-weight: normal;" id="docs-internal-guid-c648e6d8-7fff-1bce-de91-d1894c9ca663"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">print</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(ds)</span></b><span id="docs-internal-guid-a2c5a7f6-7fff-1c1f-b666-c90378e5db07"><span style="font-size: 8pt; font-family: 'Roboto Mono', monospace; color: #37474f; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; font-variant-emoji: normal; vertical-align: baseline; white-space-collapse: preserve;"><br /></span></span>___________________________________________________________</p>
<p></p>
<p>This lazily loads the “red” and “nir” bands from all found scenes, reprojects to Africa Albers (EPSG:6933) at <a href="https://docs.digitalearthafrica.org/en/latest/platform_tools/odc_stac.html#:~:text=" target="_blank">30 m</a>. The result is one xarray with dims (time, y, x) and variables “red” and “nir”. You can then compute indices (e.g. NDVI) or combine with other data. The DE Africa documentation shows <a href="https://docs.digitalearthafrica.org/en/latest/sandbox/notebooks/Frequently_used_code/Downloading_data_with_STAC.html#:~:text=Digital%20Earth%20Africa%20stores%20a,africa%2Fstac" target="_blank">similar examples</a> (for Sentinel-2 and GeoMAD).<br /><br /></p>
<p><strong>Common Query Fields:</strong> When constructing STAC queries, note common parameters:</p>
<ul>
<ul>
<li><code><span style="color: #339966;">collections:</span></code> product names (as seen in the Explorer, e.g. <code><span style="color: #339966;">s2_l2a</span> </code>for Sentinel-2, <code><span style="color: #339966;">wofs_ls</span> </code>for <a href="https://docs.digitalearthafrica.org/en/latest/sandbox/notebooks/Frequently_used_code/Downloading_data_with_STAC.html#:~:text=Digital%20Earth%20Africa%20stores%20a,africa%2Fstac" target="_blank">WOfS</a>.</li>
<li><code><span style="color: #339966;">bbox</span></code>: [minLon, minLat, maxLon, maxLat] in EPSG:4326 (WGS84).</li>
<li><code><span style="color: #339966;">datetime</span></code>: a range string <code><span style="color: #339966;">"YYYY-MM-DD/YYYY-MM-DD"</span></code>.</li>
<li>You can also filter by other fields using <code><span style="color: #339966;">query.filter</span></code> or adding to <code><span style="color: #339966;">get_items()</span></code>, such as <code>'<span style="color: #339966;">proj:epsg':'6933</span>'</code> or <code><span style="color: #339966;">'eo:cloud_cover': {'lte':10}</span></code>.<br /><br /></li>
</ul>
</ul>
<p><strong>Quick Example:</strong> Below is a minimal STAC query and load snippet (you can run this in VS Code or the Sandbox):<br />___________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">pystac_client</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Client</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">odc.stac</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">import</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">configure_rio,</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">stac_load</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">configure_rio(aws={</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"aws_unsigned"</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">True},</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">AWS_S3_ENDPOINT=</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"s3.af-south-1.amazonaws.com"</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">catalog</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Client.</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">open</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"https://explorer.digitalearth.africa/stac"</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #b80672; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># Example: search Sentinel-2 L2A in Jan 2021 over a small area</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">items</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">list</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(catalog.search(</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">bbox=[</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">34</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-2</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">35</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-1</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">],</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">collections=[</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"s2_l2a"</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">],</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">datetime=</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"2021-01-01/2021-01-31"</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">).get_items())</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">print</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">len</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(items),</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"scenes found."</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ds</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">=</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">stac_load(items,</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">measurements=[</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"red"</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"nir"</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">],</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">resolution=</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #c5221f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">20</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1c1c1c; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">crs=</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"EPSG:6933"</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><b style="font-weight: normal;" id="docs-internal-guid-d4ed0688-7fff-7e29-954d-55ac1aaadbeb"><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #1967d2; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">print</span><span style="font-size: 9pt; font-family: 'Roboto Mono',monospace; color: #37474f; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(ds)</span></b><br />___________________________________________________________</p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;"><span style="color: #313131; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;"> </span></p>
<p dir="ltr" style="line-height: 1.7999999999999998; margin-top: 0pt; margin-bottom: 0pt;">This code finds Sentinel-2 scenes and loads the red and NIR bands into a dataset (20 m resolution) for further analysis.</p>
</div>
</div>
</div>
<script type="text/javascript">
(function (require) {
require(['/static/js/dateutil_factory.be68acdff619.js?raw'], function () {
require(['js/dateutil_factory'], function (DateUtilFactory) {
DateUtilFactory.transform('.localized-datetime');
});
});
}).call(this, require || RequireJS.require);
</script>
<script>
function emit_event(message) {
parent.postMessage(message, '*');
}
</script>
</div>