Skip to content

Commit

Permalink
Deploying to gh-pages from @ 44ba5bb 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainv committed Jul 17, 2024
1 parent 3d9b766 commit 2bcc55f
Show file tree
Hide file tree
Showing 70 changed files with 170 additions and 164 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 479cda21d7d382de03ebc385cf3970b5
config: a1fd08047b0aeccc22a822a526d436bc
tags: 645f666f9bcd5a90fca523b33c5a78b7
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="../../../../index.html">
Expand Down Expand Up @@ -170,7 +170,7 @@ <h1>Source code for forestatrisk.data.compute.compute_biomass_avitabile</h1><div
&#169;2024, Cirad.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.4.5</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

</div>
Expand Down
4 changes: 2 additions & 2 deletions _modules/forestatrisk/data/compute/compute_biomass_whrc.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="../../../../index.html">
Expand Down Expand Up @@ -192,7 +192,7 @@ <h1>Source code for forestatrisk.data.compute.compute_biomass_whrc</h1><div clas
&#169;2024, Cirad.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.4.5</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

</div>
Expand Down
4 changes: 2 additions & 2 deletions _modules/forestatrisk/data/compute/compute_distance.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="../../../../index.html">
Expand Down Expand Up @@ -206,7 +206,7 @@ <h1>Source code for forestatrisk.data.compute.compute_distance</h1><div class="h
&#169;2024, Cirad.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.4.5</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

</div>
Expand Down
56 changes: 30 additions & 26 deletions _modules/forestatrisk/data/compute/compute_forest.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="../../../../index.html">
Expand Down Expand Up @@ -101,6 +101,7 @@ <h3 id="searchlabel">Quick search</h3>
<h1>Source code for forestatrisk.data.compute.compute_forest</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;Processing forest data.&quot;&quot;&quot;</span>

<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">subprocess</span>
<span class="kn">from</span> <span class="nn">glob</span> <span class="kn">import</span> <span class="n">glob</span>

Expand Down Expand Up @@ -131,30 +132,33 @@ <h1>Source code for forestatrisk.data.compute.compute_forest</h1><div class="hig
<span class="c1"># Creation options</span>
<span class="n">copts</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;COMPRESS=DEFLATE&quot;</span><span class="p">,</span> <span class="s2">&quot;PREDICTOR=2&quot;</span><span class="p">,</span> <span class="s2">&quot;BIGTIFF=YES&quot;</span><span class="p">]</span>

<span class="c1"># Make vrt</span>
<span class="n">tif_forest_files</span> <span class="o">=</span> <span class="n">glob</span><span class="p">(</span><span class="s2">&quot;forest_tiles/forest_*.tif&quot;</span><span class="p">)</span>
<span class="n">forest_vrt</span> <span class="o">=</span> <span class="n">gdal</span><span class="o">.</span><span class="n">BuildVRT</span><span class="p">(</span>
<span class="s2">&quot;forest.vrt&quot;</span><span class="p">,</span>
<span class="n">tif_forest_files</span><span class="p">,</span>
<span class="n">callback</span><span class="o">=</span><span class="n">cback</span><span class="p">)</span>
<span class="c1"># Flush cache</span>
<span class="n">forest_vrt</span><span class="o">.</span><span class="n">FlushCache</span><span class="p">()</span>
<span class="n">forest_vrt</span> <span class="o">=</span> <span class="kc">None</span>

<span class="c1"># Reproject</span>
<span class="n">param</span> <span class="o">=</span> <span class="n">gdal</span><span class="o">.</span><span class="n">WarpOptions</span><span class="p">(</span>
<span class="n">warpOptions</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;overwrite&quot;</span><span class="p">],</span>
<span class="n">srcSRS</span><span class="o">=</span><span class="s2">&quot;EPSG:4326&quot;</span><span class="p">,</span>
<span class="n">dstSRS</span><span class="o">=</span><span class="n">proj</span><span class="p">,</span>
<span class="n">outputBounds</span><span class="o">=</span><span class="n">extent</span><span class="p">,</span>
<span class="n">targetAlignedPixels</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">resampleAlg</span><span class="o">=</span><span class="n">gdal</span><span class="o">.</span><span class="n">GRA_NearestNeighbour</span><span class="p">,</span>
<span class="n">xRes</span><span class="o">=</span><span class="mi">30</span><span class="p">,</span>
<span class="n">yRes</span><span class="o">=</span><span class="mi">30</span><span class="p">,</span>
<span class="n">creationOptions</span><span class="o">=</span><span class="n">copts</span><span class="p">,</span>
<span class="n">callback</span><span class="o">=</span><span class="n">cback</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">gdal</span><span class="o">.</span><span class="n">Warp</span><span class="p">(</span><span class="s2">&quot;forest_src.tif&quot;</span><span class="p">,</span> <span class="s2">&quot;forest.vrt&quot;</span><span class="p">,</span> <span class="n">options</span><span class="o">=</span><span class="n">param</span><span class="p">)</span>
<span class="c1"># Only execute the following if forest_src.tif is absent</span>
<span class="c1"># Useful to use user&#39;s fcc data</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isfile</span><span class="p">(</span><span class="s2">&quot;forest_src.tif&quot;</span><span class="p">):</span>
<span class="c1"># Make vrt</span>
<span class="n">tif_forest_files</span> <span class="o">=</span> <span class="n">glob</span><span class="p">(</span><span class="s2">&quot;forest_tiles/forest_*.tif&quot;</span><span class="p">)</span>
<span class="n">forest_vrt</span> <span class="o">=</span> <span class="n">gdal</span><span class="o">.</span><span class="n">BuildVRT</span><span class="p">(</span>
<span class="s2">&quot;forest.vrt&quot;</span><span class="p">,</span>
<span class="n">tif_forest_files</span><span class="p">,</span>
<span class="n">callback</span><span class="o">=</span><span class="n">cback</span><span class="p">)</span>
<span class="c1"># Flush cache</span>
<span class="n">forest_vrt</span><span class="o">.</span><span class="n">FlushCache</span><span class="p">()</span>
<span class="n">forest_vrt</span> <span class="o">=</span> <span class="kc">None</span>

<span class="c1"># Reproject</span>
<span class="n">param</span> <span class="o">=</span> <span class="n">gdal</span><span class="o">.</span><span class="n">WarpOptions</span><span class="p">(</span>
<span class="n">warpOptions</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;overwrite&quot;</span><span class="p">],</span>
<span class="n">srcSRS</span><span class="o">=</span><span class="s2">&quot;EPSG:4326&quot;</span><span class="p">,</span>
<span class="n">dstSRS</span><span class="o">=</span><span class="n">proj</span><span class="p">,</span>
<span class="n">outputBounds</span><span class="o">=</span><span class="n">extent</span><span class="p">,</span>
<span class="n">targetAlignedPixels</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">resampleAlg</span><span class="o">=</span><span class="n">gdal</span><span class="o">.</span><span class="n">GRA_NearestNeighbour</span><span class="p">,</span>
<span class="n">xRes</span><span class="o">=</span><span class="mi">30</span><span class="p">,</span>
<span class="n">yRes</span><span class="o">=</span><span class="mi">30</span><span class="p">,</span>
<span class="n">creationOptions</span><span class="o">=</span><span class="n">copts</span><span class="p">,</span>
<span class="n">callback</span><span class="o">=</span><span class="n">cback</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">gdal</span><span class="o">.</span><span class="n">Warp</span><span class="p">(</span><span class="s2">&quot;forest_src.tif&quot;</span><span class="p">,</span> <span class="s2">&quot;forest.vrt&quot;</span><span class="p">,</span> <span class="n">options</span><span class="o">=</span><span class="n">param</span><span class="p">)</span>

<span class="c1"># Number of bands (or years)</span>
<span class="k">with</span> <span class="n">gdal</span><span class="o">.</span><span class="n">Open</span><span class="p">(</span><span class="s2">&quot;forest_src.tif&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">ds</span><span class="p">:</span>
Expand Down Expand Up @@ -293,7 +297,7 @@ <h1>Source code for forestatrisk.data.compute.compute_forest</h1><div class="hig
&#169;2024, Cirad.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.4.5</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

</div>
Expand Down
4 changes: 2 additions & 2 deletions _modules/forestatrisk/data/compute/compute_gadm.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="../../../../index.html">
Expand Down Expand Up @@ -195,7 +195,7 @@ <h1>Source code for forestatrisk.data.compute.compute_gadm</h1><div class="highl
&#169;2024, Cirad.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.4.5</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

</div>
Expand Down
4 changes: 2 additions & 2 deletions _modules/forestatrisk/data/compute/compute_osm.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="../../../../index.html">
Expand Down Expand Up @@ -244,7 +244,7 @@ <h1>Source code for forestatrisk.data.compute.compute_osm</h1><div class="highli
&#169;2024, Cirad.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.4.5</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

</div>
Expand Down
4 changes: 2 additions & 2 deletions _modules/forestatrisk/data/compute/compute_srtm.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="../../../../index.html">
Expand Down Expand Up @@ -185,7 +185,7 @@ <h1>Source code for forestatrisk.data.compute.compute_srtm</h1><div class="highl
&#169;2024, Cirad.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.4.5</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

</div>
Expand Down
4 changes: 2 additions & 2 deletions _modules/forestatrisk/data/compute/compute_wdpa.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="../../../../index.html">
Expand Down Expand Up @@ -186,7 +186,7 @@ <h1>Source code for forestatrisk.data.compute.compute_wdpa</h1><div class="highl
&#169;2024, Cirad.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.4.5</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

</div>
Expand Down
4 changes: 2 additions & 2 deletions _modules/forestatrisk/data/compute/mosaic_biomass_whrc.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="../../../../index.html">
Expand Down Expand Up @@ -173,7 +173,7 @@ <h1>Source code for forestatrisk.data.compute.mosaic_biomass_whrc</h1><div class
&#169;2024, Cirad.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.4.5</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

</div>
Expand Down
4 changes: 2 additions & 2 deletions _modules/forestatrisk/data/country_compute.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="../../../index.html">
Expand Down Expand Up @@ -228,7 +228,7 @@ <h1>Source code for forestatrisk.data.country_compute</h1><div class="highlight"
&#169;2024, Cirad.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.4.5</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

</div>
Expand Down
4 changes: 2 additions & 2 deletions _modules/forestatrisk/data/country_download.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="../../../index.html">
Expand Down Expand Up @@ -213,7 +213,7 @@ <h1>Source code for forestatrisk.data.country_download</h1><div class="highlight
&#169;2024, Cirad.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.4.5</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

</div>
Expand Down
4 changes: 2 additions & 2 deletions _modules/forestatrisk/data/download/download_gadm.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="../../../../index.html">
Expand Down Expand Up @@ -142,7 +142,7 @@ <h1>Source code for forestatrisk.data.download.download_gadm</h1><div class="hig
&#169;2024, Cirad.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.4.5</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

</div>
Expand Down
4 changes: 2 additions & 2 deletions _modules/forestatrisk/data/download/download_osm.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="../../../../index.html">
Expand Down Expand Up @@ -196,7 +196,7 @@ <h1>Source code for forestatrisk.data.download.download_osm</h1><div class="high
&#169;2024, Cirad.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.4.5</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

</div>
Expand Down
4 changes: 2 additions & 2 deletions _modules/forestatrisk/data/download/download_srtm.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="../../../../index.html">
Expand Down Expand Up @@ -212,7 +212,7 @@ <h1>Source code for forestatrisk.data.download.download_srtm</h1><div class="hig
&#169;2024, Cirad.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.4.5</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

</div>
Expand Down
4 changes: 2 additions & 2 deletions _modules/forestatrisk/data/download/download_wdpa.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="../../../../index.html">
Expand Down Expand Up @@ -150,7 +150,7 @@ <h1>Source code for forestatrisk.data.download.download_wdpa</h1><div class="hig
&#169;2024, Cirad.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.4.5</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

</div>
Expand Down
4 changes: 2 additions & 2 deletions _modules/forestatrisk/data/get_vector_extent.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="../../../index.html">
Expand Down Expand Up @@ -169,7 +169,7 @@ <h1>Source code for forestatrisk.data.get_vector_extent</h1><div class="highligh
&#169;2024, Cirad.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.4.5</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

</div>
Expand Down
4 changes: 2 additions & 2 deletions _modules/forestatrisk/data/sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</head><body>
<div class="document">

<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="../../../index.html">
Expand Down Expand Up @@ -466,7 +466,7 @@ <h1>Source code for forestatrisk.data.sample</h1><div class="highlight"><pre>
&#169;2024, Cirad.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.3.7</a>
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 7.4.5</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>

</div>
Expand Down
Loading

0 comments on commit 2bcc55f

Please sign in to comment.