<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>You also need to specify: --config AWS_REQUEST_PAYER requester<br>
    </p>
    <div class="moz-cite-prefix">Le 07/07/2023 à 03:37, Bang Pham Huu a
      écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:19e68f4c-e4cb-84a6-eb0b-f556e8ed1a04@jacobs-university.de">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <p>Hello,</p>
      <p>GDAL 3.4.1, released 2021/12/27 (Ubuntu 22.04)<br>
      </p>
      <p>I have this file ~/.aws/credentials  (configured by this
        command: aws configure)</p>
      <p>[default]<br>
        aws_access_key_id = AKIAY.....<br>
        aws_secret_access_key = qc2KcpImI/....</p>
      <p>This works fine for aws CLI command to download a Landsat-8
        tiff file:</p>
      <p>aws s3 cp --request-payer requester
s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2023/233/245/LC08_L2SP_233245_20230510_20230518_02_T2/LC08_L2SP_233245_20230510_20230518_02_T2_SR_B1.TIF
        .</p>
      <p>But gdal cannot read the file?</p>
      <p>gdalinfo
/vsis3/usgs-landsat/collection02/level-2/standard/oli-tirs/2023/233/245/LC08_L2SP_233245_20230510_20230518_02_T2/LC08_L2SP_233245_20230510_20230518_02_T2_SR_B1.TIF<br>
        Warning 1: HTTP response code on
        <a class="moz-txt-link-freetext"
href="https://usgs-landsat.s3.amazonaws.com/collection02/level-2/standard/oli-tirs/2023/233/245/LC08_L2SP_233245_20230510_20230518_02_T2/LC08_L2SP_233245_20230510_20230518_02_T2_SR_B1.TIF"
          moz-do-not-send="true">https://usgs-landsat.s3.amazonaws.com/collection02/level-2/standard/oli-tirs/2023/233/245/LC08_L2SP_233245_20230510_20230518_02_T2/LC08_L2SP_233245_20230510_20230518_02_T2_SR_B1.TIF</a>:
        403</p>
      <p>On <a class="moz-txt-link-freetext"
          href="https://gdal.org/user/virtual_file_systems.html"
          moz-do-not-send="true">https://gdal.org/user/virtual_file_systems.html</a>,
        it says:</p>
      <p><span style="color: rgb(64, 64, 64); font-family: Lato,
          proxima-nova, "Helvetica Neue", Arial, sans-serif;
          font-size: 16px; font-style: normal; font-variant-ligatures:
          normal; font-variant-caps: normal; font-weight: 400;
          letter-spacing: normal; orphans: 2; text-align: left;
          text-indent: 0px; text-transform: none; white-space: normal;
          widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
          background-color: rgb(252, 252, 252);
          text-decoration-thickness: initial; text-decoration-style:
          initial; text-decoration-color: initial; display: inline
          !important; float: none;">Starting with GDAL 2.3, alternate
          ways of providing credentials similar to what the "aws"
          command line utility or Boto3 support can be used. If the
          above mentioned environment variables are not provided, the<span> </span></span><code
          class="docutils literal notranslate" style="box-sizing:
          border-box; font-family: "Source Code Pro",
          Consolas, "Courier New", monospace; font-size:
          14.4px; white-space: normal; max-width: 100%; background:
          rgb(255, 255, 255); border: 1px solid rgb(225, 228, 229);
          padding: 2px 5px; color: black; overflow-x: auto; font-style:
          normal; font-variant-ligatures: normal; font-variant-caps:
          normal; font-weight: 400; letter-spacing: normal; orphans: 2;
          text-align: left; text-indent: 0px; text-transform: none;
          widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
          text-decoration-thickness: initial; text-decoration-style:
          initial; text-decoration-color: initial;"><span class="pre"
            style="box-sizing: border-box;">~/.aws/credentials</span></code></p>
      <p><code class="docutils literal notranslate" style="box-sizing:
          border-box; font-family: "Source Code Pro",
          Consolas, "Courier New", monospace; font-size:
          14.4px; white-space: normal; max-width: 100%; background:
          rgb(255, 255, 255); border: 1px solid rgb(225, 228, 229);
          padding: 2px 5px; color: black; overflow-x: auto; font-style:
          normal; font-variant-ligatures: normal; font-variant-caps:
          normal; font-weight: 400; letter-spacing: normal; orphans: 2;
          text-align: left; text-indent: 0px; text-transform: none;
          widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
          text-decoration-thickness: initial; text-decoration-style:
          initial; text-decoration-color: initial;"><span class="pre"
            style="box-sizing: border-box;"><br>
          </span></code></p>
      <p><code class="docutils literal notranslate" style="box-sizing:
          border-box; font-family: "Source Code Pro",
          Consolas, "Courier New", monospace; font-size:
          14.4px; white-space: normal; max-width: 100%; background:
          rgb(255, 255, 255); border: 1px solid rgb(225, 228, 229);
          padding: 2px 5px; color: black; overflow-x: auto; font-style:
          normal; font-variant-ligatures: normal; font-variant-caps:
          normal; font-weight: 400; letter-spacing: normal; orphans: 2;
          text-align: left; text-indent: 0px; text-transform: none;
          widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
          text-decoration-thickness: initial; text-decoration-style:
          initial; text-decoration-color: initial;"><span class="pre"
            style="box-sizing: border-box;">I even tried to set
            environmental variables, but it doesn't work either:</span></code></p>
      <p><code class="docutils literal notranslate" style="box-sizing:
          border-box; font-family: "Source Code Pro",
          Consolas, "Courier New", monospace; font-size:
          14.4px; white-space: normal; max-width: 100%; background:
          rgb(255, 255, 255); border: 1px solid rgb(225, 228, 229);
          padding: 2px 5px; color: black; overflow-x: auto; font-style:
          normal; font-variant-ligatures: normal; font-variant-caps:
          normal; font-weight: 400; letter-spacing: normal; orphans: 2;
          text-align: left; text-indent: 0px; text-transform: none;
          widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
          text-decoration-thickness: initial; text-decoration-style:
          initial; text-decoration-color: initial;"><span class="pre"
            style="box-sizing: border-box;">export
            AWS_ACCESS_KEY_ID=AKIAY5....<br>
            export AWS_SECRET_ACCESS_KEY=qc2KcpImI/....<br>
            gdalinfo
/vsis3/usgs-landsat/collection02/level-2/standard/oli-tirs/2023/233/245/LC08_L2SP_233245_20230510_20230518_02_T2/LC08_L2SP_233245_20230510_20230518_02_T2_SR_B1.TIF<br>
            Warning 1: HTTP response code on
            <a class="moz-txt-link-freetext"
href="https://usgs-landsat.s3.amazonaws.com/collection02/level-2/standard/oli-tirs/2023/233/245/LC08_L2SP_233245_20230510_20230518_02_T2/LC08_L2SP_233245_20230510_20230518_02_T2_SR_B1.TIF"
              moz-do-not-send="true">https://usgs-landsat.s3.amazonaws.com/collection02/level-2/standard/oli-tirs/2023/233/245/LC08_L2SP_233245_20230510_20230518_02_T2/LC08_L2SP_233245_20230510_20230518_02_T2_SR_B1.TIF</a>:
            403<br>
            ERROR 14: Access Denied<br>
            gdalinfo failed - unable to open
'/vsis3/usgs-landsat/collection02/level-2/standard/oli-tirs/2023/233/245/LC08_L2SP_233245_20230510_20230518_02_T2/LC08_L2SP_233245_20230510_20230518_02_T2_SR_B1.TIF'.<br>
            <br>
          </span></code></p>
      <p>Thanks,<br>
      </p>
      <p><br>
      </p>
      <p><br>
      </p>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
  </body>
</html>