[gdal-dev] Can GDAL open binary buffer contents as input for MEM format?

2010-01-16 Thread Roger André
Hi All, I'd like to know if I can take the results of a MapServer Python mapscript 'mapImage.getBytes()' operation, and feed it into GDAL as a data source for an in-memory raster? The MapServer docs state that the results of 'getBytes' in Python is a string of binary data. I'm not sure if GDAL

Re: [gdal-dev] Can GDAL open binary buffer contents as input for MEM format?

2010-01-16 Thread Frank Warmerdam
Roger André wrote: Hi All, I'd like to know if I can take the results of a MapServer Python mapscript 'mapImage.getBytes()' operation, and feed it into GDAL as a data source for an in-memory raster? The MapServer docs state that the results of 'getBytes' in Python is a string of binary

Re: [gdal-dev] Can GDAL open binary buffer contents as input for MEM format?

2010-01-16 Thread Roger André
Hi Frank, Thanks for the example. How can I specify alpha in that, for one of the quantized 8-bit PNG's (with alpha) that MapServer produces? They look like this: Metadata: Software=UMN Mapserver Corner Coordinates: Upper Left (0.0,0.0) Lower Left (0.0, 256.0) Upper Right (

Re: [gdal-dev] Can GDAL open binary buffer contents as input for MEM format?

2010-01-16 Thread Frank Warmerdam
Roger André wrote: Hi Frank, Thanks for the example. How can I specify alpha in that, for one of the quantized 8-bit PNG's (with alpha) that MapServer produces? Roger, In a way this is simplier. It is just a one band GDT_Byte file, so more like the first example I gave. The palette can

Re: [gdal-dev] Can GDAL open binary buffer contents as input for MEM format?

2010-01-16 Thread Roger André
Hi Frank, Ok, that makes sense. So for this to work, I will have to know (somehow) what type of image mapserver is sending, and then instantiate a MEM dataset with the correct parameters. Problem with that is that I can't think of a good way to read what those parameters are out of the binary

Re: [gdal-dev] Can GDAL open binary buffer contents as input for MEM format?

2010-01-16 Thread Frank Warmerdam
Roger André wrote: Hi Frank, Ok, that makes sense. So for this to work, I will have to know (somehow) what type of image mapserver is sending, and then instantiate a MEM dataset with the correct parameters. Problem with that is that I can't think of a good way to read what those parameters