FireSTARR
Loading...
Searching...
No Matches
fs::data::Grid< T, V > Class Template Referenceabstract

A GridBase with an associated type of data. More...

#include <Grid.h>

Inheritance diagram for fs::data::Grid< T, V >:
Collaboration diagram for fs::data::Grid< T, V >:

Public Member Functions

constexpr Idx rows () const noexcept
 Number of rows in the GridBase.
 
constexpr Idx columns () const noexcept
 Number of columns in the GridBase.
 
constexpr V nodataInput () const noexcept
 Value used for grid locations that have no data.
 
constexpr T nodataValue () const noexcept
 Value representing no data.
 
virtual T at (const Location &location) const =0
 Value for grid at given Location.
 
template<class P >
at (const Position< P > &position) const
 
virtual void set (const Location &location, T value)=0
 Set value for grid at given Location.
 
template<class P >
void set (const Position< P > &position, const T value)
 
- Public Member Functions inherited from fs::data::GridBase
 GridBase (GridBase &&rhs) noexcept=default
 Move constructor.
 
 GridBase (const GridBase &rhs)=default
 Copy constructor.
 
GridBaseoperator= (const GridBase &rhs)=default
 Copy assignment.
 
GridBaseoperator= (GridBase &&rhs) noexcept=default
 Move assignment.
 
constexpr MathSize cellSize () const noexcept
 Cell size used for GridBase.
 
constexpr FullIdx calculateRows () const noexcept
 Number of rows in the GridBase.
 
constexpr FullIdx calculateColumns () const noexcept
 Number of columns in the GridBase.
 
constexpr MathSize xllcorner () const noexcept
 Lower left corner X coordinate in meters.
 
constexpr MathSize yllcorner () const noexcept
 Lower left corner Y coordinate in meters.
 
constexpr MathSize xurcorner () const noexcept
 Upper right corner X coordinate in meters.
 
constexpr MathSize yurcorner () const noexcept
 Upper right corner Y coordinate in meters.
 
constexpr const string & proj4 () const noexcept
 Proj4 string defining coordinate system for this grid. Must be a UTM projection.
 
 GridBase (MathSize cell_size, MathSize xllcorner, MathSize yllcorner, MathSize xurcorner, MathSize yurcorner, string &&proj4) noexcept
 Constructor.
 
 GridBase () noexcept
 Default constructor.
 
void createPrj (const string &dir, const string &base_name) const
 Create .prj file in directory with base name for file.
 
unique_ptr< Coordinates > findCoordinates (const topo::Point &point, bool flipped) const
 Find Coordinates for Point.
 
unique_ptr< FullCoordinates > findFullCoordinates (const topo::Point &point, bool flipped) const
 Find FullCoordinates for Point.
 

Protected Member Functions

 Grid (const MathSize cell_size, const Idx rows, const Idx columns, const V nodata_input, const T nodata_value, const MathSize xllcorner, const MathSize yllcorner, const MathSize xurcorner, const MathSize yurcorner, string &&proj4) noexcept
 Constructor.
 
 Grid (const GridBase &grid_info, V no_data) noexcept
 Construct based on GridBase and no data value.
 

Private Attributes

nodata_input_
 Value used to represent no data at a Location.
 
nodata_value_
 Value to use for representing no data at a Location.
 
Idx rows_ {}
 Number of rows in the grid.
 
Idx columns_ {}
 Number of columns in the grid.
 

Detailed Description

template<class T, class V = T>
class fs::data::Grid< T, V >

A GridBase with an associated type of data.

Template Parameters
TType of data after conversion from initialization type.
VType of data used as an input when initializing.

Constructor & Destructor Documentation

◆ Grid() [1/2]

template<class T , class V = T>
fs::data::Grid< T, V >::Grid ( const MathSize cell_size,
const Idx rows,
const Idx columns,
const V nodata_input,
const T nodata_value,
const MathSize xllcorner,
const MathSize yllcorner,
const MathSize xurcorner,
const MathSize yurcorner,
string && proj4 )
inlineprotectednoexcept

Constructor.

Parameters
cell_sizeCell width and height (m)
rowsNumber of rows
columnsNumber of columns
nodata_inputValue that represents no data for type V
nodata_valueValue that represents no data for type T
nodataInteger value that represents no data
xllcornerLower left corner X coordinate (m)
yllcornerLower left corner Y coordinate (m)
proj4Proj4 projection definition

◆ Grid() [2/2]

template<class T , class V = T>
fs::data::Grid< T, V >::Grid ( const GridBase & grid_info,
V no_data )
inlineprotectednoexcept

Construct based on GridBase and no data value.

Parameters
grid_infoGridBase defining Grid area
no_dataValue that represents no data

Member Function Documentation

◆ at()

template<class T , class V = T>
virtual T fs::data::Grid< T, V >::at ( const Location & location) const
nodiscardpure virtual

Value for grid at given Location.

Parameters
locationLocation to get value for.
Returns
Value at grid Location.

Implemented in fs::data::ConstantGrid< T, V >, fs::data::GridMap< T, V >, fs::data::GridMap< size_t >, and fs::data::GridMap< unsigned char >.

Here is the call graph for this function:

◆ columns()

template<class T , class V = T>
Idx fs::data::Grid< T, V >::columns ( ) const
inlinenodiscardconstexprnoexcept

Number of columns in the GridBase.

Returns
Number of columns in the GridBase.
Here is the caller graph for this function:

◆ nodataInput()

template<class T , class V = T>
V fs::data::Grid< T, V >::nodataInput ( ) const
inlinenodiscardconstexprnoexcept

Value used for grid locations that have no data.

Returns
Value used for grid locations that have no data.

◆ nodataValue()

template<class T , class V = T>
T fs::data::Grid< T, V >::nodataValue ( ) const
inlineconstexprnoexcept

Value representing no data.

Returns
Value representing no data

◆ rows()

template<class T , class V = T>
Idx fs::data::Grid< T, V >::rows ( ) const
inlinenodiscardconstexprnoexcept

Number of rows in the GridBase.

Returns
Number of rows in the GridBase.
Here is the caller graph for this function:

◆ set()

template<class T , class V = T>
virtual void fs::data::Grid< T, V >::set ( const Location & location,
T value )
pure virtual

Set value for grid at given Location.

Parameters
locationLocation to set value for.
valueValue to set at grid Location.
Returns
None

Implemented in fs::data::GridMap< T, V >, fs::data::GridMap< size_t >, and fs::data::GridMap< unsigned char >.

Here is the call graph for this function:

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