Skip to content

Commit

Permalink
Deploying to gh-pages from @ 8451b9d 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainv committed Jun 14, 2024
1 parent 4fba264 commit 50f673e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions _modules/geefcc/sum_raster_bands.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ <h1>Source code for geefcc.sum_raster_bands</h1><div class="highlight"><pre>
<span class="sd">See: https://github.com/mstrimas/gdal-summarize/blob/master/gdal-summarize.py</span>
<span class="sd">&quot;&quot;&quot;</span>

<span class="kn">import</span> <span class="nn">os</span>

<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">from</span> <span class="nn">osgeo</span> <span class="kn">import</span> <span class="n">gdal</span>

Expand Down Expand Up @@ -137,6 +139,8 @@ <h1>Source code for geefcc.sum_raster_bands</h1><div class="highlight"><pre>

<span class="c1"># Create output raster file</span>
<span class="n">driver</span> <span class="o">=</span> <span class="n">gdal</span><span class="o">.</span><span class="n">GetDriverByName</span><span class="p">(</span><span class="s2">&quot;GTiff&quot;</span><span class="p">)</span>
<span class="k">if</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="n">output_file</span><span class="p">):</span>
<span class="n">os</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">output_file</span><span class="p">)</span>
<span class="n">ds_out</span> <span class="o">=</span> <span class="n">driver</span><span class="o">.</span><span class="n">Create</span><span class="p">(</span>
<span class="n">output_file</span><span class="p">,</span>
<span class="n">ncol</span><span class="p">,</span> <span class="n">nrow</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span>
Expand Down

0 comments on commit 50f673e

Please sign in to comment.