te::attributefill::VectorToVectorMemory Class Reference

#include <VectorToVectorMemory.h>

Inheritance diagram for te::attributefill::VectorToVectorMemory:
te::attributefill::VectorToVectorOp

Public Member Functions

bool hasErrors ()
 
virtual bool paramsAreValid ()
 
bool run ()
 It execute the operations. More...
 
void setInput (te::map::AbstractLayerPtr fromLayer, te::map::AbstractLayerPtr toLayer)
 It set the input informations. More...
 
void setOutput (te::da::DataSourcePtr outDsrc, std::string dsName)
 It set output. More...
 
void setParams (const std::map< std::string, std::vector< te::attributefill::OperationType > > &options, std::vector< std::string > toLayerProps)
 
void setParams (const std::map< te::dt::Property *, std::vector< std::string > > &options)
 It set the params used to execute. More...
 
 VectorToVectorMemory ()
 Constructor. More...
 
 ~VectorToVectorMemory ()
 

Protected Member Functions

bool checkGeometries (te::gm::Geometry *fromGeom, std::size_t fromPos, te::gm::Geometry *toGeom)
 
std::vector< te::gm::Point * > getAllPointsOfGeometry (te::gm::Geometry *geom)
 It get all points of a geometry. More...
 
double getArea (te::gm::Geometry *geom)
 It get the area of a geometry. More...
 
te::dt::AbstractDatagetClassWithHighestIntersectionArea (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. More...
 
te::dt::AbstractDatagetClassWithHighestOccurrence (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. More...
 
te::dt::AbstractDatagetDataBasedOnType (const std::string &strValue, const int type)
 It get a abstract data with the value based on the type. More...
 
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" data set. More...
 
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. More...
 
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. More...
 
KD_ADAPTATIVE_TREEgetKDtree (te::da::DataSet *data, std::size_t toSrid)
 It return a KDTree. More...
 
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. More...
 
std::string getModeValue (te::stat::NumericStatisticalSummary ss)
 It get a string with the mode operation format. More...
 
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. More...
 
te::da::DataSetTypegetOutputDataSetType ()
 It create a data set type based on selecteds properties and operations. More...
 
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. More...
 
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. More...
 
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. More...
 
std::string getPropertyName (te::dt::Property *prop, te::attributefill::OperationType func)
 It return a name based on original property name and the selected operation. More...
 
te::sam::rtree::Index< size_t, 8 > * getRtree (te::da::DataSet *data)
 It return a RTree with data set iterator position information. More...
 
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. More...
 
double getValue (te::stat::NumericStatisticalSummary ss, te::attributefill::OperationType type)
 It get the value of required operation type from numeric statistical summary. More...
 
std::string getValue (te::stat::StringStatisticalSummary ss, te::attributefill::OperationType type)
 It get the value of required operation type from string statistical summary. More...
 
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. More...
 
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. More...
 
bool hasNoIntersectionOperations ()
 Verify if has operations that don't need the intersections. More...
 
bool isLine (te::gm::GeomType type)
 It verify if the geometry is a line. More...
 
bool isMultiLine (te::gm::GeomType type)
 It verify if the geometry is a multi line. More...
 
bool isMultiPoint (te::gm::GeomType type)
 It verify if the geometry is a multi point. More...
 
bool isMultiPolygon (te::gm::GeomType type)
 It verify if the geometry is a multi polygon. More...
 
bool isPoint (te::gm::GeomType type)
 It verify if the geometry is a point. More...
 
bool isPolygon (te::gm::GeomType type)
 It verify if the geometry is a polygon. More...
 
bool isStatistical (te::attributefill::OperationType type)
 It verify if the operation is a statistical operation. More...
 
bool isToLayerOGR ()
 
void normalizeClassName (std::string &name)
 
bool save (std::auto_ptr< te::mem::DataSet > result, std::auto_ptr< te::da::DataSetType > outDsType)
 

Protected Attributes

te::map::AbstractLayerPtr m_fromLayer
 
bool m_hasErrors
 
std::map< std::string, std::vector< te::attributefill::OperationType > > m_options
 
std::string m_outDset
 
te::da::DataSourcePtr m_outDsrc
 
te::map::AbstractLayerPtr m_toLayer
 
std::vector< std::string > m_toLayerProps
 

Private Attributes

std::map< std::size_t, te::gm::Geometry * > m_mapGeom
 

Detailed Description

Definition at line 76 of file VectorToVectorMemory.h.

Constructor & Destructor Documentation

te::attributefill::VectorToVectorMemory::VectorToVectorMemory ( )

Constructor.

te::attributefill::VectorToVectorMemory::~VectorToVectorMemory ( )

Member Function Documentation

bool te::attributefill::VectorToVectorMemory::checkGeometries ( te::gm::Geometry fromGeom,
std::size_t  fromPos,
te::gm::Geometry toGeom 
)
protected
std::vector<te::gm::Point*> te::attributefill::VectorToVectorMemory::getAllPointsOfGeometry ( te::gm::Geometry geom)
protected

It get all points of a geometry.

Parameters
geomThe geometry.
Returns
Vector of points.
double te::attributefill::VectorToVectorMemory::getArea ( te::gm::Geometry geom)
protected

It get the area of a geometry.

Parameters
geomThe geometry.
Returns
The area.
te::dt::AbstractData* te::attributefill::VectorToVectorMemory::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 
)
protected

It get the class with highest intersection area from "From" data set in "To" data set.

Parameters
toDsThe "To" data set.
toSridThe "To" data set srid.
fromDsThe "From" data set.
fromSridThe "From" data set srid.
dsPosVector of "To" data set positions that intersect "From".
propertyNameRequired property name.
dataValuesVector that contains all values of the item that intersects the "To" data set. (line and columns).
Returns
The class value.
te::dt::AbstractData* te::attributefill::VectorToVectorMemory::getClassWithHighestOccurrence ( te::da::DataSet fromDs,
std::vector< std::size_t >  dsPos,
const std::string &  propertyName,
std::vector< std::vector< te::dt::AbstractData * > > &  dataValues 
)
protected

It get the class with highest occurrence from "From" data set in "To" data set.

Parameters
fromDsThe "From" data set.
dsPosVector of "To" data set positions that intersect "From".
propertyNameRequired property name.
dataValuesVector that contains all values of the item that intersects the "To" data set. (line and columns).
Returns
The class value.
te::dt::AbstractData* te::attributefill::VectorToVectorMemory::getDataBasedOnType ( const std::string &  strValue,
const int  type 
)
protected

It get a abstract data with the value based on the type.

Parameters
strValueThe string value.
typeThe value type.
Returns
The value.
std::vector<std::vector<te::dt::AbstractData*> > te::attributefill::VectorToVectorMemory::getDataValues ( te::da::DataSet fromDs,
std::vector< std::size_t >  dsPos 
)
protected

It get the value of all positions in "To" data set that has intersection with a position of "From" data set.

Parameters
fromDsThe "From" data set.
dsPosVector of intersections positions.
propertyNameThe property name.
Note
The fromDs iterator must be in the correct position.
Returns
A vector of values.
std::vector<std::string> te::attributefill::VectorToVectorMemory::getDistinctClasses ( te::da::DataSet fromDs,
const std::string &  propertyName 
)
protected

It return distincts values of a property from the "From" data set.

Parameters
fromDsThe "From" data set.
propertyNameThe property name with the information.
Returns
A vector of string values.
std::vector<std::size_t> te::attributefill::VectorToVectorMemory::getIntersections ( te::da::DataSet toDs,
te::da::DataSet fromDs,
te::sam::rtree::Index< size_t, 8 > *  rtree,
bool &  hasInvalid 
)
protected

It verify all intersection between the "From" and "To" data sets.

Parameters
toDsThe "To" data set.
fromDsThe "From" data set.
rtreeA generated RTree based on the "From" data set.
hasInvalidSet true if there are any invalid geometry as intersection candidate.
Returns
A vector of positions that "To" data set has intersection with "From".
KD_ADAPTATIVE_TREE* te::attributefill::VectorToVectorMemory::getKDtree ( te::da::DataSet data,
std::size_t  toSrid 
)
protected

It return a KDTree.

Parameters
dataThe Data Set.
toSridData Set srid.
Returns
The KDtree.
double te::attributefill::VectorToVectorMemory::getMinimumDistance ( te::da::DataSet toDs,
std::size_t  toSrid,
te::da::DataSet fromDs,
std::size_t  fromSrid,
KD_ADAPTATIVE_TREE kdtree 
)
protected

It get the minimum distance of objects that not intersect.

Parameters
toDsThe "To" data set.
toSridThe "To" data set srid.
fromDsThe "From" data set.
fromSridThe "From" data set srid.
kdtreeA generated KDTree based on the "From" data set.
Returns
The minimum distance.
std::string te::attributefill::VectorToVectorMemory::getModeValue ( te::stat::NumericStatisticalSummary  ss)
protected

It get a string with the mode operation format.

Parameters
ssThe string statistical summary.
Returns
The string value.
std::vector<double> te::attributefill::VectorToVectorMemory::getNumValues ( std::vector< std::vector< te::dt::AbstractData * > >  dataValues,
std::size_t  pos 
)
protected

It get the numeric values of a vector of abstract data.

Parameters
dataVector of abstract data.
Returns
A vector of double values.
te::da::DataSetType* te::attributefill::VectorToVectorMemory::getOutputDataSetType ( )
protected

It create a data set type based on selecteds properties and operations.

Returns
A Data Set Type.
std::map<std::string, double> te::attributefill::VectorToVectorMemory::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 
)
protected

It get the percentage of each class intersection area in the total area.

Parameters
toDsThe "To" data set.
toSridThe "To" data set srid.
fromDsThe "From" data set.
fromSridThe "From" data set srid.
dsPosVector of "To" data set positions that intersect "From".
propertyNameRequired property name.
dataValuesVector that contains all values of the item that intersects the "To" data set. (line and columns).
Returns
Map of class and percentage.
double te::attributefill::VectorToVectorMemory::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 
)
protected

It get the percentage of intersection area in the total area.

Parameters
toDsThe "To" data set.
toSridThe "To" data set srid.
fromDsThe "From" data set.
fromSridThe "From" data set srid.
dsPosVector of "To" data set positions that intersect "From".
propertyNameRequired property name.
dataValuesVector that contains all values of the item that intersects the "To" data set. (line and columns).
Returns
The percentage.
std::map<std::string, double> te::attributefill::VectorToVectorMemory::getPercentagePerClass ( te::da::DataSet fromDs,
std::vector< std::size_t >  dsPos,
const std::string &  propertyName,
std::vector< std::vector< te::dt::AbstractData * > > &  dataValues 
)
protected

It get the percent per class from "From" data set in "To" data set.

Parameters
fromDsThe "From" data set.
dsPosVector of "To" data set positions that intersect "From".
propertyNameRequired property name.
dataValuesVector that contains all values of the item that intersects the "To" data set. (line and columns).
Returns
Map with class value and percentage.
std::string te::attributefill::VectorToVectorMemory::getPropertyName ( te::dt::Property prop,
te::attributefill::OperationType  func 
)
protected

It return a name based on original property name and the selected operation.

Parameters
propThe original property.
funcThe selected operation.
Returns
A name based on the property and operation.
te::sam::rtree::Index<size_t, 8>* te::attributefill::VectorToVectorMemory::getRtree ( te::da::DataSet data)
protected

It return a RTree with data set iterator position information.

Parameters
dataThe Data Set.
Returns
The Rtree.
std::vector<std::string> te::attributefill::VectorToVectorMemory::getStrValues ( std::vector< std::vector< te::dt::AbstractData * > >  dataValues,
std::size_t  pos 
)
protected

It get the string values of a vector of abstract data.

Parameters
dataVector of abstract data.
Returns
A vector of string values.
double te::attributefill::VectorToVectorMemory::getValue ( te::stat::NumericStatisticalSummary  ss,
te::attributefill::OperationType  type 
)
protected

It get the value of required operation type from numeric statistical summary.

Parameters
ssThe numeric statistical summary.
typeRequired operation type.
Returns
The double value.
std::string te::attributefill::VectorToVectorMemory::getValue ( te::stat::StringStatisticalSummary  ss,
te::attributefill::OperationType  type 
)
protected

It get the value of required operation type from string statistical summary.

Parameters
ssThe string statistical summary.
typeRequired operation type.
Returns
The string value.
double te::attributefill::VectorToVectorMemory::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 
)
protected

It get the weighted average if intersections values.

Parameters
toDsThe "To" data set.
toSridThe "To" data set srid.
fromDsThe "From" data set.
fromSridThe "From" data set srid.
dsPosVector of "To" data set positions that intersect "From".
propertyNameRequired property name.
dataValuesVector that contains all values of the item that intersects the "To" data set. (line and columns).
Returns
The weighted average.
double te::attributefill::VectorToVectorMemory::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 
)
protected

It get the sum of weighted average if intersections values.

Parameters
toDsThe "To" data set.
toSridThe "To" data set srid.
fromDsThe "From" data set.
fromSridThe "From" data set srid.
dsPosVector of "To" data set positions that intersect "From".
propertyNameRequired property name.
dataValuesVector that contains all values of the item that intersects the "To" data set. (line and columns).
Returns
The sum of weighted average.
bool te::attributefill::VectorToVectorOp::hasErrors ( )
inherited
bool te::attributefill::VectorToVectorMemory::hasNoIntersectionOperations ( )
protected

Verify if has operations that don't need the intersections.

Returns
True if has.
bool te::attributefill::VectorToVectorMemory::isLine ( te::gm::GeomType  type)
protected

It verify if the geometry is a line.

Parameters
typeThe geometry type.
Returns
True if were line.
bool te::attributefill::VectorToVectorMemory::isMultiLine ( te::gm::GeomType  type)
protected

It verify if the geometry is a multi line.

Parameters
typeThe geometry type.
Returns
True if were multi line.
bool te::attributefill::VectorToVectorMemory::isMultiPoint ( te::gm::GeomType  type)
protected

It verify if the geometry is a multi point.

Parameters
typeThe geometry type.
Returns
True if were multi point.
bool te::attributefill::VectorToVectorMemory::isMultiPolygon ( te::gm::GeomType  type)
protected

It verify if the geometry is a multi polygon.

Parameters
typeThe geometry type.
Returns
True if were multi polygon.
bool te::attributefill::VectorToVectorMemory::isPoint ( te::gm::GeomType  type)
protected

It verify if the geometry is a point.

Parameters
typeThe geometry type.
Returns
True if were potin.
bool te::attributefill::VectorToVectorMemory::isPolygon ( te::gm::GeomType  type)
protected

It verify if the geometry is a polygon.

Parameters
typeThe geometry type.
Returns
True if were polygon.
bool te::attributefill::VectorToVectorMemory::isStatistical ( te::attributefill::OperationType  type)
protected

It verify if the operation is a statistical operation.

Parameters
typeThe operation type.
Returns
True if the operation were statistical.
bool te::attributefill::VectorToVectorMemory::isToLayerOGR ( )
protected
void te::attributefill::VectorToVectorMemory::normalizeClassName ( std::string &  name)
protected
virtual bool te::attributefill::VectorToVectorOp::paramsAreValid ( )
virtualinherited
bool te::attributefill::VectorToVectorMemory::run ( )
virtual

It execute the operations.

Returns
True if execute.

Implements te::attributefill::VectorToVectorOp.

bool te::attributefill::VectorToVectorOp::save ( std::auto_ptr< te::mem::DataSet result,
std::auto_ptr< te::da::DataSetType outDsType 
)
protectedinherited
void te::attributefill::VectorToVectorMemory::setInput ( te::map::AbstractLayerPtr  fromLayer,
te::map::AbstractLayerPtr  toLayer 
)

It set the input informations.

Parameters
fromLayerTe "From" Layer.
toLayerThe "To" Layer.
void te::attributefill::VectorToVectorMemory::setOutput ( te::da::DataSourcePtr  outDsrc,
std::string  dsName 
)

It set output.

Parameters
outDsrcThe Data Source that will be the result.
dsNameThe name of output data set.
void te::attributefill::VectorToVectorOp::setParams ( const std::map< std::string, std::vector< te::attributefill::OperationType > > &  options,
std::vector< std::string >  toLayerProps 
)
inherited
void te::attributefill::VectorToVectorMemory::setParams ( const std::map< te::dt::Property *, std::vector< std::string > > &  options)

It set the params used to execute.

Parameters
optionsProperty and string vector map with informations about which property was selected and which operations were selected to this property.

Member Data Documentation

te::map::AbstractLayerPtr te::attributefill::VectorToVectorOp::m_fromLayer
protectedinherited

Definition at line 83 of file VectorToVectorOp.h.

bool te::attributefill::VectorToVectorOp::m_hasErrors
protectedinherited

Definition at line 81 of file VectorToVectorOp.h.

std::map<std::size_t, te::gm::Geometry*> te::attributefill::VectorToVectorMemory::m_mapGeom
private

Definition at line 502 of file VectorToVectorMemory.h.

std::map<std::string, std::vector<te::attributefill::OperationType> > te::attributefill::VectorToVectorOp::m_options
protectedinherited

Definition at line 86 of file VectorToVectorOp.h.

std::string te::attributefill::VectorToVectorOp::m_outDset
protectedinherited

Definition at line 90 of file VectorToVectorOp.h.

te::da::DataSourcePtr te::attributefill::VectorToVectorOp::m_outDsrc
protectedinherited

Definition at line 89 of file VectorToVectorOp.h.

te::map::AbstractLayerPtr te::attributefill::VectorToVectorOp::m_toLayer
protectedinherited

Definition at line 84 of file VectorToVectorOp.h.

std::vector<std::string> te::attributefill::VectorToVectorOp::m_toLayerProps
protectedinherited

Definition at line 87 of file VectorToVectorOp.h.


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