[gdal-dev] gdal.open fails from C#

Paul Harwood runette at gmail.com
Wed Apr 21 02:58:52 PDT 2021


If I parse your email correctly:

- You CAN open that uri in the gdalinfo bash command
- you CANNOT open it in Python
- You CANNOT open it in c#

Is this correct?

That, together with your trace that suggests that the C# bindings (and
therefore presumably also the Python bindings) are doing their job and GDAL
is opening the correct URI - and getting the first 16k chunk back - but
there is a timeout.

have you tried increasing the 16k chunk size to see if that is related to
the problem - I think that is this :

Partial downloads (requires the HTTP server to support random reading)
are done with a 16 KB granularity by default. Starting with GDAL 2.3,
the chunk size can be configured with the CPL_VSIL_CURL_CHUNK_SIZE
configuration option, with a value in bytes. If the driver detects
sequential reading it will progressively increase the chunk size up to
2 MB to improve download performance. Starting with GDAL 2.3, the
GDAL_INGESTED_BYTES_AT_OPEN configuration option can be set to impose
the number of bytes read in one GET call at file opening (can help
performance to read Cloud optimized geotiff with a large header).
>
>
from https://gdal.org/user/virtual_file_systems.html

I would ask the wider community if the GDAL_HTTP_TIMEOUT option is real and
current - it is only mentioned in the older documentation and not the
current documentation.

On Wed, 21 Apr 2021 at 06:04, Jeannie May <jeannie_may at trimble.com> wrote:

> We're unable to get this working from our c# code on the EC2 instance. It
> appears to be an issue related to c# and curl. Attached is a sample c# and
> log:
>
> The open works fine from our container using bash, but not python. It's a
> real mixed bag. BTW Its linux and using an IAM role.
>
>
>
>
>
>
> --
> *Jeannie May*
> Senior Software Engineer
> 11 Birmingham Drive, Christchurch | 963 5305 Office
> www.trimble.com
>
> Connect with us!
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210421/ed0e4cc9/attachment.html>


More information about the gdal-dev mailing list