[FWTools] Opening ENVI file in python using FWTools 2.10

Jeff Ruby jgr007 at gmail.com
Tue Mar 4 08:45:18 EST 2008


Thanks much, Frank.  I did a little more investigating.  It looks like my
issue may have been introduced with FWTools 2.1.0.  I tried three different
combinations:

1 - myfile, myfile.hdr
2 - myfile.envi.dat, myfile.envi.hdr
3 - myfile.envi, myfile.envi.hdr

gdalinfo and gdal.Open() work fine for all three combinations on my machine
(WindowsXP 32-bit) with FWTools 2.0.6.

With FWTools 2.1.0:
- The first two combinations both work with gdalinfo and gdal.Open()
- The third one does not seem to work with gdalinfo or gdal.Open()

Regards,
-Jeff

On Tue, Mar 4, 2008 at 7:09 AM, Frank Warmerdam <warmerdam at pobox.com> wrote:

> Jeff Ruby wrote:
> > 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?
>
> Jeff,
>
> I tried renaming the .dat file from an envi fileset to .envi and did a
> gdalinfo
> on the .envi file and it worked fine for me.  I also tried opening it with
> a
> python script.  So, I'm not sure why you are running into problems.
>
> Best regards,
> --
>
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam,
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam<http://pobox.com/%7Ewarmerdam>
> and watch the world go round - Rush    | President OSGeo, http://osgeo.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/fwtools/attachments/20080304/5ff1c118/attachment.html


More information about the FWTools mailing list