I don't have any answers (yet) from from previous question on GDAL memory raster + OpenLayers, so i'll try to ask an easier question :)

Anyone knows how to access GDAL memory with command lines when using the -of MEM output ? As ex, after this command :

gdaldem color-relief -of MEM -alpha C:\tmp\myImg.tiff C:\tmp\myLgd.txt myMemOuput
  • 1
    That won't work the way you would like. The in memory dataset lives as long as the process (gdaldem) does, then is released. The GDAL VSI mechanism handles this, and if you were programming, you would be able to open the dataset using: ds = GDALOpen("/vsimem/path/to/mImg.tiff", GA_ReadOnly); or a similar command.
    – user10353
    Commented Jan 20, 2016 at 15:53
  • Before this gdaldem command, I use gdal_grid and gdalwarp to process PostGis data into raster. The gdaldem produces the final image (currently as PNG) that is used by a map (OpenLayers). Since this produces a lot of images, with PHP script, that's why I was trying to use MEM. I'll have a look on the VSI !
    – gvatin
    Commented Jan 20, 2016 at 17:00

1 Answer 1


how to access GDAL memory with command lines when using the -of MEM output

The GDAL MEM driver documentation at https://gdal.org/drivers/raster/mem.html clearly states:

This is primarily useful for temporary datasets in scripts or internal to applications. It is not generally of any use to application end-users.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.