[gdal-dev] Driver registering in Python required?

Frank Warmerdam warmerdam at pobox.com
Thu May 6 09:27:25 EDT 2010

K.-Michael Aye wrote:
> Dear all,
> is registering of drivers still (or at all) required in Python?
> In the API tutorial i see:
> import gdal
> from gdalconst import *
> dataset = gdal.Open( filename, GA_ReadOnly )
> if dataset is None:
>        ...
> I am just puzzled because the first sentence of the tutorial states it's 
> required, and then nothing like that can be seen in Python. The 
> gdalconst import * can't have anything to do with it , can it?
> I do opening of images for reading currently successfully, but was 
> wondering if i was just lucky and something could go wrong.


Python automatically calls GDALAllRegister() when the gdal module is
imported so it is not needed in the python case. I have updated the
tutorial to reflect this.

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    | Geospatial Programmer for Rent

More information about the gdal-dev mailing list