28 #include "../common/progress/TaskProgress.h" 
   29 #include "../common/Logger.h" 
   30 #include "../common/Translator.h" 
   32 #include "../dataaccess/dataset/DataSet.h" 
   33 #include "../dataaccess/utils/Utils.h" 
   35 #include "../geometry/GeometryProperty.h" 
   37 #include "../memory/DataSet.h" 
   38 #include "../memory/DataSetItem.h" 
   55   std::auto_ptr<te::da::DataSetType> outDsType = buildOutDataSetType();
 
   57   std::auto_ptr<te::da::DataSetType> inDsType = m_inDsrc->getDataSetType(m_inDsetName);
 
   59   std::string geomName = geomProp->
getName();
 
   61   std::auto_ptr<te::da::DataSet> inDset;
 
   64     inDset = m_inDsrc->getDataSet(m_inDsetName);
 
   66     inDset = m_inDsrc->getDataSet(m_inDsetName, m_oidSet);
 
   68   std::auto_ptr<te::mem::DataSet> outDSet(
new te::mem::DataSet(outDsType.get()));
 
   74   inDset->moveBeforeFirst();
 
   75   while(inDset->moveNext())
 
   78     bool geomState = 
true;
 
   88         std::auto_ptr<te::gm::Geometry> geom = inDset->getGeometry(geomName);
 
   95         std::auto_ptr<te::gm::MultiPolygon> polygonResult = line2Polygon(geom.get());
 
   96         if(!polygonResult->isValid() || polygonResult->isEmpty())
 
  105     outDSet->add(outDsItem);
 
  108       throw te::vp::Exception(
TE_TR(
"Operation canceled!"));
 
  113   te::vp::Save(m_outDsrc.get(), outDSet.get(), outDsType.get());
 
  119   std::vector<te::gm::Polygon*> polygons;
 
  122   getPolygons(geom, polygons);
 
  124   if(polygons.size() > 1)
 
  126     for(std::size_t i = 0; i < polygons.size(); ++i)
 
  127       polygonResult->add(polygons[i]);
 
  131     polygonResult->add(polygons[0]);
 
  134   return polygonResult;
 
  145       getPolygons(dynamic_cast<te::gm::GeometryCollection*>(geom), polygons);
 
  149       getPolygons(dynamic_cast<te::gm::LineString*>(geom), polygons);
 
  175     for(std::size_t i = 0; i < l->
getNPoints(); ++i)
 
  180     getPolygons(p, polygons);
 
  187   polygons.push_back(p);
 
std::size_t getNumGeometries() const 
It returns the number of geometries in this GeometryCollection. 
 
void add(Curve *ring)
It adds the ring to the curve polygon. 
 
int getSRID() const 
It returns the Spatial Reference System ID associated to this geometric object. 
 
MultiPolygon is a MultiSurface whose elements are Polygons. 
 
void setGeometry(std::size_t i, te::gm::Geometry *value)
It sets the value of the i-th property. 
 
Utility functions for the data access module. 
 
std::string getPropertyName(std::size_t pos) const 
It returns the name of the pos-th property. 
 
std::auto_ptr< te::gm::MultiPolygon > line2Polygon(te::gm::Geometry *geom)
 
int getPropertyDataType(std::size_t pos) const 
It returns the type of the pos-th property. 
 
void useTimer(bool flag)
Used to define if task use progress timer information. 
 
void Save(te::da::DataSource *source, te::da::DataSet *result, te::da::DataSetType *outDsType)
 
This class can be used to inform the progress of a task. 
 
void setValue(std::size_t i, te::dt::AbstractData *value)
It sets the value of the i-th property. 
 
#define TE_TR(message)
It marks a string in order to get translated. 
 
std::size_t getNumProperties() const 
It returns the number of properties. 
 
bool isActive() const 
Verify if the task is active. 
 
bool isClosed() const 
It returns true if the curve is closed (startPoint = endPoint). 
 
const double & getY(std::size_t i) const 
It returns the n-th y coordinate value. 
 
void setTotalSteps(int value)
Set the task total stepes. 
 
A LinearRing is a LineString that is both closed and simple. 
 
Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver...
 
LineString is a curve with linear interpolation between points. 
 
void getPolygons(te::gm::Geometry *geom, std::vector< te::gm::Polygon * > &polygons)
 
void setPoint(std::size_t i, const double &x, const double &y)
It sets the value of the specified point. 
 
const double & getX(std::size_t i) const 
It returns the n-th x coordinate value. 
 
std::size_t getNPoints() const 
It returns the number of points (vertexes) in the linestring. 
 
void pulse()
Calls setCurrentStep() function using getCurrentStep() + 1. 
 
GeomType getGeomTypeId() const 
It returns the geometry subclass type identifier. 
 
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards. 
 
Geometry * getGeometryN(std::size_t i) const 
It returns the n-th geometry in this GeometryCollection. 
 
An implementation of the DatasetItem class for the TerraLib In-Memory Data Access driver...
 
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings. 
 
It is a collection of other geometric objects. 
 
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
 
Line to Polygon Vector Processing functions. 
 
const std::string & getName() const 
It returns the property name.