[gdal-dev] Can GDAL read a GTiff from a memory buffer?

Even Rouault even.rouault at mines-paris.org
Thu May 1 11:54:52 PDT 2014


Le jeudi 01 mai 2014 20:34:51, Robert Nix a écrit :
> Hi,
> 
> I have a situation where i get a geotiff across the network. I don't want
> to have to save it to a file and reopen it to load it into numpy. Is this
> possible with GDAL? Doesn't have to be supported in Python. I can call into
> C/C++ if needed.

Several possible ways :

- This will download the whole file in memory before opening it :
gdalinfo http://path/to/the.tif

- This will download parts of the file when needed (if the server supports 
range downloading) :
gdalinfo /vsicurl/http://path/to/the.tif

- Download the data with the way you prefer in the_buffer
  Use gdal.FileFromMemBuffer("/vsimem/tmp.tif", the_buffer)
  gdal.Open("/vsimem/tmp.tif")
  gdal.Unlink("/vsimem/tmp.tif")


> 
> Thanks

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the gdal-dev mailing list