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...
 
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. 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...
 
int getTotalNumberOfDistinctValues (te::da::DataSet *fromDs, const std::string &propertyName, std::vector< std::vector< te::dt::AbstractData * > > &dataValues)
 
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::unique_ptr< te::mem::DataSet > result, std::unique_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 ( )
default

Constructor.

Referenced by normalizeClassName().

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

Definition at line 78 of file VectorToVectorMemory.cpp.

References te::common::FreeContents(), and m_mapGeom.

Member Function Documentation

bool te::attributefill::VectorToVectorMemory::checkGeometries ( te::gm::Geometry fromGeom,
std::size_t  fromPos,
te::gm::Geometry toGeom 
)
protected
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.

Definition at line 983 of file VectorToVectorMemory.cpp.

References checkGeometries(), getArea(), getDataBasedOnType(), te::da::GetFirstSpatialPropertyPos(), te::da::DataSet::getGeometry(), te::da::DataSet::getPropertyDataType(), te::da::GetPropertyIndex(), te::attributefill::VectorToVectorOp::m_hasErrors, m_mapGeom, and TE_LOG_INFO.

Referenced by run().

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.

Definition at line 908 of file VectorToVectorMemory.cpp.

References getDataBasedOnType(), te::stat::GetNumericStatisticalSummary(), te::da::DataSet::getPropertyDataType(), te::da::GetPropertyIndex(), te::stat::GetStringStatisticalSummary(), te::stat::StringStatisticalSummary::m_minVal, te::stat::NumericStatisticalSummary::m_minVal, te::stat::Mode(), and te::dt::STRING_TYPE.

Referenced by run().

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.

Definition at line 1443 of file VectorToVectorMemory.cpp.

References te::dt::INT16_TYPE, te::dt::INT32_TYPE, te::dt::INT64_TYPE, te::dt::STRING_TYPE, TE_TR, te::dt::UINT16_TYPE, te::dt::UINT32_TYPE, and te::dt::UINT64_TYPE.

Referenced by getClassWithHighestIntersectionArea(), and getClassWithHighestOccurrence().

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.

Definition at line 884 of file VectorToVectorMemory.cpp.

References te::da::DataSet::getNumProperties(), te::da::DataSet::getValue(), te::da::DataSet::isNull(), and te::da::DataSet::move().

Referenced by run().

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.

Definition at line 578 of file VectorToVectorMemory.cpp.

References te::da::DataSet::getAsString(), te::da::DataSet::isNull(), te::da::DataSet::moveBeforeFirst(), and te::da::DataSet::moveNext().

Referenced by getOutputDataSetType().

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".

Definition at line 693 of file VectorToVectorMemory.cpp.

References te::da::GetFirstSpatialPropertyPos(), te::da::DataSet::getGeometry(), te::gm::Geometry::isValid(), m_mapGeom, and te::sam::rtree::Index< DATATYPE, MAXNODES, MINNODES >::search().

Referenced by run().

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.

Definition at line 1537 of file VectorToVectorMemory.cpp.

References te::common::FreeContents(), getAllPointsOfGeometry(), te::da::GetFirstSpatialPropertyPos(), te::da::DataSet::getGeometry(), te::gm::Point::getX(), te::gm::Point::getY(), te::sam::kdtree::AdaptativeIndex< KdTreeNode >::nearestNeighborSearch(), and p.

Referenced by run().

double te::attributefill::VectorToVectorMemory::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 
)
protected

It get the minimum distance of objects centroid 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.

Definition at line 1575 of file VectorToVectorMemory.cpp.

References te::gm::Geometry::contains(), te::da::GetFirstSpatialPropertyPos(), te::da::DataSet::getGeometry(), te::gm::Geometry::getMBR(), te::gm::Geometry::getSRID(), te::gm::Geometry::intersects(), m_mapGeom, te::sam::kdtree::AdaptativeIndex< KdTreeNode >::nearestNeighborSearch(), te::sam::rtree::Index< DATATYPE, MAXNODES, MINNODES >::search(), te::gm::Point::setSRID(), te::gm::Point::transform(), te::gm::Coord2D::x, and te::gm::Coord2D::y.

Referenced by run().

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.

Definition at line 869 of file VectorToVectorMemory.cpp.

References te::stat::NumericStatisticalSummary::m_mode.

Referenced by run().

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.

Definition at line 723 of file VectorToVectorMemory.cpp.

References te::dt::CDOUBLE_TYPE, te::dt::CFLOAT_TYPE, te::dt::CINT16_TYPE, te::dt::CINT32_TYPE, te::dt::DOUBLE_TYPE, te::dt::FLOAT_TYPE, te::dt::INT16_TYPE, te::dt::INT32_TYPE, te::dt::INT64_TYPE, te::dt::UINT16_TYPE, te::dt::UINT32_TYPE, and te::dt::UINT64_TYPE.

Referenced by run().

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.

Definition at line 440 of file VectorToVectorMemory.cpp.

References te::da::DataSetType::add(), te::da::AssociateDataSetTypeConverterSRID(), te::dt::Property::clone(), te::attributefill::COUNT_DISTINCT, te::da::CreateAdapter(), te::dt::DOUBLE_TYPE, te::dt::GEOMETRY_TYPE, getDistinctClasses(), te::dt::Property::getName(), te::da::DataSetType::getPrimaryKey(), te::da::PrimaryKey::getProperties(), te::dt::CompositeProperty::getProperties(), getPropertyName(), te::da::DataSetTypeConverter::getResult(), te::dt::Property::getType(), te::attributefill::HIGHEST_INTERSECTION, te::attributefill::HIGHEST_OCCURRENCE, te::dt::INT32_TYPE, te::attributefill::VectorToVectorOp::m_fromLayer, te::attributefill::VectorToVectorOp::m_options, te::attributefill::VectorToVectorOp::m_outDset, te::attributefill::VectorToVectorOp::m_outDsrc, te::attributefill::VectorToVectorOp::m_toLayer, te::attributefill::VectorToVectorOp::m_toLayerProps, te::attributefill::MIN_DISTANCE, te::attributefill::MIN_DISTANCE_CENTROID, te::attributefill::MODE, normalizeClassName(), te::attributefill::PERCENT_CLASS, te::attributefill::PERCENT_EACH_CLASS, te::attributefill::PERCENT_TOTAL_AREA, te::attributefill::PRESENCE, te::da::DataSetType::remove(), te::dt::SimpleProperty::setAutoNumber(), te::dt::SimpleProperty::setDefaultValue(), te::dt::Property::setName(), te::dt::SimpleProperty::setRequired(), te::da::DataSetType::setTitle(), te::dt::STRING_TYPE, and te::attributefill::VALUE.

Referenced by run().

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.

Definition at line 1150 of file VectorToVectorMemory.cpp.

References checkGeometries(), getArea(), te::da::GetFirstSpatialPropertyPos(), te::da::DataSet::getGeometry(), te::da::GetPropertyIndex(), te::attributefill::VectorToVectorOp::m_hasErrors, and m_mapGeom.

Referenced by run().

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.

Definition at line 1113 of file VectorToVectorMemory.cpp.

References checkGeometries(), getArea(), te::da::GetFirstSpatialPropertyPos(), te::da::DataSet::getGeometry(), te::attributefill::VectorToVectorOp::m_hasErrors, and m_mapGeom.

Referenced by run().

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.

Definition at line 1064 of file VectorToVectorMemory.cpp.

References te::da::GetPropertyIndex(), and normalizeClassName().

Referenced by run().

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.

Definition at line 601 of file VectorToVectorMemory.cpp.

References te::common::FreeContents(), te::da::GetFirstSpatialPropertyPos(), te::da::DataSet::getGeometry(), te::sam::rtree::Index< DATATYPE, MAXNODES, MINNODES >::insert(), te::da::DataSet::isNull(), m_mapGeom, te::da::DataSet::moveBeforeFirst(), and te::da::DataSet::moveNext().

Referenced by run().

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.

Definition at line 759 of file VectorToVectorMemory.cpp.

References te::dt::STRING_TYPE.

Referenced by run().

int te::attributefill::VectorToVectorMemory::getTotalNumberOfDistinctValues ( te::da::DataSet fromDs,
const std::string &  propertyName,
std::vector< std::vector< te::dt::AbstractData * > > &  dataValues 
)
protected

Definition at line 781 of file VectorToVectorMemory.cpp.

References te::da::GetPropertyIndex().

Referenced by run().

std::string te::attributefill::VectorToVectorMemory::getValue ( te::stat::StringStatisticalSummary  ss,
te::attributefill::OperationType  type 
)
protected
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.

Definition at line 1202 of file VectorToVectorMemory.cpp.

References checkGeometries(), getArea(), te::da::GetFirstSpatialPropertyPos(), te::da::DataSet::getGeometry(), te::da::GetPropertyIndex(), te::attributefill::VectorToVectorOp::m_hasErrors, and m_mapGeom.

Referenced by run().

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.

Definition at line 1250 of file VectorToVectorMemory.cpp.

References checkGeometries(), getArea(), te::da::GetFirstSpatialPropertyPos(), te::da::DataSet::getGeometry(), te::da::GetPropertyIndex(), te::attributefill::VectorToVectorOp::m_hasErrors, and m_mapGeom.

Referenced by run().

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.

Definition at line 1729 of file VectorToVectorMemory.cpp.

References te::attributefill::VectorToVectorOp::m_options, te::attributefill::MIN_DISTANCE, te::attributefill::MIN_DISTANCE_CENTROID, and te::attributefill::PRESENCE.

Referenced by run().

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.

Definition at line 1309 of file VectorToVectorMemory.cpp.

References te::gm::LineStringMType, te::gm::LineStringType, te::gm::LineStringZMType, and te::gm::LineStringZType.

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.

Definition at line 1342 of file VectorToVectorMemory.cpp.

References te::gm::MultiLineStringMType, te::gm::MultiLineStringType, te::gm::MultiLineStringZMType, and te::gm::MultiLineStringZType.

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.

Definition at line 1353 of file VectorToVectorMemory.cpp.

References te::gm::MultiPointMType, te::gm::MultiPointType, te::gm::MultiPointZMType, and te::gm::MultiPointZType.

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.

Definition at line 1331 of file VectorToVectorMemory.cpp.

References te::gm::MultiPolygonMType, te::gm::MultiPolygonType, te::gm::MultiPolygonZMType, and te::gm::MultiPolygonZType.

Referenced by getArea().

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.

Definition at line 1320 of file VectorToVectorMemory.cpp.

References te::gm::PointMType, te::gm::PointType, te::gm::PointZMType, and te::gm::PointZType.

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.

Definition at line 1298 of file VectorToVectorMemory.cpp.

References te::gm::PolygonMType, te::gm::PolygonType, te::gm::PolygonZMType, and te::gm::PolygonZType.

Referenced by getArea().

bool te::attributefill::VectorToVectorMemory::isStatistical ( te::attributefill::OperationType  type)
protected
bool te::attributefill::VectorToVectorMemory::isToLayerOGR ( )
protected
void te::attributefill::VectorToVectorMemory::normalizeClassName ( std::string &  name)
protected
bool te::attributefill::VectorToVectorOp::paramsAreValid ( )
virtualinherited

Definition at line 71 of file VectorToVectorOp.cpp.

bool te::attributefill::VectorToVectorMemory::run ( )
virtual

It execute the operations.

Returns
True if execute.

Implements te::attributefill::VectorToVectorOp.

Definition at line 84 of file VectorToVectorMemory.cpp.

References te::da::AssociateDataSetTypeConverterSRID(), te::common::Exception::code(), te::attributefill::COUNT_DISTINCT, te::da::CreateAdapter(), te::common::FreeContents(), getClassWithHighestIntersectionArea(), getClassWithHighestOccurrence(), getDataValues(), getIntersections(), getKDtree(), getMinimumDistance(), getMinimumDistanceFromCentroid(), getModeValue(), te::dt::Property::getName(), te::stat::GetNumericStatisticalSummary(), getNumValues(), getOutputDataSetType(), getPercentageOfEachClassByArea(), getPercentageOfTotalArea(), getPercentagePerClass(), te::da::PrimaryKey::getProperties(), getPropertyName(), te::da::DataSetTypeConverter::getResult(), getRtree(), te::stat::GetStringStatisticalSummary(), getStrValues(), getTotalNumberOfDistinctValues(), te::dt::Property::getType(), getValue(), getWeightedByArea(), getWeightedSumByArea(), hasNoIntersectionOperations(), te::attributefill::HIGHEST_INTERSECTION, te::attributefill::HIGHEST_OCCURRENCE, te::gm::Envelope::intersects(), te::common::TaskProgress::isActive(), isStatistical(), te::attributefill::VectorToVectorOp::m_fromLayer, te::attributefill::VectorToVectorOp::m_hasErrors, te::stat::StringStatisticalSummary::m_minVal, te::stat::NumericStatisticalSummary::m_minVal, te::attributefill::VectorToVectorOp::m_options, te::attributefill::VectorToVectorOp::m_outDsrc, te::attributefill::VectorToVectorOp::m_toLayer, te::attributefill::MIN_DISTANCE, te::attributefill::MIN_DISTANCE_CENTROID, te::attributefill::MODE, te::stat::Mode(), normalizeClassName(), te::attributefill::PERCENT_CLASS, te::attributefill::PERCENT_EACH_CLASS, te::attributefill::PERCENT_TOTAL_AREA, te::attributefill::PRESENCE, te::common::TaskProgress::pulse(), te::attributefill::VectorToVectorOp::save(), te::mem::DataSetItem::setDouble(), te::mem::DataSetItem::setInt32(), te::mem::DataSetItem::setString(), te::common::TaskProgress::setTotalSteps(), te::mem::DataSetItem::setValue(), te::dt::STRING_TYPE, TE_LOG_DEBUG, TE_LOG_INFO, TE_TR, te::gm::Envelope::transform(), te::common::TaskProgress::useTimer(), te::attributefill::VALUE, te::attributefill::WEIGHTED, te::attributefill::WEIGHTED_SUM, and te::common::Exception::what().

bool te::attributefill::VectorToVectorOp::save ( std::unique_ptr< te::mem::DataSet result,
std::unique_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
std::map<std::string, std::vector<te::attributefill::OperationType> > te::attributefill::VectorToVectorOp::m_options
protectedinherited
std::string te::attributefill::VectorToVectorOp::m_outDset
protectedinherited
te::da::DataSourcePtr te::attributefill::VectorToVectorOp::m_outDsrc
protectedinherited
te::map::AbstractLayerPtr te::attributefill::VectorToVectorOp::m_toLayer
protectedinherited
std::vector<std::string> te::attributefill::VectorToVectorOp::m_toLayerProps
protectedinherited

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