isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Static Public Member Functions | Friends | List of all members
isce3::io::gdal::Dataset Class Reference

Wrapper for GDALDataset representing a collection of associated Raster bands. More...

#include <Dataset.h>

Public Member Functions

 Dataset (const std::string &path, GDALAccess access=GA_ReadOnly)
 Open an existing file as a GDAL dataset. More...
 
 Dataset (const isce3::io::IDataSet &dataset, GDALAccess access=GA_ReadOnly)
 Create a dataset from an HDF5 dataset. More...
 
 Dataset (const std::string &path, int width, int length, int bands, GDALDataType datatype, const std::string &driver=defaultDriver())
 Create a new GDAL dataset. More...
 
 Dataset (const std::string &path, const Dataset &src)
 Create a new GDAL dataset as a copy of an existing dataset. More...
 
 Dataset (const std::string &path, const Dataset &src, const std::string &driver)
 Create a new GDAL dataset as a copy of an existing dataset. More...
 
template<typename T >
 Dataset (const T *data, int width, int length, int bands)
 Create a read-only dataset describing an existing in-memory array. More...
 
template<typename T >
 Dataset (T *data, int width, int length, int bands, GDALAccess access=GA_Update)
 Create a dataset describing an existing in-memory array. More...
 
template<typename T >
 Dataset (const T *data, int width, int length, int bands, std::size_t colstride, std::size_t rowstride, std::size_t bandstride)
 Create a read-only dataset describing an existing in-memory array. More...
 
template<typename T >
 Dataset (T *data, int width, int length, int bands, std::size_t colstride, std::size_t rowstride, std::size_t bandstride, GDALAccess access=GA_Update)
 Create a dataset describing an existing in-memory array. More...
 
GDALAccess access () const
 Access mode.
 
int width () const
 Number of columns.
 
int length () const
 Number of rows.
 
int bands () const
 Number of bands.
 
std::string driver () const
 Driver name.
 
Raster getRaster (int band) const
 Fetch raster band. More...
 
GeoTransform getGeoTransform () const
 Get transform from raster coordinates (pixel, line) to projected coordinates (x, y) More...
 
void setGeoTransform (const GeoTransform &)
 Set geotransform. More...
 
isce3::core::ProjectionBasegetProjection () const
 Get spatial reference system. More...
 
void setProjection (const isce3::core::ProjectionBase *)
 Set spatial reference system. More...
 
double x0 () const
 Left edge of left-most pixel in projection coordinates.
 
double y0 () const
 Upper edge of upper-most line in projection coordinates.
 
double dx () const
 Pixel width in projection coordinates.
 
double dy () const
 Line height in projection coordinates.
 
GDALDataset * get ()
 Get the underlying GDALDataset pointer.
 
const GDALDataset * get () const
 Get the underlying GDALDataset pointer.
 

Static Public Member Functions

static std::string defaultDriver ()
 Default GDAL driver for dataset creation.
 

Friends

class Raster
 

Detailed Description

Wrapper for GDALDataset representing a collection of associated Raster bands.

Constructor & Destructor Documentation

isce3::io::gdal::Dataset::Dataset ( const std::string &  path,
GDALAccess  access = GA_ReadOnly 
)

Open an existing file as a GDAL dataset.

Parameters
[in]pathFile path
[in]accessAccess mode
isce3::io::gdal::Dataset::Dataset ( const isce3::io::IDataSet dataset,
GDALAccess  access = GA_ReadOnly 
)

Create a dataset from an HDF5 dataset.

The resulting dataset is invalidated if the HDF5 file is closed.

Parameters
[in]datasetHDF5 dataset
[in]accessAccess mode
isce3::io::gdal::Dataset::Dataset ( const std::string &  path,
int  width,
int  length,
int  bands,
GDALDataType  datatype,
const std::string &  driver = defaultDriver() 
)

Create a new GDAL dataset.

Parameters
[in]pathFile path
[in]widthNumber of columns
[in]lengthNumber of rows
[in]bandsNumber of bands
[in]datatypeData type identifier
[in]driverGDAL driver name
isce3::io::gdal::Dataset::Dataset ( const std::string &  path,
const Dataset src 
)

Create a new GDAL dataset as a copy of an existing dataset.

The duplicate is created with the same driver format as the original.

Parameters
[in]pathFile path of new dataset
[in]srcSource dataset
isce3::io::gdal::Dataset::Dataset ( const std::string &  path,
const Dataset src,
const std::string &  driver 
)

Create a new GDAL dataset as a copy of an existing dataset.

Parameters
[in]pathFile path of new dataset
[in]srcSource dataset
[in]driverGDAL driver name
template<typename T >
isce3::io::gdal::Dataset::Dataset ( const T *  data,
int  width,
int  length,
int  bands 
)
inline

Create a read-only dataset describing an existing in-memory array.

The data layout is assumed to be in row major, band sequential format.

Parameters
[in]dataPointer to first pixel of first band
[in]widthNumber of columns
[in]lengthNumber of rows
[in]bandsNumber of bands
template<typename T >
isce3::io::gdal::Dataset::Dataset ( T *  data,
int  width,
int  length,
int  bands,
GDALAccess  access = GA_Update 
)
inline

Create a dataset describing an existing in-memory array.

The data layout is assumed to be in row major, band sequential format.

Parameters
[in]dataPointer to first pixel of first band
[in]widthNumber of columns
[in]lengthNumber of rows
[in]bandsNumber of bands
[in]accessAccess mode
template<typename T >
isce3::io::gdal::Dataset::Dataset ( const T *  data,
int  width,
int  length,
int  bands,
std::size_t  colstride,
std::size_t  rowstride,
std::size_t  bandstride 
)
inline

Create a read-only dataset describing an existing in-memory array.

Parameters
[in]dataPointer to first pixel of first band
[in]widthNumber of columns
[in]lengthNumber of rows
[in]bandsNumber of bands
[in]colstrideStride in bytes between the start of adjacent columns
[in]rowstrideStride in bytes between the start of adjacent rows
[in]bandstrideStride in bytes between the start of adjacent bands
template<typename T >
isce3::io::gdal::Dataset::Dataset ( T *  data,
int  width,
int  length,
int  bands,
std::size_t  colstride,
std::size_t  rowstride,
std::size_t  bandstride,
GDALAccess  access = GA_Update 
)
inline

Create a dataset describing an existing in-memory array.

Parameters
[in]dataPointer to first pixel of first band
[in]widthNumber of columns
[in]lengthNumber of rows
[in]bandsNumber of bands
[in]colstrideStride in bytes between the start of adjacent columns
[in]rowstrideStride in bytes between the start of adjacent rows
[in]bandstrideStride in bytes between the start of adjacent bands
[in]accessAccess mode

Member Function Documentation

GeoTransform isce3::io::gdal::Dataset::getGeoTransform ( ) const

Get transform from raster coordinates (pixel, line) to projected coordinates (x, y)

If no transform is found, the default (identity) transform is returned.

isce3::core::ProjectionBase * isce3::io::gdal::Dataset::getProjection ( ) const

Get spatial reference system.

Exceptions
isce3::except::GDALErrorif the spatial reference system is unavailable
Raster isce3::io::gdal::Dataset::getRaster ( int  band) const

Fetch raster band.

Parameters
[in]bandRaster band index (1-based)
void isce3::io::gdal::Dataset::setGeoTransform ( const GeoTransform transform)

Set geotransform.

Exceptions
isce3::except::GDALErrorif the format does not support this operation
void isce3::io::gdal::Dataset::setProjection ( const isce3::core::ProjectionBase proj)

Set spatial reference system.

Exceptions
isce3::except::GDALErrorif the format does not support this operation

The documentation for this class was generated from the following files:

Generated for ISCE3.0 by doxygen 1.8.5.