te::rst::RasterSummaryManager Class Reference

A singleton for keeping raster summaries (most statistics). It stores an internal map of raster conn info str and their respective summaries. More...

#include <RasterSummaryManager.h>

Inheritance diagram for te::rst::RasterSummaryManager:
te::common::Singleton< RasterSummaryManager >

Classes

class  SumManKey
 Summary manager key. More...
 

Public Member Functions

void enableDeletedRastersCache (const bool enabled)
 Enable/disable the cache of deleted rasters. More...
 
bool find (const Raster *raster, const unsigned int bandIndex, const unsigned int rowStart, const unsigned int colStart, const unsigned int finalRow, const unsigned int finalCol, const unsigned int histoBins, const unsigned int sampleStep, BandSummary &summary) const
 Searches for a band summary. More...
 
bool find (const Raster *raster, RasterSummary &summary) const
 Searches for a raster summary. More...
 
bool get (const Raster *raster, bool readall, RasterSummary &summary)
 It searches for a raster summary. If not found it creates the summary and returns it. More...
 
bool get (const Raster *raster, const unsigned int bandIndex, bool readall, BandSummary &summary)
 Searches for a band summary and creates it if it does not exist. More...
 
bool get (const Raster *raster, const unsigned int bandIndex, const unsigned int rowStart, const unsigned int colStart, const unsigned int finalRow, const unsigned int finalCol, const unsigned int histoBins, const unsigned int sampleStep, bool readall, BandSummary &summary)
 Searches for a band summary and creates it if it does not exist. More...
 
bool get (const Raster *raster, const unsigned int rowStart, const unsigned int colStart, const unsigned int finalRow, const unsigned int finalCol, const unsigned int histoBins, const unsigned int sampleStep, bool readall, RasterSummary &summary)
 It searches for a raster summary. If not found it creates the summary and returns it. More...
 
unsigned int getDefaultRasterHistSize ()
 Get the default rasters histograms bins. More...
 
void remove (const Raster *raster)
 Removes all summary ocurrences related to the specified raster pointer. More...
 
void remove (const Raster *raster, const unsigned int bandIndex, const unsigned int rowStart, const unsigned int colStart, const unsigned int finalRow, const unsigned int finalCol, const unsigned int histoBins, const unsigned int sampleStep)
 Removes the summary from the specified raster. More...
 
void removeAll ()
 Removes all raster summary entries. More...
 
void setDefaultRasterHistSize (const unsigned int binsNumber)
 Set the default rasters histograms bins. More...
 
 ~RasterSummaryManager ()
 Destructor. More...
 

Static Public Member Functions

static RasterSummaryManagergetInstance ()
 It returns a reference to the singleton instance. More...
 

Protected Types

typedef std::list< SumManKeySummaryContT
 

Protected Member Functions

 RasterSummaryManager ()
 

Private Attributes

unsigned int m_defRastersHistBins
 
bool m_enableDeletedRastersCache
 
SummaryContT m_rasterSummaries
 A rasters band summaries.
More...
 
std::mutex m_syncMutex
 Internal mutex. More...
 

Friends

class te::common::Singleton< RasterSummaryManager >
 

Detailed Description

A singleton for keeping raster summaries (most statistics). It stores an internal map of raster conn info str and their respective summaries.

See also
RasterSummary, BandSummary.

Definition at line 58 of file RasterSummaryManager.h.

Member Typedef Documentation

◆ SummaryContT

Definition at line 240 of file RasterSummaryManager.h.

Constructor & Destructor Documentation

◆ ~RasterSummaryManager()

te::rst::RasterSummaryManager::~RasterSummaryManager ( )

Destructor.

◆ RasterSummaryManager()

te::rst::RasterSummaryManager::RasterSummaryManager ( )
protected

Member Function Documentation

◆ enableDeletedRastersCache()

void te::rst::RasterSummaryManager::enableDeletedRastersCache ( const bool  enabled)

Enable/disable the cache of deleted rasters.

Parameters
enabledEnable or disable this feature.
Note
Only rasters without the write policy can be cached.

◆ find() [1/2]

bool te::rst::RasterSummaryManager::find ( const Raster raster,
const unsigned int  bandIndex,
const unsigned int  rowStart,
const unsigned int  colStart,
const unsigned int  finalRow,
const unsigned int  finalCol,
const unsigned int  histoBins,
const unsigned int  sampleStep,
BandSummary summary 
) const

Searches for a band summary.

Parameters
rasterThe raster to be found.
rowStartThe starting row.
colStartThe starting column.
finalRowThe final row.
finalColThe final column.
histoBinsThe number of bins (intervals from minimum pixel to maximum). When b = 0, the histogram will be divided according to all pixel values.
sampleStepThe row/column step used when reading pixels (to read all pixels sampleStep=1, to read half of pixels use sampleStep=2 );
summaryThe found raster summary.
Returns
true if the summary has been found, false if not found.
Note
This is a thread safe method (an internal mutex is used).

◆ find() [2/2]

bool te::rst::RasterSummaryManager::find ( const Raster raster,
RasterSummary summary 
) const

Searches for a raster summary.

Parameters
rasterThe raster to be found.
summaryThe found raster summary.
Returns
true if the summary has been found, false if not found.
Note
This is a thread safe method (an internal mutex is used).

◆ get() [1/4]

bool te::rst::RasterSummaryManager::get ( const Raster raster,
bool  readall,
RasterSummary summary 
)

It searches for a raster summary. If not found it creates the summary and returns it.

Parameters
rasterThe raster to be found.
readallIf false, the cache will be used or if true the entire image will be read again (can be slow).
summaryThe found raster summary.
Returns
true if ok, false on errors.
Note
This is a thread safe method (an internal mutex is used).

◆ get() [2/4]

bool te::rst::RasterSummaryManager::get ( const Raster raster,
const unsigned int  bandIndex,
bool  readall,
BandSummary summary 
)

Searches for a band summary and creates it if it does not exist.

Parameters
rasterThe raster to be found.
bandIndexBand index.
readallIf false, the cache will be used or if true the entire image will be read again (can be slow).
summaryThe found band summary.
Returns
true if ok, false on errors.
Note
This is a thread safe method (an internal mutex is used).

◆ get() [3/4]

bool te::rst::RasterSummaryManager::get ( const Raster raster,
const unsigned int  bandIndex,
const unsigned int  rowStart,
const unsigned int  colStart,
const unsigned int  finalRow,
const unsigned int  finalCol,
const unsigned int  histoBins,
const unsigned int  sampleStep,
bool  readall,
BandSummary summary 
)

Searches for a band summary and creates it if it does not exist.

Parameters
rasterThe raster to be found.
bandIndexBand index.
rowStartThe starting row.
colStartThe starting column.
finalRowThe final row.
finalColThe final column.
histoBinsThe number of bins (intervals from minimum pixel to maximum). When b = 0, the histogram will be divided according to all pixel values.
sampleStepThe row/column step used when reading pixels (to read all pixels sampleStep=1, to read half of pixels use sampleStep=2 );
readallForce the reading the entire image (can be slow) for computing min and max values.
summaryThe found band summary.
Returns
true if the summary has been found, false if not found.
Note
This is a thread safe method (an internal mutex is used).

◆ get() [4/4]

bool te::rst::RasterSummaryManager::get ( const Raster raster,
const unsigned int  rowStart,
const unsigned int  colStart,
const unsigned int  finalRow,
const unsigned int  finalCol,
const unsigned int  histoBins,
const unsigned int  sampleStep,
bool  readall,
RasterSummary summary 
)

It searches for a raster summary. If not found it creates the summary and returns it.

Parameters
rasterThe raster to be found.
rowStartThe starting row.
colStartThe starting column.
finalRowThe final row.
finalColThe final column.
histoBinsThe number of bins (intervals from minimum pixel to maximum). When b = 0, the histogram will be divided according to all pixel values.
sampleStepThe row/column step used when reading pixels (to read all pixels sampleStep=1, to read half of pixels use sampleStep=2 );
readallForce the reading the entire image (can be slow) for computing min and max values.
summaryThe found raster summary.
Returns
true if ok, false on errors.
Note
This is a thread safe method (an internal mutex is used).

◆ getDefaultRasterHistSize()

unsigned int te::rst::RasterSummaryManager::getDefaultRasterHistSize ( )

Get the default rasters histograms bins.

Returns
Get the default rasters histograms bins.

◆ getInstance()

RasterSummaryManager & te::common::Singleton< RasterSummaryManager >::getInstance
inlinestaticinherited

It returns a reference to the singleton instance.

Returns
A reference to the singleton instance.

Definition at line 109 of file Singleton.h.

◆ remove() [1/2]

void te::rst::RasterSummaryManager::remove ( const Raster raster)

Removes all summary ocurrences related to the specified raster pointer.

Parameters
rasterThe raster pointer to remove the summary.
Note
This is a thread safe method (an internal mutex is used).

◆ remove() [2/2]

void te::rst::RasterSummaryManager::remove ( const Raster raster,
const unsigned int  bandIndex,
const unsigned int  rowStart,
const unsigned int  colStart,
const unsigned int  finalRow,
const unsigned int  finalCol,
const unsigned int  histoBins,
const unsigned int  sampleStep 
)

Removes the summary from the specified raster.

Parameters
rasterThe raster to be found.
rowStartThe starting row.
colStartThe starting column.
finalRowThe final row.
finalColThe final column.
histoBinsThe number of bins (intervals from minimum pixel to maximum). When b = 0, the histogram will be divided according to all pixel values.
sampleStepThe row/column step used when reading pixels (to read all pixels sampleStep=1, to read half of pixels use sampleStep=2 );

◆ removeAll()

void te::rst::RasterSummaryManager::removeAll ( )

Removes all raster summary entries.

Note
This is a thread safe method (an internal mutex is used).
All cached info will be removed.

◆ setDefaultRasterHistSize()

void te::rst::RasterSummaryManager::setDefaultRasterHistSize ( const unsigned int  binsNumber)

Set the default rasters histograms bins.

Parameters
binsNumberHistograms bins number ( When b = 0, the histogram will be divided according to all pixel values.).

Friends And Related Function Documentation

◆ te::common::Singleton< RasterSummaryManager >

Definition at line 1 of file RasterSummaryManager.h.

Member Data Documentation

◆ m_defRastersHistBins

unsigned int te::rst::RasterSummaryManager::m_defRastersHistBins
private

Definition at line 247 of file RasterSummaryManager.h.

◆ m_enableDeletedRastersCache

bool te::rst::RasterSummaryManager::m_enableDeletedRastersCache
private

Definition at line 246 of file RasterSummaryManager.h.

◆ m_rasterSummaries

SummaryContT te::rst::RasterSummaryManager::m_rasterSummaries
private

A rasters band summaries.

Definition at line 248 of file RasterSummaryManager.h.

◆ m_syncMutex

std::mutex te::rst::RasterSummaryManager::m_syncMutex
mutableprivate

Internal mutex.

Definition at line 249 of file RasterSummaryManager.h.


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