Go to the documentation of this file.
26 #ifndef __TERRALIB_DATAACCESS_INTERNAL_UTILS_H
27 #define __TERRALIB_DATAACCESS_INTERNAL_UTILS_H
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"
38 #include <boost/ptr_container/ptr_vector.hpp>
48 namespace core {
class URI; }
49 namespace dt {
class AbstracData;
class Property; }
54 class GeometryProperty;
57 namespace rst {
class RasterProperty; }
66 class DataSetTypeConverter;
67 class DataSourceCapabilities;
68 class DataSourceCatalogLoader;
69 class DataSourceTransactor;
70 class FieldNameValidator;
86 const std::string& propertyName,
87 const std::string& datasourceId);
227 std::vector<std::string>& pnames,
228 std::vector<int>& ptypes);
231 std::vector<std::string>& pnames,
232 std::vector<int>& ptypes);
281 const std::map<std::string, std::string>& options,
282 std::size_t limit = 0);
303 const std::string& propertyName);
306 const std::vector<std::string>& properties);
309 const std::vector<std::string>& properties,
310 const std::string& geometryProperty,
316 const std::vector<std::string>& properties,
317 const std::string& geometryProperty,
322 const std::vector<std::string>& properties,
446 #endif // __TERRALIB_DATAACCESS_INTERNAL_UTILS_H
TEDATAACCESSEXPORT te::dt::Property * GetFirstSpatialProperty(const DataSetType *dt)
An Envelope defines a 2D rectangular region.
This class represents an unique id for a data set element.
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...
TEDATAACCESSEXPORT std::unique_ptr< Expression > BuildSpatialOp(Expression *e1, Expression *e2, te::gm::SpatialRelation r)
TEDATAACCESSEXPORT bool HasLinkedTable(te::da::DataSetType *type)
It checks if the datasettype has a linked table.
TEDATAACCESSEXPORT ObjectIdSet * GenerateOIDSet(DataSet *dataset, const DataSetType *type)
TEDATAACCESSEXPORT std::string GetAliasName(std::string fullName)
Get alias based on a input name.
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
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.
TEDATAACCESSEXPORT te::da::Literal * GetLiteralFromAbstractData(const te::dt::AbstractData *abstractData)
Creates the concrete literal class based on the given abstract data.
TEDATAACCESSEXPORT DataSourcePtr GetDataSource(const std::string &datasourceId, const bool opened=true)
Search for a data source with the informed id in the DataSourceManager.
TEDATAACCESSEXPORT void GetOIDDatasetProps(const DataSetType *type, std::pair< std::string, int > &dsProps)
TEDATAACCESSEXPORT void LoadProperties(te::da::DataSetType *dataset, const std::string &datasourceId)
TEDATAACCESSEXPORT ObjectId * GenerateOID(DataSet *dataset, const std::vector< std::string > &names)
TEDATAACCESSEXPORT double GetSummarizedValue(std::vector< double > &values, const std::string &summary)
It gets the summarized value.
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib.
TEDATAACCESSEXPORT void GetPropertyInfo(const DataSetType *const dt, std::vector< std::string > &pnames, std::vector< int > &ptypes)
TEDATAACCESSEXPORT std::unique_ptr< Select > BuildSelect(const std::string &dsname)
#define TEDATAACCESSEXPORT
You can use this macro in order to export/import classes and functions from this module.
TEDATAACCESSEXPORT int GetPropertyIndex(te::da::DataSet *dataSet, const std::string propName)
TEDATAACCESSEXPORT double Round(const double &value, const size_t &precision)
It gets the round value.
TEDATAACCESSEXPORT void RemoveAutoIncrementProperties(te::da::DataSetTypeConverter *converter)
Converts a DataAccess to its String representation.
TEDATAACCESSEXPORT DataSetAdapter * CreateAdapter(DataSet *ds, DataSetTypeConverter *converter, bool isOwner=false)
te::da::DataSourceCapabilities capabilities
Class used to centralize and control access to data in terralib. It aims to create a high-level inter...
TEDATAACCESSEXPORT DataSetType * GetDataSetType(const std::string &name, const std::string &datasourceId)
TEDATAACCESSEXPORT std::string GetSQLValueNames(const DataSetType *dt)
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....
TEDATAACCESSEXPORT te::gm::Envelope * GetExtent(const std::string &datasetName, const std::string &propertyName, const std::string &datasourceId)
TEDATAACCESSEXPORT std::string GetDataSetCategoryName(int category)
SpatialRelation
Spatial relations between geometric objects.
This is an abstract class that models a query expression.
This class is responsible for validating field names. It can handle size limits, fix special characte...
This class models a literal value.
TEDATAACCESSEXPORT std::vector< int > GetPropertyDataTypes(const te::da::DataSet *dataset)
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...
TEDATAACCESSEXPORT te::dt::AbstractData * DataAccessToStringConverter(te::dt::AbstractData *absData)
Converts the String representtion of a DataAccess to the concrete class.
TEDATAACCESSEXPORT bool HasDataSet(const std::string &datasourceId)
TEDATAACCESSEXPORT std::size_t GetPropertyPos(const DataSet *dataset, const std::string &name)
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.
TEDATAACCESSEXPORT std::string getBasePkey(te::da::ObjectId *oid, std::pair< std::string, int > &dsProps)
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,...
TEDATAACCESSEXPORT void GetEmptyOIDSet(const DataSetType *type, ObjectIdSet *&set)
Returns an empty ObjectIdSet, with the definitions of fields that compose it.
A base class for values that can be retrieved from the data access module.
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 ...
TEDATAACCESSEXPORT std::unique_ptr< Fields > BuildFields(const std::vector< std::string > &properties)
TEDATAACCESSEXPORT void LoadFull(te::da::DataSetType *dataset, const std::string &datasourceId)
A class that represents the known capabilities of a specific data source, i.e. this class informs all...
An abstract class for data providers like a DBMS, Web Services or a regular file.
TEDATAACCESSEXPORT std::size_t GetFirstSpatialPropertyPos(const te::da::DataSet *dataset)
It returns the first dataset spatial property or NULL if none is found.
It models a property definition.
boost::shared_ptr< DataSource > DataSourcePtr
A dataset is the unit of information manipulated by the data access module of TerraLib.
TEDATAACCESSEXPORT void GetOIDPropertyNames(const DataSetType *type, std::vector< std::string > &pnames)
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
TEDATAACCESSEXPORT void GetOIDPropertyPos(const DataSetType *type, std::vector< std::size_t > &ppos)
A class that models the description of a dataset.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
TEDATAACCESSEXPORT void GetDataSetNames(std::vector< std::string > &datasetNames, const std::string &datasourceId)
An converter for DataSetType.
TEDATAACCESSEXPORT void AssociateDataSetTypeConverterSRID(DataSetTypeConverter *converter, const int &inputSRID, const int &outputSRID=TE_UNKNOWN_SRS)
TEDATAACCESSEXPORT double GetValueAsDouble(const te::da::DataSet *ds, const size_t pos)
It gets the value as double.
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.
TEDATAACCESSEXPORT DataSet * GetDataSet(const std::string &name, const std::string &datasourceId)
This class represents a set of unique ids created in the same context. i.e. from the same data set.
TEDATAACCESSEXPORT te::rst::RasterProperty * GetFirstRasterProperty(const DataSetType *dt)
TEDATAACCESSEXPORT te::dt::AbstractData * StringToDataAccessConverter(te::dt::AbstractData *absData)