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::ProjectionBase * | getProjection () 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 |
Wrapper for GDALDataset representing a collection of associated Raster bands.
isce3::io::gdal::Dataset::Dataset | ( | const std::string & | path, |
GDALAccess | access = GA_ReadOnly |
||
) |
Open an existing file as a GDAL dataset.
[in] | path | File path |
[in] | access | Access 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.
[in] | dataset | HDF5 dataset |
[in] | access | Access 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.
[in] | path | File path |
[in] | width | Number of columns |
[in] | length | Number of rows |
[in] | bands | Number of bands |
[in] | datatype | Data type identifier |
[in] | driver | GDAL 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.
[in] | path | File path of new dataset |
[in] | src | Source 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.
[in] | path | File path of new dataset |
[in] | src | Source dataset |
[in] | driver | GDAL driver name |
|
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.
[in] | data | Pointer to first pixel of first band |
[in] | width | Number of columns |
[in] | length | Number of rows |
[in] | bands | Number of bands |
|
inline |
Create a dataset describing an existing in-memory array.
The data layout is assumed to be in row major, band sequential format.
[in] | data | Pointer to first pixel of first band |
[in] | width | Number of columns |
[in] | length | Number of rows |
[in] | bands | Number of bands |
[in] | access | Access mode |
|
inline |
Create a read-only dataset describing an existing in-memory array.
[in] | data | Pointer to first pixel of first band |
[in] | width | Number of columns |
[in] | length | Number of rows |
[in] | bands | Number of bands |
[in] | colstride | Stride in bytes between the start of adjacent columns |
[in] | rowstride | Stride in bytes between the start of adjacent rows |
[in] | bandstride | Stride in bytes between the start of adjacent bands |
|
inline |
Create a dataset describing an existing in-memory array.
[in] | data | Pointer to first pixel of first band |
[in] | width | Number of columns |
[in] | length | Number of rows |
[in] | bands | Number of bands |
[in] | colstride | Stride in bytes between the start of adjacent columns |
[in] | rowstride | Stride in bytes between the start of adjacent rows |
[in] | bandstride | Stride in bytes between the start of adjacent bands |
[in] | access | Access mode |
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.
isce3::except::GDALError | if the spatial reference system is unavailable |
Raster isce3::io::gdal::Dataset::getRaster | ( | int | band | ) | const |
Fetch raster band.
[in] | band | Raster band index (1-based) |
void isce3::io::gdal::Dataset::setGeoTransform | ( | const GeoTransform & | transform | ) |
Set geotransform.
isce3::except::GDALError | if the format does not support this operation |
void isce3::io::gdal::Dataset::setProjection | ( | const isce3::core::ProjectionBase * | proj | ) |
Set spatial reference system.
isce3::except::GDALError | if the format does not support this operation |