26 #ifndef __TERRALIB_ATTRIBUTEFILL_INTERNAL_VECTORTOVECTORMEMORY_H
27 #define __TERRALIB_ATTRIBUTEFILL_INTERNAL_VECTORTOVECTORMEMORY_H
30 #include "../dataaccess/dataset/DataSet.h"
31 #include "../dataaccess/dataset/DataSetType.h"
32 #include "../dataaccess/datasource/DataSource.h"
33 #include "../datatype/Property.h"
34 #include "../maptools/AbstractLayer.h"
35 #include "../memory/DataSet.h"
36 #include "../sam/kdtree.h"
37 #include "../sam/rtree/Index.h"
68 namespace attributefill
205 std::vector<std::size_t> dsPos);
214 std::vector<double>
getNumValues(std::vector< std::vector<te::dt::AbstractData*> > dataValues, std::size_t pos);
223 std::vector<std::string>
getStrValues(std::vector< std::vector<te::dt::AbstractData*> > dataValues, std::size_t pos);
226 const std::string& propertyName,
227 std::vector< std::vector<te::dt::AbstractData*> >& dataValues);
269 std::vector<std::size_t> dsPos,
270 const std::string& propertyName,
271 std::vector< std::vector<te::dt::AbstractData*> >& dataValues);
289 std::size_t fromSrid,
290 std::vector<std::size_t> dsPos,
291 const std::string& propertyName,
292 std::vector< std::vector<te::dt::AbstractData*> >& dataValues);
315 std::vector<std::size_t> dsPos,
316 const std::string& propertyName,
317 std::vector< std::vector<te::dt::AbstractData*> >& dataValues);
335 std::size_t fromSrid,
336 std::vector<std::size_t> dsPos,
337 const std::string& propertyName,
338 std::vector< std::vector<te::dt::AbstractData*> >& dataValues);
356 std::size_t fromSrid,
357 std::vector<std::size_t> dsPos,
358 const std::string& propertyName,
359 std::vector< std::vector<te::dt::AbstractData*> >& dataValues);
377 std::size_t fromSrid,
378 std::vector<std::size_t> dsPos,
379 const std::string& propertyName,
380 std::vector< std::vector<te::dt::AbstractData*> >& dataValues);
398 std::size_t fromSrid,
399 std::vector<std::size_t> dsPos,
400 const std::string& propertyName,
401 std::vector< std::vector<te::dt::AbstractData*> >& dataValues);
419 std::size_t fromSrid,
420 std::vector<std::size_t> dsPos,
421 const std::string& propertyName,
422 std::vector< std::vector<te::dt::AbstractData*> >& dataValues);
438 std::size_t fromSrid,
455 std::size_t fromSrid,
te::sam::kdtree::AdaptativeIndex< KD_ADAPTATIVE_NODE > KD_ADAPTATIVE_TREE
te::sam::kdtree::AdaptativeNode< te::gm::Coord2D, std::vector< te::gm::Point >, te::gm::Point > KD_ADAPTATIVE_NODE
Vector To Vector operation.
std::map< std::size_t, te::gm::Geometry * > m_mapGeom
std::vector< std::string > getStrValues(std::vector< std::vector< te::dt::AbstractData * > > dataValues, std::size_t pos)
It get the string values of a vector of abstract data.
bool isLine(te::gm::GeomType type)
It verify if the geometry is a line.
KD_ADAPTATIVE_TREE * getKDtree(te::da::DataSet *data, std::size_t toSrid)
It return a KDTree.
std::vector< std::string > getDistinctClasses(te::da::DataSet *fromDs, const std::string &propertyName)
It return distincts values of a property from the "From" data set.
te::sam::rtree::Index< size_t, 8 > * getRtree(te::da::DataSet *data)
It return a RTree with data set iterator position information.
te::dt::AbstractData * getDataBasedOnType(const std::string &strValue, const int type)
It get a abstract data with the value based on the type.
bool isMultiPoint(te::gm::GeomType type)
It verify if the geometry is a multi point.
std::vector< double > getNumValues(std::vector< std::vector< te::dt::AbstractData * > > dataValues, std::size_t pos)
It get the numeric values of a vector of abstract data.
bool isPolygon(te::gm::GeomType type)
It verify if the geometry is a polygon.
double getMinimumDistance(te::da::DataSet *toDs, std::size_t toSrid, te::da::DataSet *fromDs, std::size_t fromSrid, KD_ADAPTATIVE_TREE *kdtree)
It get the minimum distance of objects that not intersect.
bool isStatistical(te::attributefill::OperationType type)
It verify if the operation is a statistical operation.
std::string getModeValue(te::stat::NumericStatisticalSummary ss)
It get a string with the mode operation format.
bool isMultiLine(te::gm::GeomType type)
It verify if the geometry is a multi line.
std::vector< std::size_t > getIntersections(te::da::DataSet *toDs, te::da::DataSet *fromDs, te::sam::rtree::Index< size_t, 8 > *rtree, bool &hasInvalid)
It verify all intersection between the "From" and "To" data sets.
bool checkGeometries(te::gm::Geometry *fromGeom, std::size_t fromPos, te::gm::Geometry *toGeom)
std::string getPropertyName(te::dt::Property *prop, te::attributefill::OperationType func)
It return a name based on original property name and the selected operation.
bool run()
It execute the operations.
bool isMultiPolygon(te::gm::GeomType type)
It verify if the geometry is a multi polygon.
std::vector< std::vector< te::dt::AbstractData * > > getDataValues(te::da::DataSet *fromDs, std::vector< std::size_t > dsPos)
It get the value of all positions in "To" data set that has intersection with a position of "From" da...
std::map< std::string, double > getPercentagePerClass(te::da::DataSet *fromDs, std::vector< std::size_t > dsPos, const std::string &propertyName, std::vector< std::vector< te::dt::AbstractData * > > &dataValues)
It get the percent per class from "From" data set in "To" data set.
void setInput(te::map::AbstractLayerPtr fromLayer, te::map::AbstractLayerPtr toLayer)
It set the input informations.
te::da::DataSetType * getOutputDataSetType()
It create a data set type based on selecteds properties and operations.
bool isPoint(te::gm::GeomType type)
It verify if the geometry is a point.
std::string getValue(te::stat::StringStatisticalSummary ss, te::attributefill::OperationType type)
It get the value of required operation type from string statistical summary.
double getPercentageOfTotalArea(te::da::DataSet *toDs, std::size_t toSrid, te::da::DataSet *fromDs, std::size_t fromSrid, std::vector< std::size_t > dsPos, const std::string &propertyName, std::vector< std::vector< te::dt::AbstractData * > > &dataValues)
It get the percentage of intersection area in the total area.
std::map< std::string, double > getPercentageOfEachClassByArea(te::da::DataSet *toDs, std::size_t toSrid, te::da::DataSet *fromDs, std::size_t fromSrid, std::vector< std::size_t > dsPos, const std::string &propertyName, std::vector< std::vector< te::dt::AbstractData * > > &dataValues)
It get the percentage of each class intersection area in the total area.
double getValue(te::stat::NumericStatisticalSummary ss, te::attributefill::OperationType type)
It get the value of required operation type from numeric statistical summary.
void setOutput(te::da::DataSourcePtr outDsrc, std::string dsName)
It set output.
VectorToVectorMemory()
Constructor.
bool hasNoIntersectionOperations()
Verify if has operations that don't need the intersections.
void normalizeClassName(std::string &name)
double getWeightedSumByArea(te::da::DataSet *toDs, std::size_t toSrid, te::da::DataSet *fromDs, std::size_t fromSrid, std::vector< std::size_t > dsPos, const std::string &propertyName, std::vector< std::vector< te::dt::AbstractData * > > &dataValues)
It get the sum of weighted average if intersections values.
double getArea(te::gm::Geometry *geom)
It get the area of a geometry.
double getWeightedByArea(te::da::DataSet *toDs, std::size_t toSrid, te::da::DataSet *fromDs, std::size_t fromSrid, std::vector< std::size_t > dsPos, const std::string &propertyName, std::vector< std::vector< te::dt::AbstractData * > > &dataValues)
It get the weighted average if intersections values.
void setParams(const std::map< te::dt::Property *, std::vector< std::string > > &options)
It set the params used to execute.
double getMinimumDistanceFromCentroid(te::da::DataSet *toDs, std::size_t toSrid, te::da::DataSet *fromDs, std::size_t fromSrid, KD_ADAPTATIVE_TREE *kdtree, te::sam::rtree::Index< size_t, 8 > *rtree)
It get the minimum distance of objects centroid that not intersect.
std::map< std::string, double > getTotalAreaByClass(te::da::DataSet *toDs, std::size_t toSrid, te::da::DataSet *fromDs, std::size_t fromSrid, std::vector< std::size_t > dsPos, const std::string &propertyName, std::vector< std::vector< te::dt::AbstractData * > > &dataValues)
It get the total area of each class intersection.
te::dt::AbstractData * getClassWithHighestIntersectionArea(te::da::DataSet *toDs, std::size_t toSrid, te::da::DataSet *fromDs, std::size_t fromSrid, std::vector< std::size_t > dsPos, const std::string &propertyName, std::vector< std::vector< te::dt::AbstractData * > > &dataValues)
It get the class with highest intersection area from "From" data set in "To" data set.
te::dt::AbstractData * getClassWithHighestOccurrence(te::da::DataSet *fromDs, std::vector< std::size_t > dsPos, const std::string &propertyName, std::vector< std::vector< te::dt::AbstractData * > > &dataValues)
It get the class with highest occurrence from "From" data set in "To" data set.
std::vector< te::gm::Point * > getAllPointsOfGeometry(te::gm::Geometry *geom)
It get all points of a geometry.
int getTotalNumberOfDistinctValues(te::da::DataSet *fromDs, const std::string &propertyName, std::vector< std::vector< te::dt::AbstractData * > > &dataValues)
A class that models the description of a dataset.
A dataset is the unit of information manipulated by the data access module of TerraLib.
A base class for values that can be retrieved from the data access module.
It models a property definition.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
A point with x and y coordinate values.
A class that represents a two dimensional K-d Tree (2-d Tree) that store data-elements into the leafs...
A class that represents an Kd-tree node.
A class that represents an R-tree.
OperationType
Define grouping operations type.
boost::shared_ptr< DataSource > DataSourcePtr
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
A structure to hold the set of statistics from a set of numerical values.
A structure to hold the set of statistics from a set of categorical (sample) values.
#define TEATTRIBUTEFILLEXPORT
You can use this macro in order to export/import classes and functions from this module.
Proxy configuration file for TerraView (see terraview_config.h).