A concrete class to compute the buffer operation. More...
#include <BufferMemory.h>
Public Member Functions | |
| BufferMemory () | |
| Default constructor. More... | |
| virtual bool | paramsAreValid () |
| It verifies if the parameters are valid. More... | |
| bool | run () throw (te::common::Exception) |
| It executes the operation. More... | |
| void | setInput (te::da::DataSourcePtr inDsrc, std::string inDsetName, std::unique_ptr< te::da::DataSetTypeConverter > converter, const te::da::ObjectIdSet *oidSet=0) |
| It sets the input data will be calculated. More... | |
| void | setOutput (te::da::DataSourcePtr outDsrc, std::string dsname) |
| It sets the output parameters that will be used to persist operation result. More... | |
| void | setParams (const double &distance, const int &newSrid, const int &bufferPolygonRule, const int &bufferBoundariesRule, const bool ©InputColumns, const int &levels, const int &attributePosition=-1) |
| It sets the input parameters that will be consumed to execute the operation. More... | |
| ~BufferMemory () | |
| Destructor. More... | |
Protected Member Functions | |
| void | dissolveMemory (te::mem::DataSet *outDSet, const int &levels) |
| It dissolves the bounders between buffers. More... | |
| te::da::DataSetType * | GetDataSetType () |
| It builds the output DataSetType. More... | |
| double | getDistanceByAttribute (te::da::DataSet &dataSet, const int &position) |
| It returns the distance of buffer by the attribute chosen. More... | |
| te::gm::Geometry * | setBuffer (te::gm::Geometry *geom, const double &distance, const int &level, te::gm::Geometry *&auxGeom) |
| It executes the buffer operator. More... | |
Protected Attributes | |
| int | m_attributePosition |
| The buffer can be calculated by attribute values. The attribute must be numeric type. More... | |
| int | m_bufferBoundariesRule |
| The buffer boundary rule (DISSOLVE = 0 and NOT_DISSOLVE = 1). More... | |
| int | m_bufferPolygonRule |
| The buffer polygon rule (INSIDE_OUTSIDE = 0, ONLY_OUTSIDE = 1, ONLY_INSIDE = 2). More... | |
| std::unique_ptr< te::da::DataSetTypeConverter > | m_converter |
| The input datasettype. More... | |
| bool | m_copyInputColumns |
| Copy columns from input DataSet. More... | |
| double | m_distance |
| The fixed distance. More... | |
| std::string | m_inDsetName |
| The input dataset name. More... | |
| te::da::DataSourcePtr | m_inDsrc |
| The input datasource. More... | |
| int | m_levels |
| The number of levels buffer will have. More... | |
| int | m_newSRID |
| A new SRID if it's necessary to transform the data. More... | |
| const te::da::ObjectIdSet * | m_oidSet |
| The input objectid set. More... | |
| std::string | m_outDsetName |
| The output dataset name. More... | |
| te::da::DataSourcePtr | m_outDsrc |
| The output datasource. More... | |
A concrete class to compute the buffer operation.
Definition at line 62 of file BufferMemory.h.
|
default |
Default constructor.
|
default |
Destructor.
|
protected |
It dissolves the bounders between buffers.
| outDSet | The dataSet with buffers. |
| levels | The number of levels the dataset has. |
Definition at line 333 of file BufferMemory.cpp.
References te::mem::DataSet::add(), te::gm::GeometryCollection::add(), te::sam::rtree::Index< DATATYPE, MAXNODES, MINNODES >::clear(), te::mem::DataSet::clear(), te::gm::Geometry::difference(), te::mem::DataSet::getExtent(), te::mem::DataSet::getGeometry(), te::mem::DataSet::getInt32(), te::gm::Geometry::getMBR(), te::dt::CompositeProperty::getProperties(), te::da::GetPropertyPos(), te::sam::rtree::Index< DATATYPE, MAXNODES, MINNODES >::insert(), te::gm::Geometry::intersects(), te::mem::DataSet::isNull(), te::gm::Geometry::isValid(), te::vp::BufferOp::m_attributePosition, te::vp::BufferOp::m_converter, te::vp::BufferOp::m_distance, te::mem::DataSet::moveBeforeFirst(), te::mem::DataSet::moveNext(), te::gm::MultiPolygonType, te::sam::rtree::Index< DATATYPE, MAXNODES, MINNODES >::remove(), te::sam::rtree::Index< DATATYPE, MAXNODES, MINNODES >::search(), te::mem::DataSetItem::setDouble(), te::mem::DataSetItem::setGeometry(), te::mem::DataSetItem::setInt32(), te::vp::SplitGeometryCollection(), and te::gm::Geometry::Union().
Referenced by run().
|
protectedinherited |
It builds the output DataSetType.
Definition at line 96 of file BufferOp.cpp.
References te::da::PrimaryKey::add(), te::da::DataSetType::add(), te::gm::GeometryProperty::clone(), te::dt::DOUBLE_TYPE, te::dt::GEOMETRY_TYPE, te::da::GetFirstGeomProperty(), te::dt::INT32_TYPE, te::vp::BufferOp::m_converter, te::vp::BufferOp::m_copyInputColumns, te::vp::BufferOp::m_outDsetName, te::gm::MultiPolygonType, p, te::dt::SimpleProperty::setAutoNumber(), te::gm::GeometryProperty::setGeometryType(), te::da::DataSetType::setPrimaryKey(), and te::gm::GeometryProperty::setSRID().
Referenced by te::vp::BufferQuery::run(), and run().
|
protected |
It returns the distance of buffer by the attribute chosen.
| dataSet | The input dataSet with the value. |
| position | The position of attribute in dataSet. |
Definition at line 477 of file BufferMemory.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::da::DataSet::getDouble(), te::da::DataSet::getFloat(), te::da::DataSet::getInt16(), te::da::DataSet::getInt32(), te::da::DataSet::getInt64(), te::da::DataSet::getPropertyDataType(), te::dt::INT16_TYPE, te::dt::INT32_TYPE, te::dt::INT64_TYPE, te::da::DataSet::isNull(), TE_TR, te::dt::UINT16_TYPE, te::dt::UINT32_TYPE, and te::dt::UINT64_TYPE.
Referenced by run().
|
virtualinherited |
It verifies if the parameters are valid.
Definition at line 85 of file BufferOp.cpp.
References te::vp::BufferOp::m_converter, te::vp::BufferOp::m_outDsetName, and te::vp::BufferOp::m_outDsrc.
Referenced by BufferOGRToOGR(), BufferOGRToPGIS(), BufferPGISToOGR(), BufferPGISToPGIS(), and te::vp::BufferDialog::onOkPushButtonClicked().
|
virtual | |||||||||||||
It executes the operation.
Implements te::vp::BufferOp.
Definition at line 67 of file BufferMemory.cpp.
References te::da::CreateAdapter(), te::vp::DISSOLVE, dissolveMemory(), te::dt::DOUBLE_TYPE, te::dt::GEOMETRY_TYPE, te::vp::BufferOp::GetDataSetType(), getDistanceByAttribute(), te::da::GetFirstGeomProperty(), te::mem::DataSetItem::getPropertyDataType(), te::gm::GeometryProperty::getSRID(), te::dt::INT32_TYPE, te::dt::INT64_TYPE, te::vp::BufferOp::m_attributePosition, te::vp::BufferOp::m_bufferBoundariesRule, te::vp::BufferOp::m_converter, te::vp::BufferOp::m_copyInputColumns, te::vp::BufferOp::m_distance, te::vp::BufferOp::m_inDsetName, te::vp::BufferOp::m_inDsrc, te::vp::BufferOp::m_levels, te::vp::BufferOp::m_newSRID, te::vp::BufferOp::m_oidSet, te::vp::BufferOp::m_outDsrc, te::gm::MultiPolygonType, te::vp::Save(), setBuffer(), te::mem::DataSetItem::setDouble(), te::mem::DataSetItem::setGeometry(), te::mem::DataSetItem::setInt32(), te::mem::DataSetItem::setInt64(), te::mem::DataSetItem::setString(), te::dt::STRING_TYPE, TE_LOG_ERROR, TE_LOG_INFO, and te::common::Exception::what().
|
protected |
It executes the buffer operator.
| geom | The input geometry. |
| distance | The distance to set buffer. |
| level | How many levels the buffer will have. |
| auxGeom | The auxiliar geometry that represents the previous buffer result. This parameter is important when the buffer result has more than one level. |
Definition at line 271 of file BufferMemory.cpp.
References te::gm::Geometry::buffer(), te::gm::CapButtType, te::dt::AbstractData::clone(), te::gm::Geometry::difference(), te::vp::INSIDE_OUTSIDE, te::gm::Geometry::isValid(), te::vp::BufferOp::m_bufferPolygonRule, te::vp::ONLY_INSIDE, te::vp::ONLY_OUTSIDE, and TE_LOG_INFO.
Referenced by run().
|
inherited |
It sets the input data will be calculated.
| inDsrc | Where data is located. |
| inDsetName | DataSet name. |
| converter | DataSetTypeConverterr. |
| oidSet | ObjectIdSet - It is necessary if has need to execute with a set of specific objects |
Definition at line 51 of file BufferOp.cpp.
References te::vp::BufferOp::m_converter, te::vp::BufferOp::m_inDsetName, te::vp::BufferOp::m_inDsrc, and te::vp::BufferOp::m_oidSet.
Referenced by BufferOGRToOGR(), BufferOGRToPGIS(), BufferPGISToOGR(), BufferPGISToPGIS(), and te::vp::BufferDialog::onOkPushButtonClicked().
|
inherited |
It sets the output parameters that will be used to persist operation result.
| outDsrc | Where data is will be persisted. |
| dsname | The name os output data. |
Definition at line 79 of file BufferOp.cpp.
References te::vp::BufferOp::m_outDsetName, and te::vp::BufferOp::m_outDsrc.
Referenced by BufferOGRToOGR(), BufferOGRToPGIS(), BufferPGISToOGR(), BufferPGISToPGIS(), and te::vp::BufferDialog::onOkPushButtonClicked().
|
inherited |
It sets the input parameters that will be consumed to execute the operation.
| distance | A numeric value to set a fixed distance to buffer. |
| bufferPolygonRule | The rule used for buffer result (INSIDE_OUTSIDE = 0, ONLY_OUTSIDE = 1, ONLY_INSIDE = 2). |
| bufferBoundariesRule | The BoundariesBetweenBuffers can be dissolved or not - (DISSOLVE = 0 and NOT_DISSOLVE = 1). |
| copyInputColumns | Copy columns from input DataSet. |
| levels | The number of levels buffer will have. |
| attributePosition | The buffer can be calculated by attribute values. The attribute must be numeric type. |
Definition at line 62 of file BufferOp.cpp.
References te::vp::BufferOp::m_attributePosition, te::vp::BufferOp::m_bufferBoundariesRule, te::vp::BufferOp::m_bufferPolygonRule, te::vp::BufferOp::m_copyInputColumns, te::vp::BufferOp::m_distance, te::vp::BufferOp::m_levels, and te::vp::BufferOp::m_newSRID.
Referenced by BufferOGRToOGR(), BufferOGRToPGIS(), BufferPGISToOGR(), BufferPGISToPGIS(), and te::vp::BufferDialog::onOkPushButtonClicked().
|
protectedinherited |
The buffer can be calculated by attribute values. The attribute must be numeric type.
Definition at line 148 of file BufferOp.h.
Referenced by dissolveMemory(), te::vp::BufferQuery::run(), run(), and te::vp::BufferOp::setParams().
|
protectedinherited |
The buffer boundary rule (DISSOLVE = 0 and NOT_DISSOLVE = 1).
Definition at line 145 of file BufferOp.h.
Referenced by te::vp::BufferQuery::run(), run(), and te::vp::BufferOp::setParams().
|
protectedinherited |
The buffer polygon rule (INSIDE_OUTSIDE = 0, ONLY_OUTSIDE = 1, ONLY_INSIDE = 2).
Definition at line 144 of file BufferOp.h.
Referenced by te::vp::BufferQuery::run(), setBuffer(), and te::vp::BufferOp::setParams().
|
protectedinherited |
The input datasettype.
Definition at line 139 of file BufferOp.h.
Referenced by dissolveMemory(), te::vp::BufferOp::GetDataSetType(), te::vp::BufferOp::paramsAreValid(), te::vp::BufferQuery::run(), run(), and te::vp::BufferOp::setInput().
|
protectedinherited |
Copy columns from input DataSet.
Definition at line 146 of file BufferOp.h.
Referenced by te::vp::BufferOp::GetDataSetType(), te::vp::BufferQuery::run(), run(), and te::vp::BufferOp::setParams().
|
protectedinherited |
The fixed distance.
Definition at line 142 of file BufferOp.h.
Referenced by dissolveMemory(), te::vp::BufferQuery::run(), run(), and te::vp::BufferOp::setParams().
|
protectedinherited |
The input dataset name.
Definition at line 138 of file BufferOp.h.
Referenced by run(), and te::vp::BufferOp::setInput().
|
protectedinherited |
The input datasource.
Definition at line 137 of file BufferOp.h.
Referenced by te::vp::BufferQuery::run(), run(), and te::vp::BufferOp::setInput().
|
protectedinherited |
The number of levels buffer will have.
Definition at line 147 of file BufferOp.h.
Referenced by te::vp::BufferQuery::run(), run(), and te::vp::BufferOp::setParams().
|
protectedinherited |
A new SRID if it's necessary to transform the data.
Definition at line 143 of file BufferOp.h.
Referenced by te::vp::BufferQuery::run(), run(), and te::vp::BufferOp::setParams().
|
protectedinherited |
The input objectid set.
Definition at line 140 of file BufferOp.h.
Referenced by te::vp::BufferQuery::run(), run(), and te::vp::BufferOp::setInput().
|
protectedinherited |
The output dataset name.
Definition at line 151 of file BufferOp.h.
Referenced by te::vp::BufferOp::GetDataSetType(), te::vp::BufferOp::paramsAreValid(), and te::vp::BufferOp::setOutput().
|
protectedinherited |
The output datasource.
Definition at line 150 of file BufferOp.h.
Referenced by te::vp::BufferOp::paramsAreValid(), te::vp::BufferQuery::run(), run(), and te::vp::BufferOp::setOutput().