On jeudi 10 décembre 2020 19:06:35 CET Alex Riggs wrote:
> Hello all,
> 
> First for some background. I have a service which receives protobuf
> messages, each message contains a bytes-encoded netcdf file. Currently, I
> write the netcdf to a temporary, on-disk file, which I then open with
> gdal.Open() to do some stuff to. Based on what I could discern, both the
> Open and OpenEx expect a string representing a file except in the case of
> "exotic drivers".
> 
> My hope is to eliminate the need for that temporary file and instead read
> the bytes string directly. Is this possible?

If you're on Linux, then you could write the buffer in a /vsimem/ file 
(gdal.FileFromMemBuffer('/vsimem/foo.nc', blob) ), and use the netCDF driver 
on that file.

Actually we could likely remove the Linux-only restriction for the particular 
case of /vsimem/ files but this isn't implemented currently in the driver.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to