MEM -- In Memory Raster

GDAL supports the ability to hold rasters in a temporary in-memory format. This is primarily useful for temporary datasets in scripts or internal to applications. It is not generally of any use to application end-users.

Memory datasets should support for most kinds of auxiliary information including metadata, coordinate systems, georeferencing, GCPs, color interpretation, nodata, color tables and all pixel data types.

Dataset Name Format

It is possible to open an existing array in memory. To do so, construct a dataset name with the following format:
  MEM:::option=value[,option=value...]
For example:
  MEM:::DATAPOINTER=342343408,PIXELS=100,LINES=100,BANDS=3,DATATYPE=Byte,
       PIXELOFFSET=3,LINEOFFSET=300,BANDOFFSET=1
or
  MEM:::DATAPOINTER=0x1467BEF0,PIXELS=100,LINES=100,BANDS=3,DATATYPE=Byte,
       PIXELOFFSET=3,LINEOFFSET=300,BANDOFFSET=1

Creation Options

There are no supported creation options.

The MEM format is one of the few that supports the AddBand() method. The AddBand() method supports DATAPOINTER, PIXELOFFSET and LINEOFFSET options to reference an existing memory array.