Public Member Functions | Data Fields
Raster Class Reference

Public Member Functions

 Raster ()
 
 Raster (int NROWS, int NCOLS, double XLL, double YLL, double CELLSIZE, int NODATA=-9999, double VALUE=0.0)
 
 Raster (const Raster &rast, double value)
 
 Raster (const Raster &rast)
 
Rasteroperator= (const Raster &rast)
 
bool conformal (const Raster &rast)
 
bool match (const Raster &rast)
 
bool inside (double x, double y)
 
double interpValue (double x, double y)
 
double getValue (double x, double y)
 
int getIndex (double x, double y, int &row, int &col)
 
int write (const char fileName[])
 
int read (const char fileName[])
 
double getX (int col)
 
double getY (int row)
 
double max ()
 
double min ()
 
double sum ()
 
Raster where (const Raster &rast, const Raster &rast1, const Raster &rast2)
 
Raster where (const Raster &rast, const double &val1, const double &val2)
 
void scale (double value)
 
void whereAdd (const Raster &rast, double value)
 
void translate (const double &x, const double &y)
 
 ~Raster ()
 
 Raster ()
 
 Raster (int NROWS, int NCOLS, double XLL, double YLL, double CELLSIZE, int NODATA=-9999, double VALUE=0.0)
 
 Raster (const Raster &rast, double value)
 
 Raster (const Raster &rast)
 
Rasteroperator= (const Raster &rast)
 
bool conformal (const Raster &rast)
 
bool match (const Raster &rast)
 
bool inside (double x, double y)
 
double interpValue (double x, double y)
 
double getValue (double x, double y)
 
int getIndex (double x, double y, int &row, int &col)
 
int write (const char fileName[])
 
int read (const char fileName[])
 
double getX (int col)
 
double getY (int row)
 
double max ()
 
double min ()
 
double sum ()
 
Raster where (const Raster &rast, const Raster &rast1, const Raster &rast2)
 
Raster where (const Raster &rast, const double &val1, const double &val2)
 
void scale (double value)
 
void whereAdd (const Raster &rast, double value)
 
void translate (const double &x, const double &y)
 
 ~Raster ()
 

Data Fields

int nrows
 
int ncols
 
double xll
 
double yll
 
double xur
 
double yur
 
double cellsize
 
double nodata
 
std::vector< std::vector< double > > data
 

Detailed Description

Definition at line 13 of file Raster.H.

Constructor & Destructor Documentation

◆ Raster() [1/8]

Raster ( )

Definition at line 2 of file Raster.C.

References cellsize, ncols, nodata, nrows, xll, xur, yll, and yur.

◆ Raster() [2/8]

Raster ( int  NROWS,
int  NCOLS,
double  XLL,
double  YLL,
double  CELLSIZE,
int  NODATA = -9999,
double  VALUE = 0.0 
)

Definition at line 13 of file Raster.C.

References cellsize, data, ncols, nodata, nrows, xll, xur, yll, and yur.

◆ Raster() [3/8]

Raster ( const Raster rast,
double  value 
)

Definition at line 29 of file Raster.C.

References cellsize, data, ncols, nodata, nrows, xll, xur, yll, and yur.

◆ Raster() [4/8]

Raster ( const Raster rast)

Definition at line 44 of file Raster.C.

References cellsize, data, ncols, nodata, nrows, xll, xur, yll, and yur.

◆ ~Raster() [1/2]

~Raster ( )

Definition at line 59 of file Raster.C.

◆ Raster() [5/8]

Raster ( )

◆ Raster() [6/8]

Raster ( int  NROWS,
int  NCOLS,
double  XLL,
double  YLL,
double  CELLSIZE,
int  NODATA = -9999,
double  VALUE = 0.0 
)

◆ Raster() [7/8]

Raster ( const Raster rast,
double  value 
)

◆ Raster() [8/8]

Raster ( const Raster rast)

◆ ~Raster() [2/2]

~Raster ( )

Member Function Documentation

◆ operator=() [1/2]

Raster & operator= ( const Raster rast)

Definition at line 130 of file Raster.C.

References cellsize, data, ncols, nodata, nrows, xll, xur, yll, and yur.

◆ conformal() [1/2]

bool conformal ( const Raster rast)

Definition at line 390 of file Raster.C.

References cellsize, xll, and yll.

Referenced by match().

Here is the caller graph for this function:

◆ match() [1/2]

bool match ( const Raster rast)

Definition at line 404 of file Raster.C.

References conformal(), ncols, nrows, xll, and yll.

Here is the call graph for this function:

◆ inside() [1/2]

bool inside ( double  x,
double  y 
)

Definition at line 165 of file Raster.C.

References x, xll, xur, y, yll, and yur.

◆ interpValue() [1/2]

double interpValue ( double  x,
double  y 
)

Definition at line 256 of file Raster.C.

References Foam::constant::physicoChemical::b, data, Foam::exit(), getIndex(), getX(), getY(), ncols, nrows, Foam::pow(), Foam::sqrt(), x, and y.

Here is the call graph for this function:

◆ getValue() [1/2]

double getValue ( double  x,
double  y 
)

Definition at line 173 of file Raster.C.

References data, Foam::exit(), getIndex(), x, and y.

Here is the call graph for this function:

◆ getIndex() [1/2]

int getIndex ( double  x,
double  y,
int &  row,
int &  col 
)

Definition at line 149 of file Raster.C.

References cellsize, ncols, nrows, x, xll, xur, y, yll, and yur.

Referenced by getValue(), and interpValue().

Here is the caller graph for this function:

◆ write() [1/2]

int write ( const char  fileName[])

Definition at line 63 of file Raster.C.

References cellsize, data, ncols, nrows, xll, and yll.

◆ read() [1/2]

int read ( const char  fileName[])

Definition at line 91 of file Raster.C.

References cellsize, data, ncols, nodata, nrows, xll, xur, yll, and yur.

Referenced by canopySource::readRaster().

Here is the caller graph for this function:

◆ getX() [1/2]

double getX ( int  col)

Definition at line 186 of file Raster.C.

References cellsize, and xll.

Referenced by interpValue().

Here is the caller graph for this function:

◆ getY() [1/2]

double getY ( int  row)

Definition at line 191 of file Raster.C.

References cellsize, and yll.

Referenced by interpValue().

Here is the caller graph for this function:

◆ max() [1/2]

double max ( )

Definition at line 197 of file Raster.C.

References data, maxValue, ncols, nodata, and nrows.

◆ min() [1/2]

double min ( )

Definition at line 214 of file Raster.C.

References data, minValue, ncols, nodata, and nrows.

◆ sum() [1/2]

double sum ( )

Definition at line 231 of file Raster.C.

References data, ncols, nodata, and nrows.

◆ where() [1/4]

Raster where ( const Raster rast,
const Raster rast1,
const Raster rast2 
)

◆ where() [2/4]

Raster where ( const Raster rast,
const double &  val1,
const double &  val2 
)

◆ scale() [1/2]

void scale ( double  value)

Definition at line 245 of file Raster.C.

References data, ncols, nodata, and nrows.

◆ whereAdd() [1/2]

void whereAdd ( const Raster rast,
double  value 
)

Definition at line 414 of file Raster.C.

References data, ncols, nodata, and nrows.

◆ translate() [1/2]

void translate ( const double &  x,
const double &  y 
)

Definition at line 428 of file Raster.C.

References x, xll, xur, y, yll, and yur.

Referenced by canopySource::readRaster().

Here is the caller graph for this function:

◆ operator=() [2/2]

Raster& operator= ( const Raster rast)

◆ conformal() [2/2]

bool conformal ( const Raster rast)

◆ match() [2/2]

bool match ( const Raster rast)

◆ inside() [2/2]

bool inside ( double  x,
double  y 
)

◆ interpValue() [2/2]

double interpValue ( double  x,
double  y 
)

◆ getValue() [2/2]

double getValue ( double  x,
double  y 
)

◆ getIndex() [2/2]

int getIndex ( double  x,
double  y,
int &  row,
int &  col 
)

◆ write() [2/2]

int write ( const char  fileName[])

◆ read() [2/2]

int read ( const char  fileName[])

◆ getX() [2/2]

double getX ( int  col)

◆ getY() [2/2]

double getY ( int  row)

◆ max() [2/2]

double max ( )

◆ min() [2/2]

double min ( )

◆ sum() [2/2]

double sum ( )

◆ where() [3/4]

Raster where ( const Raster rast,
const Raster rast1,
const Raster rast2 
)

◆ where() [4/4]

Raster where ( const Raster rast,
const double &  val1,
const double &  val2 
)

◆ scale() [2/2]

void scale ( double  value)

◆ whereAdd() [2/2]

void whereAdd ( const Raster rast,
double  value 
)

◆ translate() [2/2]

void translate ( const double &  x,
const double &  y 
)

Field Documentation

◆ nrows

int nrows

◆ ncols

int ncols

◆ xll

double xll

◆ yll

double yll

◆ xur

double xur

Definition at line 19 of file Raster.H.

Referenced by getIndex(), inside(), operator=(), Raster(), read(), canopySource::readRaster(), and translate().

◆ yur

double yur

Definition at line 20 of file Raster.H.

Referenced by getIndex(), inside(), operator=(), Raster(), read(), canopySource::readRaster(), and translate().

◆ cellsize

double cellsize

◆ nodata

double nodata

◆ data

std::vector< std::vector< double > > data

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