[gdal-dev] Hi: GDAL CONFIG

Michał Kowalczuk michkowalczuk at gmail.com
Wed Dec 18 02:05:58 PST 2024


Thank you Jukka, it helps in command line.
Now I need to investigate why the same but using C API fails.
The issue scenario is:

   1. I set *GDAL_HTTP_USERPWD* using *CPLSetConfigOption*
   2. I connect to the service as dataset (*GDALOpen*)
   3. I get the first subdataset (*GDALOpen*) and download data using
   *GdalRasterIO*
   4. I connect to the second subdataset and when I got handle to it,
*GDAL_HTTP_USERPWD
   env variable is cleared!*
   5. So GdalRasterIO fails because of lack the credentials...

Strange... 🤷

wt., 17 gru 2024 o 20:07 Rahkonen Jukka <jukka.rahkonen at maanmittauslaitos.fi>
napisał(a):

> Hi,
>
>
>
> Have you tried
>
>
>
> *set GDAL_HTTP_USERPWD=user:pass*
>
>
>
> -Jukka Rahkonen-
>
>
>
> *Lähettäjä:* gdal-dev <gdal-dev-bounces at lists.osgeo.org> *Puolesta *Michal
> Kowalczuk via gdal-dev
> *Lähetetty:* tiistai 17. joulukuuta 2024 19.49
> *Vastaanottaja:* gdal-dev at lists.osgeo.org
> *Aihe:* [gdal-dev] GDAL CONFIG
>
>
>
> Dear GDAL colleagues,
>
>
>
> do you have any idea why the first method fails:
>
> *set GDAL_HTTP_USERPWD="user:pass"*
>
> *gdal_translate -srcwin 0 0 1073696614, 1073741824 -outsize 512 512
> "WMS: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
> <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>"
> tile1.png*
>
>
>
> but the second works?
>
> *gdal_translate -srcwin 0 0 1073696614, 1073741824 -outsize 512 512
> "WMS: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
> <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>"
> tile1.png --config GDAL_HTTP_USERPWD "user:pass"*
>
>
>
> (windows, GDAL 3.9.2, anaconda prompt)
>
>
>
> Regards,
>
> Michał Kowalczuk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20241218/f9a8f8f8/attachment.htm>


More information about the gdal-dev mailing list