All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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)
 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)
 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
< te::dt::AbstractData * > 
getDataValues (te::da::DataSet *fromDs, std::vector< std::size_t > dsPos, const std::string &propertyName)
 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)
 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< te::dt::AbstractData * > data)
 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)
 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)
 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)
 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< te::dt::AbstractData * > data)
 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)
 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)
 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...
 
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
 

Detailed Description

Definition at line 76 of file VectorToVectorMemory.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 71 of file VectorToVectorMemory.cpp.

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

Definition at line 76 of file VectorToVectorMemory.cpp.

Member Function Documentation

bool te::attributefill::VectorToVectorMemory::checkGeometries ( te::gm::Geometry fromGeom,
std::size_t  fromPos,
te::gm::Geometry toGeom 
)
protected

Definition at line 1467 of file VectorToVectorMemory.cpp.

References te::gm::Geometry::isValid(), and TE_TR.

double te::attributefill::VectorToVectorMemory::getArea ( te::gm::Geometry geom)
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 
)
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.
Returns
The class value.

Definition at line 804 of file VectorToVectorMemory.cpp.

References te::da::DataSet::getAsString(), te::da::GetFirstSpatialPropertyPos(), te::da::DataSet::getGeometry(), te::da::DataSet::getPropertyDataType(), te::da::GetPropertyIndex(), and te::da::DataSet::move().

te::dt::AbstractData * te::attributefill::VectorToVectorMemory::getClassWithHighestOccurrence ( te::da::DataSet fromDs,
std::vector< std::size_t >  dsPos,
const std::string &  propertyName 
)
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.
Returns
The class value.

Definition at line 741 of file VectorToVectorMemory.cpp.

References te::da::DataSet::getAsString(), te::da::DataSet::getPropertyDataType(), te::da::GetPropertyIndex(), and te::da::DataSet::move().

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

std::vector< te::dt::AbstractData * > te::attributefill::VectorToVectorMemory::getDataValues ( te::da::DataSet fromDs,
std::vector< std::size_t >  dsPos,
const std::string &  propertyName 
)
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 723 of file VectorToVectorMemory.cpp.

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

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 453 of file VectorToVectorMemory.cpp.

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

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 
)
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.
Returns
A vector of positions that "To" data set has intersection with "From".

Definition at line 553 of file VectorToVectorMemory.cpp.

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

KD_ADAPTATIVE_TREE * te::attributefill::VectorToVectorMemory::getKDtree ( te::da::DataSet data,
std::size_t  toSrid 
)
protected
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 1319 of file VectorToVectorMemory.cpp.

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

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 708 of file VectorToVectorMemory.cpp.

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

std::vector< double > te::attributefill::VectorToVectorMemory::getNumValues ( std::vector< te::dt::AbstractData * >  data)
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 584 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.

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 
)
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.
Returns
Map of class and percentage.

Definition at line 970 of file VectorToVectorMemory.cpp.

References te::da::DataSet::getAsString(), te::da::GetFirstSpatialPropertyPos(), te::da::DataSet::getGeometry(), and te::da::DataSet::move().

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 
)
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.
Returns
The percentage.

Definition at line 931 of file VectorToVectorMemory.cpp.

References te::da::GetFirstSpatialPropertyPos(), te::da::DataSet::getGeometry(), and te::da::DataSet::move().

std::map< std::string, double > te::attributefill::VectorToVectorMemory::getPercentagePerClass ( te::da::DataSet fromDs,
std::vector< std::size_t >  dsPos,
const std::string &  propertyName 
)
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.
Returns
Map with class value and percentage.

Definition at line 886 of file VectorToVectorMemory.cpp.

References te::da::DataSet::getAsString(), and te::da::DataSet::move().

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 473 of file VectorToVectorMemory.cpp.

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

std::vector< std::string > te::attributefill::VectorToVectorMemory::getStrValues ( std::vector< te::dt::AbstractData * >  data)
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 618 of file VectorToVectorMemory.cpp.

References te::dt::STRING_TYPE.

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 
)
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.
Returns
The weighted average.

Definition at line 1021 of file VectorToVectorMemory.cpp.

References te::da::DataSet::getAsString(), te::da::GetFirstSpatialPropertyPos(), te::da::DataSet::getGeometry(), te::da::DataSet::isNull(), and te::da::DataSet::move().

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 
)
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.
Returns
The sum of weighted average.

Definition at line 1071 of file VectorToVectorMemory.cpp.

References te::da::DataSet::getAsString(), te::da::GetFirstSpatialPropertyPos(), te::da::DataSet::getGeometry(), te::da::DataSet::isNull(), and te::da::DataSet::move().

bool te::attributefill::VectorToVectorOp::hasErrors ( )
inherited

Definition at line 140 of file VectorToVectorOp.cpp.

bool te::attributefill::VectorToVectorMemory::hasNoIntersectionOperations ( )
protected

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

Returns
True if has.

Definition at line 1447 of file VectorToVectorMemory.cpp.

References te::attributefill::MIN_DISTANCE, and te::attributefill::PRESENCE.

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 1132 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 1165 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 1176 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 1154 of file VectorToVectorMemory.cpp.

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

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 1143 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 1121 of file VectorToVectorMemory.cpp.

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

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

Definition at line 72 of file VectorToVectorOp.cpp.

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

Definition at line 60 of file VectorToVectorOp.cpp.

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::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 files: