35 #include "../dataaccess/Config.h" 39 #include <boost/property_tree/json_parser.hpp> 40 #include <boost/foreach.hpp> 43 #include <cppunit/extensions/HelperMacros.h> 131 std::vector<std::vector<double> >::iterator it;
133 std::vector<double> vecti;
134 for(it = vectd.begin(); it < vectd.end(); it++)
138 vecte.push_back(envi);
144 std::vector<std::vector<double> >::iterator it;
145 std::vector<double>::iterator it1;
147 double d[3]={0.0,0.0,0.0};
int i=0;
148 std::vector<double> vecti;
149 for(it = vectd.begin(); it < vectd.end(); it++)
152 for(it1 = vecti.begin(); it1 < vecti.end(); it1++)
166 std::vector<std::vector<double> >::iterator it;
167 std::vector<double>::iterator it1;
169 double d[3]={0.0,0.0,0.0};
int i=0;
int p =0;
170 std::vector<double> vecti;
171 for(it = vectd.begin(); it < vectd.end(); it++)
174 for(it1 = vecti.begin(); it1 < vecti.end(); it1++)
187 if (s ==
"te::dt::FIXED_STRING")
189 else if (s ==
"te::dt::VAR_STRING")
191 else if (s ==
"te::dt::STRING")
193 else if (s ==
"te::dt::STRING")
198 if (s ==
"te::dt::INT16_TYPE")
200 else if (s ==
"te::gm::PolygonMType")
275 boost::property_tree::ptree driver;
277 boost::property_tree::read_json(driver_name, driver);
279 sm_dsType = driver.get_child(
"ds.ds_type").data();
285 sm_connStr = driver.get_child(
"ds.ds_connStr").data();
287 std::string sss = driver.get_value(
"ds.ds_connStr");
295 sm_dtcloned = driver.get_child(
"dt_clonedName").data();
307 std::vector<te::rst::BandProperty*> bprops;
309 std::map<std::string, std::string> rinfo1;
316 std::vector<te::rst::BandProperty*> bprops3;
318 std::map<std::string, std::string> rinfo3;
326 std::vector<std::vector<double> > vect_res;
331 std::vector<std::vector<double> > vect_res3;
332 std::vector<te::gm::Envelope> vecEnv3;
337 std::vector<std::vector<double> > vect_rec;
361 std::string srid_s = driver.get_child(
"geom.geom_srid").data();
362 int geom_srid = boost::lexical_cast<
int>(srid_s);
364 std::vector<std::vector<double> > vect_pts;
365 std::vector<te::gm::Point> vect_pts1;
368 std::vector<std::vector<double> > vect_envboxs;
369 std::vector<te::gm::Envelope> vect_boxEnvel;
370 std::vector<std::vector<double> > vect_lines;
371 std::vector<std::vector<double> > vect_pols;
378 if (vect_boxEnvel.size() > 0)
380 std::vector<te::gm::Envelope>::iterator it = vect_boxEnvel.begin();
383 std::vector<te::gm::Point>::iterator it1 = vect_pts1.begin();
389 std::vector<std::vector<double> > vect_ptsx;
391 if (vect_ptsx.size() >0)
396 size_t lr_size = sm_linearRing1->
size();
398 std::vector<te::gm::Point> vect_pis;
401 for(i = 0; i < lr_size; i++)
405 vect_pis.push_back(pi);
418 std::vector<std::map<std::string, std::string> > vectProp;
421 std::vector<std::map<std::string, std::string> >::iterator itvectmap;
422 std::map<std::string, std::string> atti;
423 for(itvectmap = vectProp.begin(); itvectmap < vectProp.end(); itvectmap++)
426 std::string propname= atti[
"name"];
427 std::string proptypeM = atti[
"strtype"];
430 std::string prop_size = atti[
"strsize"];
431 int propsizeI = boost::lexical_cast<
int>(prop_size);
437 sm_NameAttr6 = driver.get_child(
"dt_propPkName").data();
438 sm_Attr6Pk = driver.get_child(
"dt_PkName").data();
440 sm_NameAttr3 = driver.get_child(
"dt_propUkName1").data();
441 sm_NameAttr4 = driver.get_child(
"dt_propUkName2").data();
444 sm_NameAttr5 = driver.get_child(
"dt_propIdxGeom").data();
445 sm_Attr5idx = driver.get_child(
"dt_IdxGeomName").data();
447 sm_NameAttr2 = driver.get_child(
"dt_propIdxName").data();
448 sm_Attr2idx = driver.get_child(
"dt_IdxName").data();
450 sm_NameAttr1 = driver.get_child(
"dt_propCcName").data();
451 sm_ccName = driver.get_child(
"dt_CheckCcName").data();
454 sm_Attr6Fk = driver.get_child(
"dt_FkName").data();
455 sm_NameAttr7 = driver.get_child(
"dt_propNameToChange").data();
457 sm_NameAttr8 = driver.get_child(
"dt_propOldName").data();
556 std::vector<std::string>::iterator it;
559 std::cout <<
"DataSets to be tested: " << *it << std::endl;
596 std::vector<te::gm::Envelope>::iterator itEnv;
597 std::vector<size_t>::iterator itSize;
600 std::pair<std::string, te::gm::Envelope> dtNameEnvelPair;
601 std::pair<std::string, te::gm::Envelope> dtNameRecPair;
602 std::pair<std::string, size_t> dtNameSize;
603 std::pair<std::string, size_t> dtNameRecSize;
610 dtNameEnvelPair.first = *it;
611 dtNameEnvelPair.second = *itEnv;
624 dtNameRecPair.first = *it;
625 dtNameRecPair.second = *itEnv;
638 dtNameSize.first = *it;
639 dtNameSize.second = *itSize;
652 dtNameRecSize.first = *it;
653 dtNameRecSize.second = *itSize;
662 std::vector<std::pair<std::string, te::gm::Envelope> >::iterator itpair;
665 std::cout << (*itpair).first << std::endl;
666 std::cout << (*itpair).second.m_llx <<
"," << (*itpair).second.m_lly <<
"," << (*itpair).second.m_urx <<
"," << (*itpair).second.m_ury << std::endl;
672 std::cout << (*itpair).first << std::endl;
673 std::cout << (*itpair).second.m_llx <<
"," << (*itpair).second.m_lly <<
"," << (*itpair).second.m_urx <<
"," << (*itpair).second.m_ury << std::endl;
static te::gm::Polygon * sm_pol
This file contains include headers for the Data Type module of TerraLib.
Property * getProperty(std::size_t i) const
It returns the i-th property.
void add(te::dt::Property *p)
It adds the property to the list of properties that participates in the unique key.
StringType
The subtype of string property.
static std::vector< std::pair< std::string, size_t > > sm_vecNamesSizes
void push_back(Curve *ring)
It adds the curve to the curve polygon.
static std::string sm_newDataSetType3
static std::unique_ptr< DataSource > make(const std::string &driver, const te::core::URI &connInfo)
static te::gm::Envelope sm_box
void add(te::dt::Property *p)
It adds a property to the list of properties of the primary key.
static te::da::DataSourceCapabilities sm_capabilit
static std::map< std::string, std::string > sm_connInfoNewDs
void setSRID(int srid) _NOEXCEPT_OP(true)
It sets the Spatial Reference System ID of the Point.
static std::string sm_Attr1
An atomic property like an integer or double.
static std::map< std::string, std::string > sm_connInfoExist
void setSRID(int srid)
It sets the Spatial Reference System ID of the geometry and all its parts if it is a GeometryCollecti...
static std::string sm_Attr2idx
A raster band description.
static std::string sm_newDataSetType
static std::string sm_Attr6Fk
A class that models the description of a dataset.
static std::string sm_NameAttr1
static std::string sm_connStr
static te::da::DataSetType * sm_newdt3
static te::da::DataSource * sm_datasource
static std::string sm_Attr3e4Uk
static std::vector< size_t > sm_dtSize
std::unique_ptr< Point > getPointN(std::size_t i) const
It returns the specified point in this LineString.
static std::string sm_oldNameProp
static std::string sm_NameAttr7
static std::map< std::string, std::string > sm_connInfoDropDs
void add(te::dt::Property *p)
It adds the property to the list of properties of the index.
A class that represents the known capabilities of a specific data source, i.e. this class informs all...
An utility struct for representing 2D coordinates.
void setGeoreference(const te::gm::Coord2D &ulLocation, int srid, double resX, double resY)
Sets the information needed to georeference the grid.
A class that describes a check constraint.
static te::da::ForeignKey * sm_fk
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
static std::string sm_NameAttr2
static std::string sm_newDataSetType2
static void setPairsValues()
It will set vectors of pairs of values based in some vector already known.
It models a property definition.
TECOMMONEXPORT void Convert(const boost::property_tree::ptree &p, std::map< std::string, std::string > &dict)
Converts a property tree node into a std::map<std::string, std::string>.
static std::string sm_NameAttr6
static std::string sm_Attr5idx
The type for arbitrary precison numbers, like numeric(p, q).
A LinearRing is a LineString that is both closed and simple.
virtual const DataSourceCapabilities & getCapabilities() const =0
It returns the known capabilities of the data source.
static std::vector< std::pair< std::string, size_t > > sm_vecNamesSizesRec
static te::da::CheckConstraint * sm_cc
A point with x and y coordinate values.
void setPoint(std::size_t i, const double &x, const double &y)
It sets the value of the specified point.
static void initialize(const std::string driver_name)
It will initialize the resources used by Test Suit: TsDataSource, TsDataSet, TsDataSetTypePersistence...
An Envelope defines a 2D rectangular region.
void add(te::dt::Property *p)
It adds a property to the foreign key constraint.
static size_t sm_nroDataSets
static void ConvertVectorToEnvelope(std::vector< std::vector< double > > &vectd, std::vector< te::gm::Envelope > &vecte)
Converts a vector of vector of doubles - representing the envelopes of layers into a vector of te::gm...
static te::dt::DateTime d(2010, 8, 9, 15, 58, 39)
static std::vector< size_t > sm_dtRecSize
static te::gm::Point sm_pt
static std::vector< std::string > sm_vecDtNames
static void ConvertVectorToPoints(std::vector< std::vector< double > > &vectd, std::vector< te::gm::Point > &vectp)
Converts a vector of vector of 3 doubles - representing points (SRID,X,Y) into a vector of te::gm::En...
static void finalize()
It will finalize the resources used in Teste Suit: TsDataSource, TsDataSet, TsDataSetTypePersistence...
A factory for data sources.
static std::string sm_NameAttr3
static te::gm::Geometry * sm_geom
It models a foreign key constraint for a DataSetType.
The type for string types: FIXED_STRING, VAR_STRING or STRING.
void addRefProperty(te::dt::Property *p)
It adds a reference property (on the referenced DataSetType) of this foreign key constraint.
static std::vector< std::string > sm_vecIdxNames
It describes a unique key (uk) constraint.
A static class for managing the resources used by DataSource test suit.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
static std::vector< std::string > sm_vecSeqNames
static std::map< std::string, std::string > sm_connInfo
static std::vector< te::gm::Envelope > sm_recEnvelops
void add(Constraint *c)
It adds a new constraint.
static std::vector< std::pair< std::string, te::gm::Envelope > > sm_vecNamesAndRecs
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
void setX(const double &x)
It sets the Point x-coordinate value.
static std::vector< std::pair< std::string, te::gm::Envelope > > sm_vecDtNamesAndEnvelops
static std::string sm_Attr6Pk
static std::string sm_Attr7_seq
It describes a primary key (pk) constraint.
static std::vector< te::gm::Envelope > sm_vecEnvelops
void setExpression(const std::string &e)
It sets the check constraint expression.
static std::string sm_NameAttr5
static std::string sm_NameAttr8
void clear()
It deletes all the rings of the CurvePolygon and clear it.
void setSRID(int srid)
It sets the Spatial Reference System ID of the linestring.
static te::da::DataSetType * sm_newdt
This file contains include headers for the TerraLib Common Runtime module.
static std::string sm_newCapabilitiesDt
void setReferencedDataSetType(DataSetType *refDt)
It sets the referenced DataSetType of this foreign key constraint.
static std::string sm_newNameProp
static std::string sm_ccName
static std::vector< std::string > sm_vecPkNames
void setY(const double &y)
It sets the Point y-coordinate value.
static std::string sm_dtcloned
This file contains include headers for the Vector Geometry model of TerraLib.
A rectified grid is the spatial support for raster data.
This file contains include headers for the Data Access module of TerraLib.
static std::vector< std::string > sm_vecCcNames
static std::vector< std::string > sm_vecFkNames
static void ConvertToPropType(std::string s, te::dt::StringType &t)
Converts a string into a string (Enum) property type.
It describes an index associated to a DataSetType.
static void ConvertVectorToLinearRing(std::vector< std::vector< double > > &vectd, te::gm::LinearRing &lr)
Converts a vector of vector of 3 doubles - representing points (SRID,X,Y) into a vector of te::gm::Li...
static std::string sm_dsType
std::size_t size() const
It returns the number of points (vertexes) in the geometry.
static std::string sm_NameAttr4
static std::vector< std::string > sm_vecUkNames