Package osgeo :: Module gdal :: Class Dataset |
[hide private]
[frames] | no frames]

# Class Dataset

source code

Proxy of C++ GDALDatasetShadow class.

Instance Methods | [hide private]
__init__(self, *args, **kwargs) | source code
__repr__(self) | source code
GetDriver(self, *args) GetDriver(Dataset self) -> Driver | source code
GetRasterBand(self, *args) GetRasterBand(Dataset self, int nBand) -> Band | source code
GetProjection(self, *args) GetProjection(Dataset self) -> char const * | source code
GetProjectionRef(self, *args) GetProjectionRef(Dataset self) -> char const * | source code
GetSpatialRef(self, *args) GetSpatialRef(Dataset self) -> SpatialReference | source code
SetProjection(self, *args) SetProjection(Dataset self, char const * prj) -> CPLErr | source code
SetSpatialRef(self, *args) SetSpatialRef(Dataset self, SpatialReference srs) | source code
GetGeoTransform(self, *args, **kwargs) GetGeoTransform(Dataset self, int * can_return_null=None) | source code
SetGeoTransform(self, *args) SetGeoTransform(Dataset self, double [6] argin) -> CPLErr | source code
BuildOverviews(self, *args, **kwargs) BuildOverviews(Dataset self, char const * resampling, int overviewlist=0, GDALProgressFunc callback=0, void * callback_data=None) -> int | source code
GetGCPCount(self, *args) GetGCPCount(Dataset self) -> int | source code
GetGCPProjection(self, *args) GetGCPProjection(Dataset self) -> char const * | source code
GetGCPSpatialRef(self, *args) GetGCPSpatialRef(Dataset self) -> SpatialReference | source code
GetGCPs(self, *args) GetGCPs(Dataset self) | source code
_SetGCPs(self, *args) _SetGCPs(Dataset self, int nGCPs, char const * pszGCPProjection) -> CPLErr | source code
_SetGCPs2(self, *args) _SetGCPs2(Dataset self, int nGCPs, SpatialReference hSRS) -> CPLErr | source code
FlushCache(self, *args) FlushCache(Dataset self) | source code
AddBand(self, *args, **kwargs) AddBand(Dataset self, GDALDataType datatype, char ** options=None) -> CPLErr | source code
CreateMaskBand(self, *args) CreateMaskBand(Dataset self, int nFlags) -> CPLErr | source code
GetFileList(self, *args) GetFileList(Dataset self) -> char ** | source code
AdviseRead(self, *args) AdviseRead(Dataset self, int xoff, int yoff, int xsize, int ysize, int * buf_xsize=None, int * buf_ysize=None, GDALDataType * buf_type=None, int band_list=0, char ** options=None) -> CPLErr | source code
EndAsyncReader(self, *args) EndAsyncReader(Dataset self, AsyncReader ario) | source code
GetVirtualMem(self, *args, **kwargs) GetVirtualMem(Dataset self, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, int nBufXSize, int nBufYSize, GDALDataType eBufType, int band_list, int bIsBandSequential, size_t nCacheSize, size_t nPageSizeHint, char ** options=None) -> VirtualMem | source code
GetTiledVirtualMem(self, *args, **kwargs) GetTiledVirtualMem(Dataset self, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, int nTileXSize, int nTileYSize, GDALDataType eBufType, int band_list, GDALTileOrganization eTileOrganization, size_t nCacheSize, char ** options=None) -> VirtualMem | source code
CreateLayer(self, *args, **kwargs) CreateLayer(Dataset self, char const * name, SpatialReference srs=None, OGRwkbGeometryType geom_type, char ** options=None) -> Layer | source code
CopyLayer(self, *args, **kwargs) CopyLayer(Dataset self, Layer src_layer, char const * new_name, char ** options=None) -> Layer | source code
GetLayerCount(self, *args) GetLayerCount(Dataset self) -> int | source code
GetLayerByIndex(self, *args) GetLayerByIndex(Dataset self, int index=0) -> Layer | source code
GetLayerByName(self, *args) GetLayerByName(Dataset self, char const * layer_name) -> Layer | source code
ResetReading(self, *args) ResetReading(Dataset self) | source code
GetNextFeature(self, *args, **kwargs) GetNextFeature(Dataset self, bool include_layer=True, bool include_pct=False, GDALProgressFunc callback=0, void * callback_data=None) -> Feature | source code
TestCapability(self, *args) TestCapability(Dataset self, char const * cap) -> bool | source code
ExecuteSQL(self, *args, **kwargs) ExecuteSQL(Dataset self, char const * statement, Geometry spatialFilter=None, char const * dialect) -> Layer | source code
ReleaseResultSet(self, *args) ReleaseResultSet(Dataset self, Layer layer) | source code
GetStyleTable(self, *args) GetStyleTable(Dataset self) -> StyleTable | source code
SetStyleTable(self, *args) SetStyleTable(Dataset self, StyleTable table) | source code
StartTransaction(self, *args, **kwargs) StartTransaction(Dataset self, int force=False) -> OGRErr | source code
CommitTransaction(self, *args) CommitTransaction(Dataset self) -> OGRErr | source code
RollbackTransaction(self, *args) RollbackTransaction(Dataset self) -> OGRErr | source code
ReadRaster1(self, *args, **kwargs) ReadRaster1(Dataset self, int xoff, int yoff, int xsize, int ysize, int * buf_xsize=None, int * buf_ysize=None, GDALDataType * buf_type=None, int band_list=0, GIntBig * buf_pixel_space=None, GIntBig * buf_line_space=None, GIntBig * buf_band_space=None, GDALRIOResampleAlg resample_alg, GDALProgressFunc callback=0, void * callback_data=None) -> CPLErr | source code
ReadAsArray(self, xoff=0, yoff=0, xsize=None, ysize=None, buf_obj=None, buf_xsize=None, buf_ysize=None, buf_type=None, resample_alg=gdalconst.GRIORA_NearestNeighbour, callback=None, callback_data=None, interleave='band') Reading a chunk of a GDAL band into a numpy array. | source code
WriteRaster(self, xoff, yoff, xsize, ysize, buf_string, buf_xsize=None, buf_ysize=None, buf_type=None, band_list=None, buf_pixel_space=None, buf_line_space=None, buf_band_space=None) | source code
ReadRaster(self, xoff=0, yoff=0, xsize=None, ysize=None, buf_xsize=None, buf_ysize=None, buf_type=None, band_list=None, buf_pixel_space=None, buf_line_space=None, buf_band_space=None, resample_alg=gdalconst.GRIORA_NearestNeighbour, callback=None, callback_data=None) | source code
GetVirtualMemArray(self, eAccess=gdalconst.GF_Read, xoff=0, yoff=0, xsize=None, ysize=None, bufxsize=None, bufysize=None, datatype=None, band_list=None, band_sequential=True, cache_size=10*1024*1024, page_size_hint=0, options=None) Return a NumPy array for the dataset, seen as a virtual memory mapping. | source code
GetTiledVirtualMemArray(self, eAccess=gdalconst.GF_Read, xoff=0, yoff=0, xsize=None, ysize=None, tilexsize=256, tileysize=256, datatype=None, band_list=None, tile_organization=gdalconst.GTO_BSQ, cache_size=10*1024*1024, options=None) Return a NumPy array for the dataset, seen as a virtual memory mapping with a tile organization. | source code
GetSubDatasets(self) | source code
BeginAsyncReader(self, xoff, yoff, xsize, ysize, buf_obj=None, buf_xsize=None, buf_ysize=None, buf_type=None, band_list=None, options=None) | source code
GetLayer(self, iLayer=0) Return the layer given an index or a name | source code
DeleteLayer(self, value) Deletes the layer given an index or layer name | source code
SetGCPs(self, gcps, wkt_or_spatial_ref) | source code
Inherited from `MajorObject`: `GetDescription`, `GetMetadata`, `GetMetadataDomainList`, `GetMetadataItem`, `GetMetadata_Dict`, `GetMetadata_List`, `SetDescription`, `SetMetadata`, `SetMetadataItem`

Class Variables | [hide private]
| __swig_setmethods__ = `{}`
| __setattr__ = `lambda self, name, value:`
| __swig_getmethods__ = `{}`
| __getattr__ = `lambda self, name:`
| RasterXSize = `_swig_property(_gdal.Dataset_RasterXSize_get)`
| RasterYSize = `_swig_property(_gdal.Dataset_RasterYSize_get)`
| RasterCount = `_swig_property(_gdal.Dataset_RasterCount_get)`
| __swig_destroy__ = `_gdal.delete_Dataset`
| __del__ = `lambda self:`

Method Details | [hide private]

### __init__(self, *args, **kwargs) (Constructor) | source code
Overrides: MajorObject.__init__

### __repr__(self) (Representation operator) | source code
Overrides: _swig_repr

### ReadAsArray(self, xoff=0, yoff=0, xsize=None, ysize=None, buf_obj=None, buf_xsize=None, buf_ysize=None, buf_type=None, resample_alg=gdalconst.GRIORA_NearestNeighbour, callback=None, callback_data=None, interleave='band') | source code
Reading a chunk of a GDAL band into a numpy array. The optional (buf_xsize,buf_ysize,buf_type) parameters should generally not be specified if buf_obj is specified. The array is returned

### GetVirtualMemArray(self, eAccess=gdalconst.GF_Read, xoff=0, yoff=0, xsize=None, ysize=None, bufxsize=None, bufysize=None, datatype=None, band_list=None, band_sequential=True, cache_size=10*1024*1024, page_size_hint=0, options=None) | source code
Return a NumPy array for the dataset, seen as a virtual memory mapping. If there are several bands and band_sequential = True, an element is accessed with array[band][y][x]. If there are several bands and band_sequential = False, an element is accessed with array[y][x][band]. If there is only one band, an element is accessed with array[y][x]. Any reference to the array must be dropped before the last reference to the related dataset is also dropped.

### GetTiledVirtualMemArray(self, eAccess=gdalconst.GF_Read, xoff=0, yoff=0, xsize=None, ysize=None, tilexsize=256, tileysize=256, datatype=None, band_list=None, tile_organization=gdalconst.GTO_BSQ, cache_size=10*1024*1024, options=None) | source code
Return a NumPy array for the dataset, seen as a virtual memory mapping with a tile organization. If there are several bands and tile_organization = gdal.GTO_TIP, an element is accessed with array[tiley][tilex][y][x][band]. If there are several bands and tile_organization = gdal.GTO_BIT, an element is accessed with array[tiley][tilex][band][y][x]. If there are several bands and tile_organization = gdal.GTO_BSQ, an element is accessed with array[band][tiley][tilex][y][x]. If there is only one band, an element is accessed with array[tiley][tilex][y][x]. Any reference to the array must be dropped before the last reference to the related dataset is also dropped.