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

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

#include <Grid.h>

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

Public Member Functions

constexpr Idx height () const noexcept
 
constexpr Idx width () const noexcept
 
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 XYIdx &location) const =0
 
virtual void set (const XYIdx &location, T value)=0
 
- Public Member Functions inherited from fs::GridBase
 GridBase (GridBase &&rhs) noexcept=default
 
 GridBase (const GridBase &rhs)=default
 
GridBase & operator= (const GridBase &rhs)=default
 
GridBase & operator= (GridBase &&rhs) noexcept=default
 
constexpr MathSize cellSize () const noexcept
 Cell size used for GridBase.
 
constexpr FullIdx calculateHeight () const noexcept
 
constexpr FullIdx calculateWidth () const noexcept
 
constexpr MathSize xllcorner () const noexcept
 Lower left corner X coordinate in metres.
 
constexpr MathSize yllcorner () const noexcept
 Lower left corner Y coordinate in metres.
 
constexpr MathSize xurcorner () const noexcept
 Upper right corner X coordinate in metres.
 
constexpr MathSize yurcorner () const noexcept
 Upper right corner Y coordinate in metres.
 
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, const string_view proj4) noexcept
 Constructor.
 
void createPrj (const string_view dir, const string_view base_name) const
 Create .prj file in directory with base name for file.
 
std::optional< Coordinates > findCoordinates (const Point &point, bool flipped) const
 Find Coordinates for Point.
 
std::optional< FullCoordinates > findFullCoordinates (const Point &point, bool flipped) const
 Find FullCoordinates for Point.
 
bool validate (const Point &point) const
 
string saveToTiffFileInt (const Idx width, const Idx height, const tuple< Idx, Idx, Idx, Idx > bounds, const string_view dir, const string_view base_name, const uint16_t bits_per_sample, const bool is_unsigned, std::function< int(const XYIdx &)> value_at, const int nodata_as_int) const
 
string saveToTiffFileFloat (const Idx width, const Idx height, const tuple< Idx, Idx, Idx, Idx > bounds, const string_view dir, const string_view base_name, std::function< double(const XYIdx &)> value_at, const int nodata_as_int) const
 

Protected Member Functions

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

Private Attributes

V nodata_input_
 Value used to represent no data at a Location.
 
T nodata_value_
 Value to use for representing no data at a Location.
 
Idx height_ {}
 
Idx width_ {}
 

Detailed Description

template<class T, class V = T>
class fs::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()

template<class T , class V = T>
fs::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

◆ nodataInput()

template<class T , class V = T>
V fs::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::Grid< T, V >::nodataValue ( ) const
inlineconstexprnoexcept

Value representing no data.

Returns
Value representing no data
Here is the caller graph for this function:

◆ set()

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

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