Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Gonzalo Mateo Garcia committed Nov 13, 2024
1 parent efbbbb4 commit 3bc57fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions advanced/error_read_write_in_remote_path/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -971,12 +971,10 @@ <h1 id="reading-from-remote-location-gdal-vsil-caching-issue">Reading from remot

<span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">&quot;AZURE_STORAGE_CONNECTION_STRING&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;????&quot;</span>
<span class="n">fs</span> <span class="o">=</span> <span class="n">fsspec</span><span class="o">.</span><span class="n">filesystem</span><span class="p">(</span><span class="s2">&quot;az&quot;</span><span class="p">)</span>
<span class="n">fs</span>
</code></pre></div>
<div class="highlight"><pre><span></span><code>&lt;adlfs.spec.AzureBlobFileSystem at 0x7fdf4429a020&gt;
</code></pre></div>
<p>This example will read a 3-band rgb COG and modify it by a one band COG with a different shape. We will see that when the COG is modified we can't read the file again if we don't set the <code>read_with_CPL_VSIL_CURL_NON_CACHED</code> option. We will see either a read error (if we haven't loaded the data) or we will see the old cached data (if we have load the data).</p>
<div class="highlight"><pre><span></span><code><span class="c1"># rasterio_reader.RIO_ENV_OPTIONS_DEFAULT[&quot;CPL_CURL_VERBOSE&quot;] = &quot;YES&quot;</span>
<div class="highlight"><pre><span></span><code><span class="c1"># Set up the files</span>
<span class="c1"># rasterio_reader.RIO_ENV_OPTIONS_DEFAULT[&quot;CPL_CURL_VERBOSE&quot;] = &quot;YES&quot;</span>
<span class="n">rgb_file</span> <span class="o">=</span> <span class="s2">&quot;az://mycontainer/rgb.tif&quot;</span>
<span class="n">one_band_file</span> <span class="o">=</span> <span class="s2">&quot;az://mycontainer/one_band.tif&quot;</span>
<span class="k">assert</span> <span class="n">fs</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">rgb_file</span><span class="p">)</span>
Expand Down Expand Up @@ -1168,7 +1166,7 @@ <h1 id="reading-from-remote-location-gdal-vsil-caching-issue">Reading from remot
</code></pre></div>
<div class="highlight"><pre><span></span><code><span class="n">fs</span><span class="o">.</span><span class="n">delete</span><span class="p">(</span><span class="n">filepath</span><span class="p">)</span>
</code></pre></div>
<p>If we don't load the data we don't have the error and the file is correctly readed:</p>
<p>If we don't load the data we don't have the error and the file is correctly readed too:</p>
<div class="highlight"><pre><span></span><code><span class="n">filepath</span> <span class="o">=</span> <span class="s2">&quot;az://mycontainer/removeme3.tif&quot;</span>
<span class="k">if</span> <span class="n">fs</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">filepath</span><span class="p">):</span>
<span class="n">fs</span><span class="o">.</span><span class="n">delete</span><span class="p">(</span><span class="n">filepath</span><span class="p">)</span>
Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

0 comments on commit 3bc57fb

Please sign in to comment.