Even, thanks for this. I'll proceed by copying the byte array to a temp file.<div><br></div><div>Best,</div><div>Sam<br><br><div class="gmail_quote">On Mon, Jan 24, 2011 at 3:54 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Sam,<br>
<br>
not all drivers support the vsi virtual file systems, such as /vsimem. And HDF4<br>
is one of those drivers (the HDF4 libs need a "real" filename). You can<br>
generally check if a file system supports vsi virtual file systems by issuing<br>
"gdalinfo --format name_of_driver"<br>
<br>
For a compatible driver (such as VRT, but not HDF4), you'll see :<br>
Supports: Virtual IO - eg. /vsimem/<br>
<div><div></div><div class="h5"><br>
> Hey all,<br>
><br>
> I'm working on an app that needs to pass HDF4 files (MODIS tiles) around as<br>
> byte arrays, and then open them up using gdal#Open, from java. Open works<br>
> great when I pass in the filepath, so I know that my gdal setup is solid.<br>
><br>
> The problem is, when I turn the HDF4 file into a byte array and try to use<br>
><br>
> gdal.FileFromMemBuffer("/vsimem/test.hdf", bytearray);<br>
> DataSet data = gdal.Open("/vsimem/test.hdf");<br>
><br>
> I get an error that reads: "`/vsimem/test.hdf' not recognised as a<br>
> supported file format."<br>
><br>
> I tried something similar, by converting<br>
><br>
> <VRTDataset rasterXSize=\"1\" rasterYSize=\"1\"><br>
> <GeoTransform>100,1,0,100,0,-1</GeoTransform><br>
> <VRTRasterBand dataType=\"Byte\" band=\"1\"><br>
> </VRTRasterBand><br>
> </VRTDataset><br>
><br>
> to a byte array and reading it in, and that worked great.<br>
><br>
> Any ideas on how to deal with this issue? I'll note that open SEES the file<br>
> in the /vsimem/ directory, it just doesn't recognize it as a valid file. Is<br>
> this an issue with HDF4 files, or with large binary sequences? Any ideas on<br>
> how to get around this?<br>
><br>
> Thanks, all,<br>
> Sam<br>
</div></div></blockquote></div><br></div>