Utils.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/dataaccess/utils/Utils.h
22 
23  \brief Utility functions for the data access module.
24 */
25 
26 #ifndef __TERRALIB_DATAACCESS_INTERNAL_UTILS_H
27 #define __TERRALIB_DATAACCESS_INTERNAL_UTILS_H
28 
29 // TerraLib
30 #include "../../geometry/Enums.h"
31 #include "../../srs/Config.h"
32 #include "../datasource/DataSource.h"
33 #include "../query/Expression.h"
34 #include "../query/Fields.h"
35 #include "../query/Select.h"
36 
37 // Boost
38 #include <boost/ptr_container/ptr_vector.hpp>
39 
40 // STL
41 #include <memory>
42 #include <string>
43 #include <vector>
44 
45 namespace te
46 {
47 // Forward declaration
48  namespace core { class URI; }
49  namespace dt { class AbstracData; class Property; }
50  namespace gm
51  {
52  class Envelope;
53  class Geometry;
54  class GeometryProperty;
55  }
56 
57  namespace rst { class RasterProperty; }
58 
59  namespace da
60  {
61 // Forward declaration
62  class DataAccess;
63  class DataSet;
64  class DataSetAdapter;
65  class DataSetType;
66  class DataSetTypeConverter;
67  class DataSourceCapabilities;
68  class DataSourceCatalogLoader;
69  class DataSourceTransactor;
70  class FieldNameValidator;
71  class ObjectId;
72  class ObjectIdSet;
73 
74  TEDATAACCESSEXPORT void LoadFull(te::da::DataSetType* dataset, const std::string& datasourceId);
75 
76 // TEDATAACCESSEXPORT void LoadFull(te::da::DataSetType* dataset, te::da::DataSource* datasource);
77 
78  TEDATAACCESSEXPORT void LoadProperties(te::da::DataSetType* dataset, const std::string& datasourceId);
79 
80  /*!
81  \return The data extent considering the informed property. The caller will take the ownership of the returned box.
82 
83  \exception Exception It throws an exception if the extent can not be determined.
84  */
85  TEDATAACCESSEXPORT te::gm::Envelope* GetExtent(const std::string& datasetName,
86  const std::string& propertyName,
87  const std::string& datasourceId);
88 
89  TEDATAACCESSEXPORT void GetDataSetNames(std::vector<std::string>& datasetNames, const std::string& datasourceId);
90 
91  TEDATAACCESSEXPORT std::string GetDataSetCategoryName(int category);
92 
93  TEDATAACCESSEXPORT bool HasDataSet(const std::string& datasourceId);
94 
95  TEDATAACCESSEXPORT DataSet* GetDataSet(const std::string& name, const std::string& datasourceId);
96 
97  TEDATAACCESSEXPORT DataSetType* GetDataSetType(const std::string& name, const std::string& datasourceId);
98 
99  /*!
100  \brief Search for a data source with the informed id in the DataSourceManager.
101 
102  If the data source is not found in that manager it will try to get some information
103  in the DataSourceInfoManager and will create a new data source instance,
104  storing a reference to the new data source in the manager.
105 
106  \param datasourceId The data source to look for.
107  \param opened Automatically open the data source.
108 
109  \return A data source with the informed id.
110 
111  \exception Exception It throws an exception if the informed data source could not be retrieved.
112  */
113  TEDATAACCESSEXPORT DataSourcePtr GetDataSource(const std::string& datasourceId, const bool opened = true);
114 
115  /*!
116  \brief Returns an empty ObjectIdSet, with the definitions of fields that compose it.
117 
118  \param type[in] A pointer to a valid data set type. Do not pass null.
119 
120  \param set[out] The ObjectIdSet containing only the the fields definitions. This pointer will be instantiated inside the method.
121 
122  \note The caller WILL TAKE the ownership of \a set.
123  */
125 
126  /*
127  \brief It returns the property names used to generate the object ids.
128 
129  This method first looks for the primary key properties defined on data set type.
130  If they do not exist it looks for the unique keys. If they do not exist then it returns all the properties.
131 
132  \param type A pointer to a valid data set type. Do not pass null.
133  \param pnames The vector that will be filled with the property names.
134  */
135  TEDATAACCESSEXPORT void GetOIDPropertyNames(const DataSetType* type, std::vector<std::string>& pnames);
136 
137  /*
138  \brief It returns the name of the base dataset of a linked dataset
139  and how many of it's properties are a part of the objectId
140 
141  \param type A pointer to a valid data set type. Do not pass null.
142  \param pnames The pair that will be filled with the dataset name and the number of properties.
143  */
144  TEDATAACCESSEXPORT void GetOIDDatasetProps(const DataSetType* type, std::pair<std::string, int>& dsProps);
145 
146  /*
147  \brief It returns the property positions used to generate the object ids.
148 
149  This method first looks for the primary key properties defined on data set type.
150  If they do not exist it looks for the unique keys. If they do not exist then it returns all the properties.
151 
152  \param type A pointer to a valid data set type. Do not pass null.
153  \param pnames The vector that will be filled with the property names.
154  */
155  TEDATAACCESSEXPORT void GetOIDPropertyPos(const DataSetType* type, std::vector<std::size_t>& ppos);
156 
157  /*
158  \function getBasePkey
159  \brief Function used to acquire the string that represents the objectId of the base dataset.
160 
161  \param oid The objectId as returned from the dataset;
162  \param dsProps A pair that indicates the name of the base dataset and how many key properties it's got
163 
164  \note Will return the whole objectId as a string unless the dataset of interest is based on a linked layer,
165  otherwise it returns a string that represents the objectId of the base Dataset.
166  \note It will not take ownership of the given objectId pointer
167  */
168  TEDATAACCESSEXPORT std::string getBasePkey(te::da::ObjectId* oid, std::pair<std::string, int>& dsProps);
169 
170  /*
171  \brief It generates the set of object ids for every element of the given dataset.
172 
173  This method tries to use the primary key properties defined on data set type to generate the object ids.
174  If they do not exist it tries to use unique keys. If they do not exist then it uses all the properties.
175 
176  \param dataset A pointer to a valid data set. Do not pass null.
177  \param type A pointer to a data set type that describes the given dataset. Do not pass null.
178 
179  \return The object id set generated from the given dataset.
180  */
182 
183  /*
184  \brief It generates the set of object ids for every element of the given dataset using a set of attributes.
185 
186  \param dataset A pointer to a valid data set.
187  \param names A non empty vector of property names to be used to identify the elements.
188 
189  \return The object id set generated from the given dataset.
190 
191  \exception Exception It throws an exception if a property was not found in data set
192  */
193  TEDATAACCESSEXPORT ObjectIdSet* GenerateOIDSet(DataSet* dataset, const std::vector<std::string>& names);
194 
195  /*
196  \brief It generates an object id for the current element of the given dataset using the informed set of attributes.
197 
198  \param dataset A pointer to a valid data set.
199  \param names A non empty vector of property names to be used to identify the element.
200 
201  \return The object id generated for the current element of the given dataset.
202  */
203  TEDATAACCESSEXPORT ObjectId* GenerateOID(DataSet* dataset, const std::vector<std::string>& names);
204 
205  /*!
206  \brief It returns the first dataset spatial property or NULL if none is found.
207 
208  \param dataset The dataset to search for a spatial property.
209 
210  \return The first dataset spatial property or NULL if none is found.
211  */
213 
214  TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet* dataset, int datatype);
215 
216  TEDATAACCESSEXPORT std::size_t GetPropertyPos(const DataSet* dataset, const std::string& name);
217 
218  TEDATAACCESSEXPORT std::size_t GetPropertyPos(const DataSetType* dt, const std::string& name);
219 
221 
223 
225 
227  std::vector<std::string>& pnames,
228  std::vector<int>& ptypes);
229 
230  TEDATAACCESSEXPORT void GetPropertyInfo(const DataSet* const dataset,
231  std::vector<std::string>& pnames,
232  std::vector<int>& ptypes);
233 
234  /*!
235  \brief It creates the dataset definition in a data source and then fill it with data from the input dataset.
236 
237  This function will create the dataset schema definition and will
238  save all the dataset data.
239 
240  \param t The data source transactor.
241  \param dt The source dataset definition.
242  \param d The source dataset data.
243  \param limit The number of items to be used from the input dataset. If set to 0 (default) all items are used.
244 
245  \pre All parameters must be valid pointers.
246 
247  \post It is the caller responsability to release the dataset 'd' pointer.
248 
249  \exception Exception It throws an exception if the dataset can not be created.
250 
251  \note DataSetPersistence will start reading the dataset 'd' in the
252  current position. So, keep in mind that it is the caller responsability
253  to inform the dataset 'd' in the right position (and a valid one) to start processing it.
254  */
255  TEDATAACCESSEXPORT void Create(DataSource* ds, DataSetType* dt, DataSet* d, std::size_t limit = 0);
256 
257  /*!
258  \brief It creates the dataset definition in a data source and then fill it with data from the input dataset.
259 
260  This method will create the dataset schema definition and will
261  save all the dataset data.
262 
263  \param dt The source dataset definition.
264  \param d The source dataset data.
265  \param options A list of optional modifiers. It is driver specific.
266  \param limit The number of items to be used from the input dataset. If set to 0 (default) all items are used.
267 
268  \pre All parameters must be valid pointers.
269 
270  \exception Exception It throws an exception if the dataset can not be created.
271 
272  \note It is the caller responsability to release the dataset 'd' pointer.
273 
274  \note DataSetPersistence will start reading the dataset 'd' in the
275  current position. So, keep in mind that it is the caller responsability
276  to inform the dataset 'd' in the right position (and a valid one) to start processing it.
277  */
279  DataSetType* dt,
280  DataSet* d,
281  const std::map<std::string, std::string>& options,
282  std::size_t limit = 0);
283 
285 
286  TEDATAACCESSEXPORT void AssociateDataSetTypeConverterSRID(DataSetTypeConverter* converter, const int& inputSRID, const int& outputSRID = TE_UNKNOWN_SRS);
287 
289 
290  TEDATAACCESSEXPORT std::string GetSQLValueNames(const DataSet* dataset);
291 
292  TEDATAACCESSEXPORT std::vector<int> GetPropertyDataTypes(const te::da::DataSet* dataset);
293 
294  TEDATAACCESSEXPORT std::unique_ptr<Fields> BuildFields(const std::vector<std::string>& properties);
295 
296  TEDATAACCESSEXPORT std::unique_ptr<Expression> BuildSpatialOp(Expression* e1,
297  Expression* e2,
299 
300  TEDATAACCESSEXPORT std::unique_ptr<Select> BuildSelect(const std::string& dsname);
301 
302  TEDATAACCESSEXPORT std::unique_ptr<Select> BuildSelect(const std::string& dsname,
303  const std::string& propertyName);
304 
305  TEDATAACCESSEXPORT std::unique_ptr<Select> BuildSelect(const std::string& dsname,
306  const std::vector<std::string>& properties);
307 
308  TEDATAACCESSEXPORT std::unique_ptr<Select> BuildSelect(const std::string& dsname,
309  const std::vector<std::string>& properties,
310  const std::string& geometryProperty,
311  const te::gm::Envelope* e,
312  int srid,
314 
315  TEDATAACCESSEXPORT std::unique_ptr<Select> BuildSelect(const std::string& dsname,
316  const std::vector<std::string>& properties,
317  const std::string& geometryProperty,
318  te::gm::Geometry* g,
320 
321  TEDATAACCESSEXPORT std::unique_ptr<Select> BuildSelect(const std::string& dsname,
322  const std::vector<std::string>& properties,
323  const ObjectIdSet* oids);
324 
325 
326  TEDATAACCESSEXPORT int GetPropertyIndex(te::da::DataSet* dataSet, const std::string propName);
327 
328  /*!
329  \brief It checks if the name is not valid as the existence of invalid characters, reserved words, and others.
330 
331  \param name Name that will be checked.
332  \param invalidChar Records the invalid character.
333 
334  \return If the name is valid.
335  */
336  TEDATAACCESSEXPORT bool IsValidName(const std::string& name, std::string& invalidChar);
337 
338  /*!
339  \brief It checks if the datasettype has a linked table.
340 
341  \param type The Datasettype.
342 
343  \return True if has linked table.
344  */
346 
347  /*!
348  \brief It hide columns of a DataSet using DataSetAdapter.
349 
350  \param ds The DataSet that will have hidden columns.
351  \param dst The DataSetType used to hide columns.
352  \param columns names to be hidden.
353 
354  \return The DataSet result. The caller will take the ownership of the returned DataSet.
355  */
356  TEDATAACCESSEXPORT std::unique_ptr<te::da::DataSet> HideColumns(te::da::DataSet* ds, te::da::DataSetType* dst, const std::vector<std::string>& columns);
357 
358  /*!
359  \brief It gets the summarized value.
360 
361  \param values The input values.
362  \param summary The summary mode. It can be: "MIN", "MAX", "SUM", "AVERAGE", "MEDIAN", "STDDEV" or "VARIANCE"
363 
364  \return The summarized value.
365  */
366  TEDATAACCESSEXPORT double GetSummarizedValue(std::vector<double>& values, const std::string& summary);
367 
368  /*!
369  \brief It gets the summarized value.
370 
371  \param values The input values.
372  \param summary The summary mode. It can be: "MIN" or "MAX"
373 
374  \return The summarized value.
375  */
376  TEDATAACCESSEXPORT std::string GetSummarizedValue(const std::vector<std::string>& values, const std::string& sumary);
377 
378  /*!
379  \brief It gets the round value.
380 
381  \param value The input value.
382 
383  \return The rounded value.
384  */
385  TEDATAACCESSEXPORT double Round(const double& value, const size_t& precision);
386 
387  /*!
388  \brief It gets the value as double.
389 
390  \param ds The input dataset.
391  \param pos The column position.
392 
393  \return The double value. Default value is 0.
394  */
395  TEDATAACCESSEXPORT double GetValueAsDouble(const te::da::DataSet* ds, const size_t pos);
396 
397  /*!
398  \brief Get alias based on a input name
399 
400  \param fullName name composed by table/schema.name
401 
402  \return string of the right side of dot "."
403  */
404  TEDATAACCESSEXPORT std::string GetAliasName(std::string fullName);
405 
406 
407  /*!
408  \brief Creates the concrete literal class based on the given abstract data
409 
410  \param abstractData The abstract data to be converted into a Literal
411 
412  \return The concrete literal class based on the given abstract data
413  */
415 
416  //!< //Creates an adapter to handle correctly the primary key and autonumber atributes. The adapter will handle the destruction of the dataSet
417  TEDATAACCESSEXPORT std::unique_ptr<te::da::DataSet> CreateAdapterToHandlePersistence(const te::da::DataAccess* destinationDataAccess, te::da::DataSet* inputDataSet);
418 
419  //!< //Creates an adapter to handle correctly the primary key and autonumber atributes. The adapter will handle the destruction of the dataSet
420  TEDATAACCESSEXPORT std::unique_ptr<te::da::DataSet> CreateAdapterToHandlePersistence(const te::da::DataSetType* destinationDataSetType, const te::da::DataSourceCapabilities* capabilities, te::da::DataSet* inputDataSet);
421 
422  //!< Creates a simplified version of the dataSetType based on the information present in the given dataSet
423  TEDATAACCESSEXPORT std::unique_ptr<te::da::DataSetType> CreateDataSetType(const std::string& dataSetName, te::da::DataSet* dataSet);
424 
425  //!< Creates a FieldNameValidator object based on the given DataSourceCapabilities
427 
428  //!< This function will prepare the given 'inputDataSetType' by validating the names of the properties of the dataSet and replacing them with fixed names if necessary (including possible repeated names after an adjust). The property order will not be changed
429  TEDATAACCESSEXPORT std::unique_ptr<te::da::DataSetType> PrepareDateSetType(const te::da::DataSetType* dataSetType, const te::da::DataSourceCapabilities* capabilities);
430 
431  //!< Creates a converter between the given inputDataSetType and outputDataSetType. It handles different order of properties and different names in spatial property. It will handle limitations if the optional 'outputCapabilities' parameter is given
432  TEDATAACCESSEXPORT std::unique_ptr<te::da::DataSetTypeConverter> CreateConverterForDataSetType(const te::da::DataSetType* inputDataSetType, const te::da::DataSetType* outputDataSetType, const te::da::DataSourceCapabilities* outputCapabilities);
433 
434  //!< Removes the auto-increment property from the converter. This is done to allow the destination dataSource to generated new values for each saved data
436 
437  //!< Converts a DataAccess to its String representation
439 
440  //!< Converts the String representtion of a DataAccess to the concrete class
442 
443  } // end namespace da
444 } // end namespace te
445 
446 #endif // __TERRALIB_DATAACCESS_INTERNAL_UTILS_H
447 
te::da::GetFirstSpatialProperty
TEDATAACCESSEXPORT te::dt::Property * GetFirstSpatialProperty(const DataSetType *dt)
te::gm::Envelope
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
te::da::ObjectId
This class represents an unique id for a data set element.
Definition: ObjectId.h:48
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::da::CreateConverterForDataSetType
TEDATAACCESSEXPORT std::unique_ptr< te::da::DataSetTypeConverter > CreateConverterForDataSetType(const te::da::DataSetType *inputDataSetType, const te::da::DataSetType *outputDataSetType, const te::da::DataSourceCapabilities *outputCapabilities)
Removes the auto-increment property from the converter. This is done to allow the destination dataSou...
te::da::BuildSpatialOp
TEDATAACCESSEXPORT std::unique_ptr< Expression > BuildSpatialOp(Expression *e1, Expression *e2, te::gm::SpatialRelation r)
te::da::HasLinkedTable
TEDATAACCESSEXPORT bool HasLinkedTable(te::da::DataSetType *type)
It checks if the datasettype has a linked table.
te::da::GenerateOIDSet
TEDATAACCESSEXPORT ObjectIdSet * GenerateOIDSet(DataSet *dataset, const DataSetType *type)
te::gm::GeometryProperty
Geometric property.
Definition: GeometryProperty.h:52
te::da::GetAliasName
TEDATAACCESSEXPORT std::string GetAliasName(std::string fullName)
Get alias based on a input name.
te::da::GetFirstPropertyPos
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
te::da::HideColumns
TEDATAACCESSEXPORT std::unique_ptr< te::da::DataSet > HideColumns(te::da::DataSet *ds, te::da::DataSetType *dst, const std::vector< std::string > &columns)
It hide columns of a DataSet using DataSetAdapter.
te::da::GetLiteralFromAbstractData
TEDATAACCESSEXPORT te::da::Literal * GetLiteralFromAbstractData(const te::dt::AbstractData *abstractData)
Creates the concrete literal class based on the given abstract data.
te::da::GetDataSource
TEDATAACCESSEXPORT DataSourcePtr GetDataSource(const std::string &datasourceId, const bool opened=true)
Search for a data source with the informed id in the DataSourceManager.
te::da::GetOIDDatasetProps
TEDATAACCESSEXPORT void GetOIDDatasetProps(const DataSetType *type, std::pair< std::string, int > &dsProps)
te::da::LoadProperties
TEDATAACCESSEXPORT void LoadProperties(te::da::DataSetType *dataset, const std::string &datasourceId)
te::da::GenerateOID
TEDATAACCESSEXPORT ObjectId * GenerateOID(DataSet *dataset, const std::vector< std::string > &names)
te::da::GetSummarizedValue
TEDATAACCESSEXPORT double GetSummarizedValue(std::vector< double > &values, const std::string &summary)
It gets the summarized value.
TE_UNKNOWN_SRS
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib.
Definition: Config.h:41
te::da::GetPropertyInfo
TEDATAACCESSEXPORT void GetPropertyInfo(const DataSetType *const dt, std::vector< std::string > &pnames, std::vector< int > &ptypes)
te::da::BuildSelect
TEDATAACCESSEXPORT std::unique_ptr< Select > BuildSelect(const std::string &dsname)
TEDATAACCESSEXPORT
#define TEDATAACCESSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:97
te::rst::RasterProperty
Raster property.
Definition: RasterProperty.h:59
te::da::GetPropertyIndex
TEDATAACCESSEXPORT int GetPropertyIndex(te::da::DataSet *dataSet, const std::string propName)
te::da::Round
TEDATAACCESSEXPORT double Round(const double &value, const size_t &precision)
It gets the round value.
te::da::RemoveAutoIncrementProperties
TEDATAACCESSEXPORT void RemoveAutoIncrementProperties(te::da::DataSetTypeConverter *converter)
Converts a DataAccess to its String representation.
te::da::CreateAdapter
TEDATAACCESSEXPORT DataSetAdapter * CreateAdapter(DataSet *ds, DataSetTypeConverter *converter, bool isOwner=false)
capabilities
te::da::DataSourceCapabilities capabilities
Definition: PostGISCapabilities.h:129
te::da::DataAccess
Class used to centralize and control access to data in terralib. It aims to create a high-level inter...
Definition: DataAccess.h:77
te::da::DataSetAdapter
An adapter for DataSet.
Definition: DataSetAdapter.h:53
te::da::GetDataSetType
TEDATAACCESSEXPORT DataSetType * GetDataSetType(const std::string &name, const std::string &datasourceId)
te::da::GetSQLValueNames
TEDATAACCESSEXPORT std::string GetSQLValueNames(const DataSetType *dt)
te::da::CreateAdapterToHandlePersistence
TEDATAACCESSEXPORT std::unique_ptr< te::da::DataSet > CreateAdapterToHandlePersistence(const te::da::DataAccess *destinationDataAccess, te::da::DataSet *inputDataSet)
//Creates an adapter to handle correctly the primary key and autonumber atributes....
te::da::GetExtent
TEDATAACCESSEXPORT te::gm::Envelope * GetExtent(const std::string &datasetName, const std::string &propertyName, const std::string &datasourceId)
te::da::GetDataSetCategoryName
TEDATAACCESSEXPORT std::string GetDataSetCategoryName(int category)
te::gm::SpatialRelation
SpatialRelation
Spatial relations between geometric objects.
Definition: Enums.h:128
te::da::Expression
This is an abstract class that models a query expression.
Definition: Expression.h:48
te::da::FieldNameValidator
This class is responsible for validating field names. It can handle size limits, fix special characte...
Definition: FieldNameValidator.h:46
te::da::Literal
This class models a literal value.
Definition: Literal.h:54
te::da::GetPropertyDataTypes
TEDATAACCESSEXPORT std::vector< int > GetPropertyDataTypes(const te::da::DataSet *dataset)
te::da::PrepareDateSetType
TEDATAACCESSEXPORT std::unique_ptr< te::da::DataSetType > PrepareDateSetType(const te::da::DataSetType *dataSetType, const te::da::DataSourceCapabilities *capabilities)
Creates a converter between the given inputDataSetType and outputDataSetType. It handles different or...
te::da::DataAccessToStringConverter
TEDATAACCESSEXPORT te::dt::AbstractData * DataAccessToStringConverter(te::dt::AbstractData *absData)
Converts the String representtion of a DataAccess to the concrete class.
te::da::HasDataSet
TEDATAACCESSEXPORT bool HasDataSet(const std::string &datasourceId)
te::da::GetPropertyPos
TEDATAACCESSEXPORT std::size_t GetPropertyPos(const DataSet *dataset, const std::string &name)
te::da::CreateDataSetType
TEDATAACCESSEXPORT std::unique_ptr< te::da::DataSetType > CreateDataSetType(const std::string &dataSetName, te::da::DataSet *dataSet)
Creates a FieldNameValidator object based on the given DataSourceCapabilities.
te::da::getBasePkey
TEDATAACCESSEXPORT std::string getBasePkey(te::da::ObjectId *oid, std::pair< std::string, int > &dsProps)
te::da::IsValidName
TEDATAACCESSEXPORT bool IsValidName(const std::string &name, std::string &invalidChar)
It checks if the name is not valid as the existence of invalid characters, reserved words,...
te::da::GetEmptyOIDSet
TEDATAACCESSEXPORT void GetEmptyOIDSet(const DataSetType *type, ObjectIdSet *&set)
Returns an empty ObjectIdSet, with the definitions of fields that compose it.
te::dt::AbstractData
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:56
te::da::CreateValidator
TEDATAACCESSEXPORT te::da::FieldNameValidator CreateValidator(const te::da::DataSourceCapabilities *capabilities)
This function will prepare the given 'inputDataSetType' by validating the names of the properties of ...
te::da::BuildFields
TEDATAACCESSEXPORT std::unique_ptr< Fields > BuildFields(const std::vector< std::string > &properties)
te::da::LoadFull
TEDATAACCESSEXPORT void LoadFull(te::da::DataSetType *dataset, const std::string &datasourceId)
te::da::DataSourceCapabilities
A class that represents the known capabilities of a specific data source, i.e. this class informs all...
Definition: DataSourceCapabilities.h:56
te::da::DataSource
An abstract class for data providers like a DBMS, Web Services or a regular file.
Definition: DataSource.h:120
te::da::GetFirstSpatialPropertyPos
TEDATAACCESSEXPORT std::size_t GetFirstSpatialPropertyPos(const te::da::DataSet *dataset)
It returns the first dataset spatial property or NULL if none is found.
te::dt::Property
It models a property definition.
Definition: Property.h:60
te::da::DataSourcePtr
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1449
te::da::DataSet
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:114
te::da::GetOIDPropertyNames
TEDATAACCESSEXPORT void GetOIDPropertyNames(const DataSetType *type, std::vector< std::string > &pnames)
te::da::GetFirstGeomProperty
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
te::da::GetOIDPropertyPos
TEDATAACCESSEXPORT void GetOIDPropertyPos(const DataSetType *type, std::vector< std::size_t > &ppos)
te::da::DataSetType
A class that models the description of a dataset.
Definition: DataSetType.h:73
te::gm::Geometry
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:78
te::da::GetDataSetNames
TEDATAACCESSEXPORT void GetDataSetNames(std::vector< std::string > &datasetNames, const std::string &datasourceId)
te::da::DataSetTypeConverter
An converter for DataSetType.
Definition: DataSetTypeConverter.h:60
te::da::AssociateDataSetTypeConverterSRID
TEDATAACCESSEXPORT void AssociateDataSetTypeConverterSRID(DataSetTypeConverter *converter, const int &inputSRID, const int &outputSRID=TE_UNKNOWN_SRS)
te::da::GetValueAsDouble
TEDATAACCESSEXPORT double GetValueAsDouble(const te::da::DataSet *ds, const size_t pos)
It gets the value as double.
te::da::Create
TEDATAACCESSEXPORT void Create(DataSource *ds, DataSetType *dt, DataSet *d, std::size_t limit=0)
It creates the dataset definition in a data source and then fill it with data from the input dataset.
te::da::GetDataSet
TEDATAACCESSEXPORT DataSet * GetDataSet(const std::string &name, const std::string &datasourceId)
te::da::ObjectIdSet
This class represents a set of unique ids created in the same context. i.e. from the same data set.
Definition: ObjectIdSet.h:56
te::da::GetFirstRasterProperty
TEDATAACCESSEXPORT te::rst::RasterProperty * GetFirstRasterProperty(const DataSetType *dt)
te::da::StringToDataAccessConverter
TEDATAACCESSEXPORT te::dt::AbstractData * StringToDataAccessConverter(te::dt::AbstractData *absData)