(self, filename)
return 1
Initialize file_info from filename

        filename -- Name of file to read.

        Returns 1 on success or 0 if the file can't be opened.
Initialize file_info from filename
Initialize file_info from filename
def init_from_name(self, filename):
        """
        Initialize file_info from filename

        filename -- Name of file to read.

        Returns 1 on success or 0 if the file can't be opened.
        """
        fh = gdal.Open( filename )
        if fh is None:
            return 0

        self.filename = filename
        self.bands = fh.RasterCount
        self.xsize = fh.RasterXSize
        self.ysize = fh.RasterYSize
        self.band_type = fh.GetRasterBand(1).DataType
        self.projection = fh.GetProjection()
        self.geotransform = fh.GetGeoTransform()
        self.ulx = self.geotransform[0]
        self.uly = self.geotransform[3]
        self.lrx = self.ulx + self.geotransform[1] * self.xsize
        self.lry = self.uly + self.geotransform[5] * self.ysize

        ct = fh.GetRasterBand(1).GetRasterColorTable()
        if ct is not None:
            self.ct = ct.Clone()
        else:
            self.ct = None

        return 1
def init_from_name ( self , filename ) : fh = gdal . Open ( filename ) if fh is None : return 0 self . filename = filename self . bands = fh . RasterCount self . xsize = fh . RasterXSize self . ysize = fh . RasterYSize self . band_type = fh . GetRasterBand ( 1 ) . DataType self . projection = fh . GetProjection ( ) self . geotransform = fh . GetGeoTransform ( ) self . ulx = self . geotransform [ 0 ] self . uly = self . geotransform [ 3 ] self . lrx = self . ulx + self . geotransform [ 1 ] * self . xsize self . lry = self . uly + self . geotransform [ 5 ] * self . ysize ct = fh . GetRasterBand ( 1 ) . GetRasterColorTable ( ) if ct is not None : self . ct = ct . Clone ( ) else : self . ct = None return 1