29 #include "../../dataaccess/datasource/DataSource.h" 30 #include "../../dataaccess/datasource/DataSourceManager.h" 31 #include "../../dataaccess/utils/Utils.h" 32 #include "../../datatype/SimpleProperty.h" 33 #include "../../geometry/Geometry.h" 34 #include "../../geometry/GeometryProperty.h" 35 #include "../../memory/DataSet.h" 36 #include "../../memory/DataSetItem.h" 37 #include "../../raster/BandProperty.h" 38 #include "../../raster/Grid.h" 39 #include "../../raster/Raster.h" 40 #include "../../raster/RasterFactory.h" 41 #include "../../raster/Utils.h" 49 #include <boost/uuid/random_generator.hpp> 50 #include <boost/uuid/uuid_io.hpp> 86 std::unique_ptr<te::mem::DataSet> dataSet =
createDataSet(inputParams->
m_ds.get(), dsType);
135 std::vector<te::rst::BandProperty*> vecBandProp;
136 vecBandProp.push_back(bProp);
141 std::map<std::string, std::string> rInfo;
142 rInfo[
"URI"] = fileName;
159 boost::uuids::basic_random_generator<boost::mt19937> gen;
160 boost::uuids::uuid u = gen();
161 std::string id_ds = boost::uuids::to_string(u);
169 std::map<std::string, std::string> options;
171 ds->createDataSet(dsType, options);
181 std::vector<te::dt::Property*> propertyVec = dsType->
getProperties();
183 for(std::size_t t = 0; t < propertyVec.size(); ++t)
191 dataSetType->add(newProp);
196 dataSetType->add(kernelProperty);
214 for(std::size_t t = 0; t < nProp; ++t)
225 outDataset->add(outDSetItem);
KernelOperation()
Default constructor.
TESAEXPORT void GridAdaptRadiusKernel(te::sa::KernelInputParams *params, te::sa::KernelTree &kTree, te::sa::KernelMap &kMap, te::rst::Raster *raster)
Evaluates kernel value using a raster as output data and a adaptative value for radius.
void setDouble(std::size_t i, double value)
It sets the value of the i-th property.
An atomic property like an integer or double.
TESAEXPORT void GridStatRadiusKernel(te::sa::KernelInputParams *params, te::sa::KernelTree &kTree, te::sa::KernelMap &kMap, te::rst::Raster *raster, double radius)
Evaluates kernel value using a raster as output data and a fixed value for radius.
boost::shared_ptr< DataSource > DataSourcePtr
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib.
A raster band description.
A class that models the description of a dataset.
void saveDataSet(te::da::DataSet *dataSet, te::da::DataSetType *dsType)
std::unique_ptr< te::mem::DataSet > runDataSetKernel(te::sa::KernelInputParams *inputParams, te::sa::KernelTree &kTree, te::sa::KernelMap &kMap, te::da::DataSetType *dsType)
std::map< int, std::pair< te::gm::Geometry *, double > > KernelMap
void setValue(std::size_t i, te::dt::AbstractData *value)
It sets the value of the i-th property.
double getWidth() const
It returns the envelope width.
TERASTEREXPORT void FillRaster(te::rst::Raster *rin, const std::complex< double > &value)
Fill a Raster with provided value (all bands).
static te::dt::Date ds(2010, 01, 01)
double m_noDataValue
Value to indicate elements where there is no data, default is std::numeric_limits<double>::max().
virtual Property * clone() const =0
It returns a clone of the object.
Class that represents the kernel output parameters.
It models a property definition.
void setOutputParameters(te::sa::KernelOutputParams *outParams)
TESAEXPORT void DataSetAdaptRadiusKernel(te::sa::KernelInputParams *params, te::sa::KernelTree &kTree, te::sa::KernelMap &kMap, te::mem::DataSet *ds, int kernelIdx, int geomIdx)
Evaluates kernel value using a dataset as output data and a adaptative value for radius.
void runRasterKernel(te::sa::KernelInputParams *inputParams, te::sa::KernelTree &kTree, te::sa::KernelMap &kMap, te::rst::Raster *raster)
void setId(unsigned int id)
It sets the property identifier.
virtual bool moveNext()=0
It moves the internal pointer to the next item of the collection.
Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver...
const std::vector< Property * > & getProperties() const
It returns the list of properties describing the CompositeProperty.
int getSRID() const
It returns the spatial reference system identifier associated to this property.
static DataSourceManager & getInstance()
It returns a reference to the singleton instance.
An Envelope defines a 2D rectangular region.
An abstract class for raster data strucutures.
virtual ~KernelOperation()
Virtual destructor.
A base class for values that can be retrieved from the data access module.
Grid * getGrid()
It returns the raster grid.
Utility functions for the data access module.
An implementation of the DatasetItem class for the TerraLib In-Memory Data Access driver...
A dataset is the unit of information manipulated by the data access module of TerraLib.
std::unique_ptr< te::sa::KernelOutputParams > m_outputParams
Attribute with the kernel output parameters.
const te::gm::Envelope & getMBR(void) const
It returns the bounding box of all elements in the tree.
virtual std::unique_ptr< te::dt::AbstractData > getValue(std::size_t i) const
Method for retrieving any other type of data value stored in the data source.
virtual bool moveBeforeFirst()=0
It moves the internal pointer to a position before the first item in the collection.
static Raster * make()
It creates and returns an empty raster with default raster driver.
std::unique_ptr< te::mem::DataSet > createDataSet(te::da::DataSet *inputDataSet, te::da::DataSetType *dsType)
te::gm::Envelope * getExtent()
Returns the geographic extension of the grid.
This file contains a class that represents the kernel operation.
std::size_t getPropertyPosition(const std::string &name) const
It returns the property position based on its name.
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
virtual std::size_t getNumProperties() const =0
It returns the number of properties that composes an item of the dataset.
TESAEXPORT void DataSetStatRadiusKernel(te::sa::KernelInputParams *params, te::sa::KernelTree &kTree, te::sa::KernelMap &kMap, te::mem::DataSet *ds, int kernelIdx, int geomIdx, double radius)
Evaluates kernel value using a dataset as output data and a fixed value for radius.
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
A rectified grid is the spatial support for raster data.
std::unique_ptr< te::da::DataSetType > createDataSetType(te::da::DataSetType *dsType)
double getHeight() const
It returns the envelope height.
std::unique_ptr< te::rst::Raster > buildRaster(te::sa::KernelInputParams *inputParams, te::sa::KernelTree &kTree, std::string driver)
void setParent(Property *p)
It associate this property to the informed parent.