isce3 0.25.0
Loading...
Searching...
No Matches
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.
 
 Dataset (const isce3::io::IDataSet &dataset, GDALAccess access=GA_ReadOnly)
 Create a dataset from an HDF5 dataset.
 
 Dataset (const std::string &path, int width, int length, int bands, GDALDataType datatype, const std::string &driver=defaultDriver())
 Create a new GDAL dataset.
 
 Dataset (const std::string &path, const Dataset &src)
 Create a new GDAL dataset as a copy of an existing 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.
 
template<typename T>
 Dataset (const T *data, int width, int length, int bands)
 Create a read-only dataset describing an existing in-memory array.
 
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.
 
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.
 
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.
 
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.
 
GeoTransform getGeoTransform () const
 Get transform from raster coordinates (pixel, line) to projected coordinates (x, y)
 
void setGeoTransform (const GeoTransform &)
 Set geotransform.
 
isce3::core::ProjectionBasegetProjection () const
 Get spatial reference system.
 
void setProjection (const isce3::core::ProjectionBase *)
 Set spatial reference system.
 
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

◆ Dataset() [1/9]

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

◆ Dataset() [2/9]

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

◆ Dataset() [3/9]

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

◆ Dataset() [4/9]

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

◆ Dataset() [5/9]

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

◆ Dataset() [6/9]

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

◆ Dataset() [7/9]

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

◆ Dataset() [8/9]

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

◆ Dataset() [9/9]

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

◆ getGeoTransform()

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.

◆ getProjection()

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

Get spatial reference system.

Exceptions
isce3::except::GDALErrorif the spatial reference system is unavailable

◆ getRaster()

Raster isce3::io::gdal::Dataset::getRaster ( int band) const

Fetch raster band.

Parameters
[in]bandRaster band index (1-based)

◆ setGeoTransform()

void isce3::io::gdal::Dataset::setGeoTransform ( const GeoTransform & transform)

Set geotransform.

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

◆ setProjection()

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.13.2.