[Gdal-dev] input format

Frank Warmerdam warmerdam at pobox.com
Mon Nov 20 20:29:07 EST 2006


Matt Hanson wrote:
> I apologize for bringing up an issue that I know has been covered/answered
> before, I just can't remember what the answer was!  (and there's no
> web-based search for the list archives).
> 
> How does GDAL decide which format to use to open a file?   In some cases
> there might be multiple methods: such as a raw binary file but also an ENVI
> header file.  Or in our case, we have an ENVI style aux file, but an ENVI
> header may also be present.    I suspect it runs through the list of formats
> and opens it with the first one that works.

Matt,

Drivers are tried in the order they are registered.

 > Assuming this is so, how can I
> force opening a file with a specific format?

Currently the only way is to unregister all drivers from the driver manager
except the one you want to use (or only register the desired driver on
startup).

> In the case of ENVI files (and similar formats that use secondary files) it
> seems that it would make more sense to allow the user to open the hdr file
> rather then the binary file, because while the binary file format could be
> ambiguous, the hdr file would not be.

Perhaps.   But changing something like this would cause a lot of disruption
to existing users.

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
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list