28 #include "../common/progress/TaskProgress.h" 29 #include "../core/logger/Logger.h" 30 #include "../core/translator/Translator.h" 32 #include "../dataaccess/dataset/DataSet.h" 33 #include "../dataaccess/dataset/DataSetType.h" 35 #include "../datatype/Property.h" 36 #include "../datatype/SimpleProperty.h" 37 #include "../datatype/StringProperty.h" 39 #include "../dataaccess/dataset/ObjectIdSet.h" 40 #include "../dataaccess/query/And.h" 41 #include "../dataaccess/query/DataSetName.h" 42 #include "../dataaccess/query/Expression.h" 43 #include "../dataaccess/query/Field.h" 44 #include "../dataaccess/query/Fields.h" 45 #include "../dataaccess/query/From.h" 46 #include "../dataaccess/query/FromItem.h" 47 #include "../dataaccess/query/Join.h" 48 #include "../dataaccess/query/JoinConditionOn.h" 49 #include "../dataaccess/query/LiteralInt32.h" 50 #include "../dataaccess/query/PropertyName.h" 51 #include "../dataaccess/query/Select.h" 52 #include "../dataaccess/query/ST_Intersection.h" 53 #include "../dataaccess/query/ST_Intersects.h" 54 #include "../dataaccess/query/ST_Transform.h" 55 #include "../dataaccess/query/Where.h" 56 #include "../dataaccess/utils/Utils.h" 58 #include "../geometry/Geometry.h" 59 #include "../geometry/GeometryCollection.h" 60 #include "../geometry/GeometryProperty.h" 61 #include "../geometry/Utils.h" 63 #include "../memory/DataSet.h" 64 #include "../memory/DataSetItem.h" 100 for(std::size_t i = 0; i < firstProps.size(); ++i)
103 fields->push_back(f_field);
106 for(std::size_t i = 0; i < secondProps.size(); ++i)
109 fields->push_back(f_field);
117 if (firstGeomSource->getSRID() != firstGeom->getSRID())
128 if (secondGeomSource->getSRID() != secondGeom->getSRID())
140 fields->push_back(f_intersection);
151 from->push_back(join);
173 std::unique_ptr<te::da::DataSet> dsQuery =
m_inFirstDsrc->query(select);
174 dsQuery->moveBeforeFirst();
176 if(dsQuery->size() == 0)
180 std::unique_ptr<te::da::DataSetType> outDataSetType(
getOutputDsType());
182 std::unique_ptr<te::da::DataSet> outDset(this->
updateGeomType(outDataSetType.get(), dsQuery.release()));
184 outDset->moveBeforeFirst();
195 std::size_t type = 0;
196 std::vector<te::dt::Property*> props = dsType->
getProperties();
201 std::string propName;
206 for(std::size_t i = 1; i < props.size(); ++i)
208 type = props[i]->getType();
209 propName = props[i]->getName();
213 if (!ds->
isNull(propName))
215 std::unique_ptr<te::dt::AbstractData> value = ds->
getValue(propName);
216 dsItem->
setValue(i, value.release());
221 std::unique_ptr<te::gm::Geometry> geom = ds->
getGeometry(propName);
233 newGeom->add(geom.release());
246 newGeom->add(geom.release());
259 newGeom->add(geom.release());
An exception class for the Vector processing module.
virtual std::unique_ptr< te::gm::Geometry > getGeometry(std::size_t i) const =0
Method for retrieving a geometric attribute value.
std::vector< te::dt::Property * > getTabularProps(te::da::DataSetType *dsType)
std::string m_inSecondDsetName
te::da::DataSetType * getOutputDsType()
void setGeometry(std::size_t i, te::gm::Geometry *value)
It sets the value of the i-th property.
An abstract class that models a source of data in a query.
The Field class can be used to model an expression that takes part of the output items of a SELECT...
Spatial intersects operator.
A class that models the name of a dataset used in a From clause.
Intersection Vector Processing functions.
const te::da::ObjectIdSet * m_firstOidSet
A class that models the name of any property of an object.
Base exception class for plugin module.
A class that models the description of a dataset.
void setValue(std::size_t i, te::dt::AbstractData *value)
It sets the value of the i-th property.
static te::dt::Date ds(2010, 01, 01)
#define TE_TR(message)
It marks a string in order to get translated.
te::da::DataSourcePtr m_inSecondDsrc
Boolean logic operator: AND.
This is an abstract class that models a query expression.
void add(DataSetItem *item)
It adds a new item to the dataset and takes its ownership.
void setInt32(std::size_t i, boost::int32_t value)
It sets the value of the i-th property.
virtual bool moveNext()=0
It moves the internal pointer to the next item of the collection.
TEVPEXPORT void Save(te::da::DataSource *source, te::da::DataSet *result, te::da::DataSetType *outDsType, const bool &enableProgress=true)
Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver...
void setWhere(Where *w)
It sets the filter codition.
const std::vector< Property * > & getProperties() const
It returns the list of properties describing the CompositeProperty.
boost::ptr_vector< Field > Fields
Fields is just a boost::ptr_vector of Field pointers.
A class that can be used to model a filter expression that can be applied to a query.
std::unique_ptr< te::da::DataSetTypeConverter > m_firstConverter
A Join clause combines two FromItems.
Utility functions for the data access module.
te::da::DataSourcePtr m_outDsrc
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
std::string m_inFirstDsetName
A Select models a query to be used when retrieving data from a DataSource.
te::da::DataSourcePtr m_inFirstDsrc
boost::ptr_vector< FromItem > From
It models the FROM clause for a query.
std::unique_ptr< te::da::DataSetTypeConverter > m_secondConverter
An implementation of the DatasetItem class for the TerraLib In-Memory Data Access driver...
A dataset is the unit of information manipulated by the data access module of TerraLib.
virtual std::unique_ptr< te::dt::AbstractData > getValue(std::size_t i) const
Method for retrieving any other type of data value stored in the data source.
Spatial intersection operator.
te::da::DataSet * updateGeomType(te::da::DataSetType *dsType, te::da::DataSet *ds)
Configuration flags for the Terrralib Vector Processing module.
Expression * getExpressionByInClause(const std::string source="") const
virtual bool isNull(std::size_t i) const =0
It checks if the attribute value is NULL.
JoinConditionOn is a boolean expression and it specifies which items in a join are considered to matc...
It is a collection of other geometric objects.
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
void setFields(Fields *f)
It sets the list of output expressions used to form the result set.
void setFrom(From *f)
It sets the list of source information.
const te::da::ObjectIdSet * m_secondOidSet