27 #include "../common/STLUtils.h" 28 #include "../dataaccess/dataset/DataSet.h" 29 #include "../dataaccess/dataset/DataSetAdapter.h" 30 #include "../dataaccess/dataset/DataSetType.h" 31 #include "../dataaccess/dataset/DataSetTypeConverter.h" 32 #include "../dataaccess/datasource/DataSource.h" 33 #include "../dataaccess/datasource/DataSourceFactory.h" 34 #include "../dataaccess/utils/Utils.h" 35 #include "../datatype/StringProperty.h" 36 #include "../geometry/GeometryProperty.h" 37 #include "../geometry/MultiPolygon.h" 38 #include "../geometry/Polygon.h" 39 #include "../memory/DataSet.h" 40 #include "../memory/DataSetItem.h" 44 #include <boost/filesystem.hpp> 56 std::map<std::string, te::cl::ROI*>::iterator it =
m_roiMap.find(label);
71 std::map<std::string, te::cl::ROI*>::iterator it =
m_roiMap.find(label);
85 std::unique_ptr<te::da::DataSetType> dsType =
getDataSetType(srid);
88 std::string connInfo(
"file://" + fileName);
93 boost::filesystem::path uri(fileName);
95 std::string val = uri.stem().string();
100 std::unique_ptr<te::da::DataSet> dataset =
getDataSet(srid);
103 std::map<std::string,std::string> nopt;
105 dsOGR->createDataSet(dsType.get(), nopt);
107 if(dataset->moveBeforeFirst())
108 dsOGR->add(dsType->getName(), dataset.get(), nopt);
117 assert(ds->getNumProperties() == 5);
124 ds->moveBeforeFirst();
128 while(ds->moveNext())
164 std::unique_ptr<te::da::DataSetType> dsType;
175 dst->
add(geomIdProp);
188 std::unique_ptr<te::da::DataSet>
ds;
190 std::unique_ptr<te::da::DataSetType> dsType =
getDataSetType(srid);
194 std::map<std::string, te::cl::ROI*>::iterator it =
m_roiMap.begin();
200 std::map<std::string, te::gm::Polygon*> roiMap = roi->
getPolygons();
202 std::map<std::string, te::gm::Polygon*>::iterator itPols = roiMap.begin();
204 while(itPols != roiMap.end())
te::cl::ROI * getROI(std::string label)
Gets a ROI from this set.
MultiPolygon is a MultiSurface whose elements are Polygons.
static std::unique_ptr< DataSource > make(const std::string &driver, const te::core::URI &connInfo)
void add(te::dt::Property *p)
It adds a property to the list of properties of the primary key.
void setGeometry(std::size_t i, te::gm::Geometry *value)
It sets the value of the i-th property.
std::unique_ptr< te::da::DataSet > getDataSet(int srid)
Creates a dataset that with the roi set information.
A class that models the description of a dataset.
virtual ~ROISet()
Virtual destructor.
void addPolygon(te::gm::Polygon *p, std::string id)
Add a new region into this ROI.
static te::dt::Date ds(2010, 01, 01)
A ROISet is a set of ROI's.
#define TE_CL_ROI_GEOM_ID_NAME
This mark defines the geom id attribute name.
void addROI(te::cl::ROI *roi)
Add a new ROI to this set.
void exportToFile(std::string fileName, int srid)
Export the ROISet to a shapefile.
std::unique_ptr< te::da::DataSetType > getDataSetType(int srid)
Creates a dataset type that defines a roi.
A ROISet is a set of ROI's.
virtual te::dt::AbstractData * clone() const
It clones the linestring.
Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver...
static te::cl::ROISet * createROISet(std::unique_ptr< te::da::DataSet > ds)
Imports the ROISet from a dataset.
#define TE_CL_ROI_COLOR_NAME
This mark defines the color attribute name.
#define TE_CL_ROI_LABEL_NAME
This mark defines the label attribute name.
std::map< std::string, te::cl::ROI * > m_roiMap
The map of ROI's.
void removeROI(std::string label)
Removes a ROI from this set.
The type for string types: FIXED_STRING, VAR_STRING or STRING.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
void setColor(std::string color)
Set the ROI color using the hexadecimal color name.
A region of interest (often abbreviated ROI), is a selected subset of samples within a dataset identi...
#define TE_CL_ROI_GEOM_NAME
This mark defines the geom attribute name.
void add(Constraint *c)
It adds a new constraint.
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.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
It describes a primary key (pk) constraint.
const std::vector< Geometry * > & getGeometries() const
It returns a reference to the internal list of geometries.
std::string getLabel()
Get the ROI label.
ROISet()
Default constructor.
#define TE_CL_ROI_PK_NAME
This mark defines the primary key attribute name.
void setString(std::size_t i, const std::string &value)
It sets the value of the i-th property.
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
std::map< std::string, te::cl::ROI * > & getROISet()
Get the roi set map.
std::map< std::string, te::gm::Polygon * > & getPolygons()
Get all polygons belongs to this roi.
std::string getColor()
Get the ROI color defined by a hexadecimal color name.