27 #include "../common/StringUtils.h" 28 #include "../core/translator/Translator.h" 37 #include <boost/lexical_cast.hpp> 52 params.push_back(std::pair<std::string, std::string>(
"MAXMEMPERCENTUSED",
"40"));
53 params.push_back(std::pair<std::string, std::string>(
"MAXNUMBEROFRAMBLOCKS",
"1"));
62 const std::vector<te::rst::BandProperty*>
bands,
63 const std::map<std::string, std::string>& rinfo,
65 void (*deleter)(
void*))
67 std::unique_ptr<te::rst::Raster> rasterPtr;
69 if( rinfo.find(
"MAXNUMBEROFRAMBLOCKS" ) != rinfo.end() )
71 unsigned int maxNumberOfRAMBlocks = boost::lexical_cast<
unsigned int >( rinfo.find(
"MAXNUMBEROFRAMBLOCKS" )->second );
74 else if( rinfo.find(
"MAXMEMPERCENTUSED" ) != rinfo.end() )
76 unsigned int maxMemPercentUsed = boost::lexical_cast<
unsigned int>( rinfo.find(
"MAXMEMPERCENTUSED" )->second );
77 if( maxMemPercentUsed > 100 )
82 rasterPtr.reset(
new ExpansibleRaster( (
unsigned char)maxMemPercentUsed, g, bands ) );
89 return rasterPtr.release();
99 return std::map<std::string, std::string>();
A raster (stored in memory and eventually swapped to disk) where it is possible to dynamically add li...
ExpansibleRasterFactory()
Base exception class for plugin module.
An exception class for the TerraLib In-Memory Data Access driver.
static void initialize()
It initializes the factory: the singleton instance will be registered in the abstract factory DataSou...
#define TE_TR(message)
It marks a string in order to get translated.
te::rst::Raster * build()
Concrete factories (derived from this one) must implement this method in order to create objects...
te::rst::Raster * create(te::rst::Grid *g, const std::vector< te::rst::BandProperty * > bands, const std::map< std::string, std::string > &rinfo, void *h=0, void(*deleter)(void *)=0)
This method must be implemented by subclasses (raster drivers).
An abstract class for raster data strucutures.
This is the abstract factory for Rasters.
~ExpansibleRasterFactory()
static std::string sg_expansibleRasterFactoryId("EXPANSIBLE")
void getCreationalParameters(std::vector< std::pair< std::string, std::string > > ¶ms) const
It returns the list of parameters accepted as raster info.
A raster (stored in memory and eventually swapped to disk) where it is possible to dynamically add li...
This is the concrete factory for expansible raster.
const std::string & getType() const
Returns the type (name) of this factory.
A rectified grid is the spatial support for raster data.
static ExpansibleRasterFactory * sm_factoryPointer
std::map< std::string, std::string > getCapabilities() const
It returns a map<string, string> containing all supported formats.
static void finalize()
It finalizes the factory: the singleton instance will be destroyed and will be unregistered from the ...