[FWTools] Opening ENVI file in python using FWTools 2.10

Jeff Ruby jgr007 at gmail.com
Mon Mar 3 14:14:35 EST 2008


Hi,

I'm using FWTools 2.10 on Windows.  I'm trying to access an ENVI file
through Python.  I have two files:  my_file.envi and my_file.envi.hdr

Here's a code snippet:

if __name__ == '__main__':

    input_file = "my_file.envi"
    gdal.AllRegister()
    argv = gdal.GeneralCmdLineProcessor( sys.argv )

    dataset = gdal.Open(input_file, GA_ReadOnly)


When I do this I get a message saying "my_file.envi" is not a supported file
format.  If I try to use "my_file.envi.hdr" I get a message telling me to
use "my_file.envi"  If I strip off the .envi everything works fine.  Is
there a way to make gdal.Open() work correctly with the .envi in the
filenames?

Thanks much,
-Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/fwtools/attachments/20080303/ac55e1e2/attachment.html


More information about the FWTools mailing list