<div dir="ltr">Thank you Jukka, it helps in command line.<div>Now I need to investigate why the same but using C API fails.</div><div>The issue scenario is:</div><div><ol><li>I set <b>GDAL_HTTP_USERPWD</b> using <b>CPLSetConfigOption</b></li><li>I connect to the service as dataset (<b>GDALOpen</b>)</li><li>I get the first subdataset (<b>GDALOpen</b>) and download data using <b>GdalRasterIO</b></li><li>I connect to the second subdataset and when I got handle to it,
<b>GDAL_HTTP_USERPWD env variable is cleared!</b></li><li>So GdalRasterIO fails because of lack the credentials...</li></ol><div>Strange... 🤷</div></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">wt., 17 gru 2024 o 20:07 Rahkonen Jukka <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi">jukka.rahkonen@maanmittauslaitos.fi</a>> napisał(a):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg5694999521724218925">
<div lang="FI" style="overflow-wrap: break-word;">
<div class="m_7550996883760296379WordSection1">
<p class="MsoNormal"><span>Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>Have you tried<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><b><i><span lang="EN-US">set GDAL_HTTP_USERPWD=user:pass</span></i></b><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">-Jukka Rahkonen-<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> gdal-dev <<a href="mailto:gdal-dev-bounces@lists.osgeo.org" target="_blank">gdal-dev-bounces@lists.osgeo.org</a>>
<b>Puolesta </b>Michal Kowalczuk via gdal-dev<br>
<b>Lähetetty:</b> tiistai 17. joulukuuta 2024 19.49<br>
<b>Vastaanottaja:</b> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<b>Aihe:</b> [gdal-dev] GDAL CONFIG<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Dear GDAL colleagues,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">do you have any idea why the first method fails:<u></u><u></u></p>
<div>
<p class="MsoNormal"><b><i>set GDAL_HTTP_USERPWD="user:pass"</i></b><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><i>gdal_translate -srcwin 0 0 1073696614, 1073741824 -outsize 512 512 "WMS:<a href="https://maps.lantmateriet.se/topowebb/wms/v1?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=topowebbkartan&SRS=epsg:3006&BBOX=-1.19998e+06,4.69998e+06,2.59988e+06,8.5e+06" target="_blank">https://maps.lantmateriet.se/topowebb/wms/v1?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=topowebbkartan&SRS=epsg:3006&BBOX=-1.19998e+06,4.69998e+06,2.59988e+06,8.5e+06</a>"
tile1.png</i><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">but the second works?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><i>gdal_translate -srcwin 0 0 1073696614, 1073741824 -outsize 512 512 "WMS:<a href="https://maps.lantmateriet.se/topowebb/wms/v1?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=topowebbkartan&SRS=epsg:3006&BBOX=-1.19998e+06,4.69998e+06,2.59988e+06,8.5e+06" target="_blank">https://maps.lantmateriet.se/topowebb/wms/v1?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=topowebbkartan&SRS=epsg:3006&BBOX=-1.19998e+06,4.69998e+06,2.59988e+06,8.5e+06</a>"
tile1.png <b>--config GDAL_HTTP_USERPWD "user:pass"</b></i><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">(windows, GDAL 3.9.2, anaconda prompt)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Regards,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Michał Kowalczuk<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div></blockquote></div>