Public Member Functions | Static Public Member Functions | List of all members
openfluid::landr::RasterDataset Class Reference

Interface for managing Raster Data format. More...

#include <landr/RasterDataset.hpp>

Public Member Functions

 RasterDataset (openfluid::core::GeoRasterValue &Value)
 Create a virtual (in memory) copy of Value GDALDataset. More...
 
 RasterDataset (const RasterDataset &Other)
 Copy constructor. More...
 
 ~RasterDataset ()
 Delete the virtual GDALDataset. More...
 
GDALDataset * source ()
 Returns the GDALDataset related to this RasterDataset. More...
 
GDALDataset * source () const
 Returns the const GDALDataset related to this RasterDataset. More...
 
GDALRasterBand * rasterBand (unsigned int RasterBandIndex=1)
 Gets the RasterBand indexed with RasterBandIndex of the dataset. More...
 
std::pair< int, int > getPixelFromCoordinate (geos::geom::Coordinate Coo)
 Returns the column and line index of a pixel from the coordinate of the pixel. More...
 
geos::geom::Coordinate * computeOrigin ()
 Returns the geos::geom::Coordinate origin of this RasterDataset. More...
 
double getPixelWidth ()
 Returns the pixel width of this RasterDataset. More...
 
double getPixelHeight ()
 Returns the pixel height of this RasterDataset. More...
 
std::vector< float > getValuesOfLine (int LineIndex, unsigned int RasterBandIndex=1)
 Returns a vector of the pixel values of a line of this RasterDataset. More...
 
std::vector< float > getValuesOfColumn (int ColIndex, unsigned int RasterBandIndex=1)
 Returns a vector of the pixel values of a column of this RasterDataset. More...
 
float getValueOfPixel (int ColIndex, int LineIndex, unsigned int RasterBandIndex=1)
 Returns the pixel value with column and line index. More...
 
float getValueOfCoordinate (geos::geom::Coordinate Coo, unsigned int RasterBandIndex=1)
 Returns the pixel value with coordinate. More...
 
openfluid::landr::VectorDatasetpolygonize (const std::string &FileName, std::string FieldName="", unsigned int RasterBandIndex=1)
 Creates a new VectorDataset with polygons for all connected regions of pixels in the raster sharing a common pixel value. More...
 
OGREnvelope envelope ()
 Returns the OGREnvelope associated to this RasterDataset. More...
 

Static Public Member Functions

static std::string getDefaultPolygonizedFieldName ()
 

Detailed Description

Interface for managing Raster Data format.

Constructor & Destructor Documentation

openfluid::landr::RasterDataset::RasterDataset ( openfluid::core::GeoRasterValue Value)

Create a virtual (in memory) copy of Value GDALDataset.

Parameters
ValueThe GeoRasterValue to copy
Exceptions
openfluid::base::FrameworkExceptionif fails
openfluid::landr::RasterDataset::RasterDataset ( const RasterDataset Other)

Copy constructor.

Exceptions
openfluid::base::FrameworkExceptionif fails
openfluid::landr::RasterDataset::~RasterDataset ( )

Delete the virtual GDALDataset.

Member Function Documentation

geos::geom::Coordinate* openfluid::landr::RasterDataset::computeOrigin ( )

Returns the geos::geom::Coordinate origin of this RasterDataset.

OGREnvelope openfluid::landr::RasterDataset::envelope ( )

Returns the OGREnvelope associated to this RasterDataset.

static std::string openfluid::landr::RasterDataset::getDefaultPolygonizedFieldName ( )
static
std::pair<int, int> openfluid::landr::RasterDataset::getPixelFromCoordinate ( geos::geom::Coordinate  Coo)

Returns the column and line index of a pixel from the coordinate of the pixel.

Parameters
CooA geos::geom::Coordinate.
Returns
A pair of the column and line index of the pixel in this RasterDataset.
double openfluid::landr::RasterDataset::getPixelHeight ( )

Returns the pixel height of this RasterDataset.

double openfluid::landr::RasterDataset::getPixelWidth ( )

Returns the pixel width of this RasterDataset.

float openfluid::landr::RasterDataset::getValueOfCoordinate ( geos::geom::Coordinate  Coo,
unsigned int  RasterBandIndex = 1 
)

Returns the pixel value with coordinate.

Parameters
CooThe geos::geom::Coordinate.
RasterBandIndexThe raster band index (default is 1).
Returns
The pixel value.
float openfluid::landr::RasterDataset::getValueOfPixel ( int  ColIndex,
int  LineIndex,
unsigned int  RasterBandIndex = 1 
)

Returns the pixel value with column and line index.

Parameters
ColIndexThe column index.
LineIndexThe line index.
RasterBandIndexThe raster band index (default is 1).
Returns
The pixel value.
std::vector<float> openfluid::landr::RasterDataset::getValuesOfColumn ( int  ColIndex,
unsigned int  RasterBandIndex = 1 
)

Returns a vector of the pixel values of a column of this RasterDataset.

Parameters
ColIndexThe column index to get the pixel values.
RasterBandIndexThe raster band index (default is 1).
Returns
A vector of pixel values.
std::vector<float> openfluid::landr::RasterDataset::getValuesOfLine ( int  LineIndex,
unsigned int  RasterBandIndex = 1 
)

Returns a vector of the pixel values of a line of this RasterDataset.

Parameters
LineIndexThe line index to get the pixel values.
RasterBandIndexThe raster band index (default is 1).
Returns
A vector of pixel values.
openfluid::landr::VectorDataset* openfluid::landr::RasterDataset::polygonize ( const std::string &  FileName,
std::string  FieldName = "",
unsigned int  RasterBandIndex = 1 
)

Creates a new VectorDataset with polygons for all connected regions of pixels in the raster sharing a common pixel value.

Use openfluid::landr::VectorDataset::copyToDisk() to keep this vectorDataset on disk

Parameters
FileNameThe name of the new VectorDataset.
FieldNameThe name of the field to be created for storing the pixel value, limited to 10 characters (or will be truncated). Default is set to "PixelVal". Type of field is OFTReal .
RasterBandIndexThe raster band index (default is 1).
Returns
The newly created VectorDataset.
GDALRasterBand* openfluid::landr::RasterDataset::rasterBand ( unsigned int  RasterBandIndex = 1)

Gets the RasterBand indexed with RasterBandIndex of the dataset.

Is owned by its dataset, should never be destroyed with the C++ delete operator.

Parameters
RasterBandIndexThe rasterBand to get, default 1
GDALDataset* openfluid::landr::RasterDataset::source ( )

Returns the GDALDataset related to this RasterDataset.

GDALDataset* openfluid::landr::RasterDataset::source ( ) const

Returns the const GDALDataset related to this RasterDataset.


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