9 #include "detail/MemoryMap.h"
11 namespace isce3 {
namespace io {
namespace gdal {
27 Raster(
const std::string & path, GDALAccess
access = GA_ReadOnly);
68 Raster(
const std::string & path,
84 Raster(
const T * data,
int width,
int length);
97 Raster(T * data,
int width,
int length, GDALAccess
access = GA_Update);
112 std::size_t colstride,
113 std::size_t rowstride);
129 std::size_t colstride,
130 std::size_t rowstride,
131 GDALAccess
access = GA_Update);
140 int band()
const {
return _band; }
187 double x0()
const {
return _dataset.
x0(); }
190 double y0()
const {
return _dataset.
y0(); }
193 double dx()
const {
return _dataset.
dx(); }
196 double dy()
const {
return _dataset.
dy(); }
209 void readPixel(T * dst,
int col,
int row)
const;
222 void writePixel(
const T * src,
int col,
int row);
234 void readLine(T * dst,
int row)
const;
259 void readLines(T * dst,
int first_row,
int num_rows)
const;
272 void writeLines(
const T * src,
int first_row,
int num_rows);
287 void readBlock(T * dst,
int first_col,
int first_row,
int num_cols,
int num_rows)
const;
302 void writeBlock(
const T * src,
int first_col,
int first_row,
int num_cols,
int num_rows);
327 GDALRasterBand *
get() {
return _dataset._dataset->GetRasterBand(_band); }
330 const GDALRasterBand *
get()
const {
return _dataset._dataset->GetRasterBand(_band); }
363 GDALDataType getIODataType()
const;
366 CPLErr readwriteBlock(T * buf,
371 GDALRWFlag rwflag)
const;
382 #define ISCE_IO_GDAL_RASTER_ICC
383 #include "Raster.icc"
384 #undef ISCE_IO_GDAL_RASTER_ICC
void readPixel(T *dst, int col, int row) const
Read a single pixel value from the raster.
Definition: Raster.icc:127
void setGeoTransform(const GeoTransform &)
Set geotransform.
Definition: Dataset.cpp:156
void writeLine(const T *src, int row)
Write a line of pixel data to the raster.
Definition: Raster.icc:148
int length() const
Number of rows.
Definition: Dataset.h:154
void setProjection(const isce3::core::ProjectionBase *)
Set spatial reference system.
Definition: Dataset.cpp:185
GDALAccess access() const
Access mode.
Definition: Dataset.h:148
Definition: MemoryMap.h:11
int band() const
Band index (1-based)
Definition: Raster.h:140
static std::string defaultDriver()
Default GDAL driver for raster creation.
Definition: Raster.h:19
isce3::core::ProjectionBase * getProjection() const
Get spatial reference system.
Definition: Raster.h:177
void writeLines(const T *src, int first_row, int num_rows)
Write one or more lines of pixel data to the raster.
Definition: Raster.icc:162
std::string driver() const
Driver name.
Definition: Dataset.h:160
double y0() const
Upper edge of upper-most line in projection coordinates.
Definition: Dataset.h:202
static std::string defaultDriver()
Default GDAL driver for dataset creation.
Definition: Dataset.h:22
void setGeoTransform(const GeoTransform &transform)
Set geotransform.
Definition: Raster.h:170
double x0() const
Left edge of left-most pixel in projection coordinates.
Definition: Raster.h:187
std::string driver() const
Driver name.
Definition: Raster.h:155
void setProjection(const isce3::core::ProjectionBase *proj)
Set spatial reference system.
Definition: Raster.h:184
double dx() const
Pixel width in projection coordinates.
Definition: Dataset.h:205
int width() const
Number of columns.
Definition: Dataset.h:151
double y0() const
Upper edge of upper-most line in projection coordinates.
Definition: Raster.h:190
double dy() const
Line height in projection coordinates.
Definition: Raster.h:196
Interface to 2-D memory array.
Definition: Buffer.h:13
Dataset & dataset()
Get the dataset containing the raster.
Definition: Raster.h:137
isce3::core::ProjectionBase * getProjection() const
Get spatial reference system.
Definition: Dataset.cpp:169
Our derived dataset structure that includes utility functions.
Definition: IH5.h:44
Abstract base class for individual projections.
Definition: Projections.h:22
GDALDataType datatype() const
Datatype identifier.
Definition: Raster.icc:120
void writePixel(const T *src, int col, int row)
Write a single pixel value to the raster.
Definition: Raster.icc:134
void readAll(T *dst) const
Read all pixel data from the raster.
Definition: Raster.icc:201
void writeBlock(const T *src, int first_col, int first_row, int num_cols, int num_rows)
Write a block of pixel data to the raster.
Definition: Raster.icc:183
Buffer memmap()
Create a virtual memory mapping of the raster.
Definition: Raster.icc:214
int length() const
Number of rows.
Definition: Raster.h:152
Raster(const std::string &path, GDALAccess access=GA_ReadOnly)
Open an existing file containing a single raster band as a GDAL raster.
Definition: Raster.icc:39
double dy() const
Line height in projection coordinates.
Definition: Dataset.h:208
double dx() const
Pixel width in projection coordinates.
Definition: Raster.h:193
Wrapper for GDALRasterBand representing a single raster.
Definition: Raster.h:14
Buffer with static type information.
Definition: Buffer.h:136
int width() const
Number of columns.
Definition: Raster.h:149
GDALAccess access() const
Access mode.
Definition: Raster.h:146
void readLines(T *dst, int first_row, int num_rows) const
Read one or more lines of pixel data from the raster.
Definition: Raster.icc:155
void readLine(T *dst, int row) const
Read a line of pixel data from the raster.
Definition: Raster.icc:141
void readBlock(T *dst, int first_col, int first_row, int num_cols, int num_rows) const
Read a block of pixel data from the raster.
Definition: Raster.icc:169
const Dataset & dataset() const
Get the dataset containing the raster.
Definition: Raster.h:134
Wrapper for GDALDataset representing a collection of associated Raster bands.
Definition: Dataset.h:17
GeoTransform getGeoTransform() const
Get transform from raster coordinates (pixel, line) to projected coordinates (x, y) ...
Definition: Dataset.cpp:149
GeoTransform getGeoTransform() const
Get transform from raster coordinates (pixel, line) to projected coordinates (x, y) ...
Definition: Raster.h:163
double x0() const
Left edge of left-most pixel in projection coordinates.
Definition: Dataset.h:199
void writeAll(const T *src)
Write all pixel data to the raster.
Definition: Raster.icc:208