Namespace for the TerraLib PostGIS driver implementation. More...
Classes | |
| struct | Array |
| Auxiliary structure used to decode Array data types. More... | |
| class | ConnectedDataSet |
| Implementation of a connected dataset for the PostGIS driver. More... | |
| class | Connection |
| A class that implements a connection to a PostgreSQL database. More... | |
| class | ConnectionPool |
| This class implements a connection pool for the PostGIS driver. More... | |
| class | DataSet |
| Implementation of a dataset for the PostGIS driver. More... | |
| class | DataSource |
| The PostGIS driver. More... | |
| class | EWKBReader |
| An utility class for reading a PostGIS EWKB. More... | |
| class | EWKBWriter |
| An utility class for writing a PostGIS EWKB. More... | |
| class | Globals |
| An static class with global definitions. More... | |
| struct | Numeric |
| Auxiliary structure used to decode Numeric data types. More... | |
| class | PreparedQuery |
| A class that implements a prepared query for PostgreSQL data access driver. More... | |
| class | ScopedConnection |
| A class that control the use of the connection to a PostgreSQL database. More... | |
| class | SQLVisitor |
| A visitor for building an SQL statement using PostGIS dialect. More... | |
| class | Transactor |
| The transactor class for the PostGIS driver. More... | |
| struct | VersionInfo |
| A data structure for holding version information. More... | |
Typedefs | |
| typedef boost::shared_ptr< Transactor > | TransactorPtr |
Functions | |
| void | BindValue (te::pgis::PreparedQuery *pq, te::da::DataSet *d, std::size_t i, std::size_t propertyPos) |
| te::da::DataSource * | Build (const te::core::URI &uri) |
| void | Convert2OGCWKBType (unsigned int &gType) |
| It converts the PostGIS geometry type to a pure OGC WKB code. More... | |
| void | Convert2PostGIS (const te::gm::Envelope *e, int srid, std::string &output) |
| It converts the envelope into a PostGIS BOX3D. More... | |
| void | Convert2PostGIS (PGconn *conn, const te::gm::Geometry *g, std::string &output) |
| It converts the geometry into a PostGIS geometry. More... | |
| void | Convert2PostGISWKBType (unsigned int &gType) |
| te::dt::Property * | Convert2TerraLib (unsigned int attNum, const char *attName, unsigned int attType, bool attNotNull, const char *fmt, bool attHasDefault, const char *attDefValue, unsigned int pgisGeomTypeOid, unsigned int pgisRasterTypeOid) |
| It creates a PropertyType from a PostgreSQL attribute description. More... | |
| te::dt::Property * | Convert2TerraLib (unsigned int attNum, const char *attName, unsigned int attType, bool attNotNull, const char *fmt, bool attHasDefault, const char *attDefValue, int ndims, unsigned int pgisGeomTypeOid, unsigned int pgisRasterTypeOid) |
| It creates a PropertyType from a PostgreSQL attribute description. More... | |
| void | Convert2TerraLib (PGresult *result, unsigned int pgisGeomTypeOid, unsigned int pgisRasterTypeOid, std::vector< int > &teTypes) |
| It creates a data set type from a PostGIS internal result. More... | |
| int | Date2Julian (int y, int m, const int d) |
| It returns a julian date (in seconds) from a gregorian date. More... | |
| te::da::FKActionType | GetAction (char a) |
| It converts the PostgreSQL foreign key modifier to a TerraLib data type. More... | |
| template<class T , class ALIGN > | |
| void | GetArray (int i, int j, PGresult *result, std::vector< T > &a) |
| It retrieves information from an unidimensional array. More... | |
| std::string | GetBindableUpdateSQL (const std::vector< te::dt::Property * > &properties) |
| Given a list of properties it constructs a string with bindable parameters that can be used inside an update query. More... | |
| std::string | GetBindableWhereSQL (const std::vector< te::dt::Property * > &properties, const std::size_t offset=0) |
| Given a list of properties it creates an AND connected expression with bindable parameters ($n). More... | |
| std::string | GetBoxSpatialRelation (te::gm::SpatialRelation rel) |
| It converts the spatial relationship to PostGIS dialect. More... | |
| template<class T > | |
| T * | GetCoordSequence (const char *ewkb, const char **endptr, unsigned int gType, char byteOrder) |
| te::gm::Envelope * | GetEnvelope (const char *str) |
| It converts the pgType to a valid TerraLib data type. More... | |
| const std::string & | GetGeometryName (te::gm::GeomType t) |
| It returns the geometry names as usual for PostGIS. More... | |
| te::da::IndexType | GetIndexType (const char *t) |
| It converts the PostgreSQL index string to a TerraLib index type. More... | |
| std::string | GetLoadDataRow (const te::da::DataSetType *dt, te::da::DataSet *d, PGconn *conn) |
| std::string | GetSpatialRelation (te::gm::SpatialRelation rel) |
| It converts the spatial relationship to PostGIS dialect. More... | |
| std::string | GetSQLBindValues (std::size_t nproperties) |
| std::string | GetSQLValue (const te::dt::Property *p, std::size_t propertyPos, te::da::DataSet *d, PGconn *conn) |
| std::string | GetSQLValues (const te::da::DataSetType *dt, te::da::DataSet *d, PGconn *conn) |
| te::dt::DateTime * | Internal2Date (const long dDate) |
| It returns a DateTime type from a date loaded by PostgreSQL. More... | |
| te::dt::DateTime * | Internal2Time (boost::int64_t tval) |
| It returns a DateTime type from a time loaded by PostgreSQL. More... | |
| te::dt::DateTime * | Internal2TimeStamp (boost::int64_t ival) |
| It returns a DateTime type from a timestamp loaded by PostgreSQL. More... | |
| te::dt::DateTime * | Internal2TimeStampTZ (boost::int64_t ival, int z) |
| te::dt::DateTime * | Internal2TimeTZ (boost::int64_t tval, int z) |
| void | Julian2Date (const int jd, int *year, int *month, int *day) |
| It returns a gregorian date from a julian date (in seconds). More... | |
| std::string | MakeConnectionStr (const te::core::URI &connInfo) |
| void | ScapeString (PGconn *conn, const std::string &s, std::string &output) |
| It escapes a string for use within an SQL command. More... | |
| bool | SetColumnDef (std::string &s, const std::string &tname, const te::dt::SimpleProperty *p, bool justDataType=false) |
| void | SetColumnDef (std::string &s, const te::dt::NumericProperty *p, bool justDataType=false) |
| bool | SetColumnDef (std::string &s, const te::dt::Property *p, bool justDataType=false) |
| It writes the PostgreSQL column definition to the output string. More... | |
| void | SetColumnDef (std::string &s, const std::string &tname, const te::dt::StringProperty *p, bool justDataType=false) |
| void | SetColumnDef (std::string &s, const te::dt::ArrayProperty *p, bool justDataType=false) |
| bool | SetColumnDef (std::string &s, const std::string &tname, const te::dt::DateTimeProperty *p, bool justDataType=false) |
| void | SplitTableName (const std::string &fullName, const std::string *defaultSchema, std::string &schemaName, std::string &tableName) |
| TE_LOG_INFO (TE_TR("TerraLib PostGIS driver shutdown!")) | |
| TERRALIB_CPP_PLUGIN_BEGIN (Plugin) TERRALIB_CPP_PLUGIN_STARTUP | |
Variables | |
| m_initialized = false | |
| TERRALIB_CPP_PLUGIN_SHUTDOWN | |
Namespace for the TerraLib PostGIS driver implementation.
| typedef boost::shared_ptr<Transactor> te::pgis::TransactorPtr |
Definition at line 488 of file src/terralib/postgis/Transactor.h.
|
inline |
Definition at line 63 of file src/terralib/postgis/PreparedQuery.cpp.
References te::pgis::PreparedQuery::bind(), te::pgis::PreparedQuery::bindNumeric(), te::dt::BOOLEAN_TYPE, te::dt::BYTE_ARRAY_TYPE, te::dt::CHAR_TYPE, te::dt::DATETIME_TYPE, te::dt::DOUBLE_TYPE, dt, te::dt::FLOAT_TYPE, te::dt::GEOMETRY_TYPE, te::da::DataSet::getBool(), te::da::DataSet::getByteArray(), te::da::DataSet::getChar(), te::da::DataSet::getDateTime(), te::da::DataSet::getDouble(), te::da::DataSet::getFloat(), te::da::DataSet::getGeometry(), te::da::DataSet::getInt16(), te::da::DataSet::getInt32(), te::da::DataSet::getInt64(), te::da::DataSet::getNumeric(), te::da::DataSet::getPropertyDataType(), te::da::DataSet::getString(), te::dt::INT16_TYPE, te::dt::INT32_TYPE, te::dt::INT64_TYPE, te::da::DataSet::isNull(), te::dt::NUMERIC_TYPE, te::dt::STRING_TYPE, and TE_TR.
Referenced by te::pgis::PreparedQuery::bind().
| te::da::DataSource * te::pgis::Build | ( | const te::core::URI & | uri | ) |
Definition at line 30 of file src/terralib/postgis/DataSourceFactory.cpp.
References DataSource(), and ds.
Referenced by TERRALIB_CPP_PLUGIN_BEGIN().
|
inline |
It converts the PostGIS geometry type to a pure OGC WKB code.
This function will turn off the PostGIS flags and will turn on the right bits for OGC WKB type.
| gType | A value that can have some flags set by PostGIS. |
Definition at line 930 of file src/terralib/postgis/Utils.h.
References MakeConnectionStr(), SplitTableName(), TE_EWKB_M_OFFSET, TE_EWKB_Z_OFFSET, and TE_EWKB_ZM_OFFSET.
Referenced by te::ag::Canvas::drawGeometry(), GetCoordSequence(), te::pgis::EWKBReader::getGeometry(), te::pgis::EWKBReader::getGeometryCollection(), te::pgis::EWKBReader::getPoint(), and te::pgis::EWKBReader::getPolygon().
|
inline |
It converts the envelope into a PostGIS BOX3D.
| e | The envelope to be converted. |
| srid | The envelope coordinates SRS. |
| output | The string to output the result. |
Definition at line 228 of file src/terralib/postgis/Utils.h.
References Convert2PostGIS(), te::common::Convert2String(), te::gm::Envelope::m_llx, te::gm::Envelope::m_lly, te::gm::Envelope::m_urx, te::gm::Envelope::m_ury, and ScapeString().
Referenced by te::pgis::Transactor::getDataSet(), and te::pgis::SQLVisitor::visit().
| void te::pgis::Convert2PostGIS | ( | PGconn * | conn, |
| const te::gm::Geometry * | g, | ||
| std::string & | output | ||
| ) |
It converts the geometry into a PostGIS geometry.
| conn | The connection to be used with bytearray. |
| g | The geometry to be converted. |
| output | The string to output the result. |
Definition at line 341 of file src/terralib/postgis/Utils.cpp.
References te::gm::Geometry::getWkbSize(), and te::pgis::EWKBWriter::write().
Referenced by Convert2PostGIS().
|
inline |
Definition at line 960 of file src/terralib/postgis/Utils.h.
References d, dt, GetBindableUpdateSQL(), GetBindableWhereSQL(), GetLoadDataRow(), GetSQLBindValues(), GetSQLValue(), GetSQLValues(), p, TE_EWKB_M_OFFSET, TE_EWKB_Z_OFFSET, and TE_EWKB_ZM_OFFSET.
Referenced by te::pgis::EWKBWriter::visit().
|
inline |
It creates a PropertyType from a PostgreSQL attribute description.
| attNum | The column number (a number in the range [1, num-columns]). |
| attName | The column name. |
| attType | The column type |
| attLen | The column size (depends on column type). |
| attNotNull | If the column is not null. |
| fmt | Column formats: Numeric(20, 30), VARCHAR(30), CHAR(10). |
| attHasDefault | True if the column has a default value. |
| attDefValue | The default value expression if attHasDefValue is true otherwise this has no meaning. |
| pgisGeomTypeOid | The oid of PostGIS geometry type. |
Definition at line 486 of file src/terralib/postgis/Utils.h.
References te::dt::BOOLEAN_TYPE, te::dt::BYTE_ARRAY_TYPE, te::dt::CHAR_TYPE, te::dt::DATE, te::dt::DOUBLE_TYPE, te::dt::FIXED_STRING, te::dt::FLOAT_TYPE, te::dt::INT16_TYPE, te::dt::INT32_TYPE, te::dt::INT64_TYPE, p, PG_BOOL_TYPE, PG_BYTEA_TYPE, PG_CHAR_TYPE, PG_CHARACTER_TYPE, PG_DATE_TYPE, PG_FLOAT4_TYPE, PG_FLOAT8_TYPE, PG_INT2_TYPE, PG_INT4_TYPE, PG_INT8_TYPE, PG_NAME_TYPE, PG_NUMERIC_TYPE, PG_OID_TYPE, PG_TEXT_TYPE, PG_TIME_TYPE, PG_TIMESTAMP_TYPE, PG_TIMESTAMPTZ_TYPE, PG_TIMETZ_TYPE, PG_VARCHAR_TYPE, te::dt::SimpleProperty::setAutoNumber(), te::dt::STRING, te::dt::TIME_DURATION, te::dt::TIME_INSTANT, te::dt::UNKNOWN_TYPE, and te::dt::VAR_STRING.
Referenced by Convert2TerraLib(), te::pgis::Transactor::getDataSet(), te::pgis::Transactor::getProperties(), te::pgis::Transactor::getProperty(), te::pgis::PreparedQuery::query(), and te::pgis::Transactor::query().
|
inline |
It creates a PropertyType from a PostgreSQL attribute description.
| attNum | The column number. |
| attName | The column name. |
| attType | The column type. |
| attNotNull | If the column is not null. |
| fmt | Column formats: Numeric(20, 30), VARCHAR(30), CHAR(10). |
| attHasDefault | True, if the column has a default value. |
| attDefValue | The default value expression, if attHasDefValue is true; otherwise, it has no meaning. |
| ndims | If different of 0, it indicates an array type. |
| pgisGeomTypeOid | The oid of the PostGIS geometry type. |
Definition at line 621 of file src/terralib/postgis/Utils.h.
References Convert2TerraLib(), p, PG__INT2_VECTOR_TYPE, PG_BOOL_ARRAY_TYPE, PG_BOOL_TYPE, PG_BYTEA_ARRAY_TYPE, PG_BYTEA_TYPE, PG_CHAR_ARRAY_TYPE, PG_CHAR_TYPE, PG_CHARACTER_ARRAY_TYPE, PG_CHARACTER_TYPE, PG_DATE_ARRAY_TYPE, PG_DATE_TYPE, PG_FLOAT4_ARRAY_TYPE, PG_FLOAT4_TYPE, PG_FLOAT8_ARRAY_TYPE, PG_FLOAT8_TYPE, PG_INT2_ARRAY_TYPE, PG_INT2_TYPE, PG_INT2_VECTOR_TYPE, PG_INT4_ARRAY_TYPE, PG_INT4_TYPE, PG_INT8_ARRAY_TYPE, PG_INT8_TYPE, PG_NAME_ARRAY_TYPE, PG_NUMERIC_ARRAY_TYPE, PG_NUMERIC_TYPE, PG_OID_ARRAY_TYPE, PG_OID_VECTOR_TYPE, PG_TEXT_ARRAY_TYPE, PG_TEXT_TYPE, PG_TIME_ARRAY_TYPE, PG_TIME_TYPE, PG_TIMESTAMP_ARRAY_TYPE, PG_TIMESTAMP_TYPE, PG_TIMESTAMPTZ_ARRAY_TYPE, PG_TIMESTAMPTZ_TYPE, PG_TIMETZ_ARRAY_TYPE, PG_TIMETZ_TYPE, PG_VARCHAR_ARRAY_TYPE, PG_VARCHAR_TYPE, and te::dt::ArrayProperty::setElementType().
| void te::pgis::Convert2TerraLib | ( | PGresult * | result, |
| unsigned int | pgisGeomTypeOid, | ||
| unsigned int | pgisRasterTypeOid, | ||
| std::vector< int > & | teTypes | ||
| ) |
It creates a data set type from a PostGIS internal result.
| result | A PostGIS internal result. |
| pgisGeomTypeOid | The oid of PostGIS geometry type. |
Definition at line 368 of file src/terralib/postgis/Utils.cpp.
References Convert2TerraLib(), and p.
Referenced by Convert2TerraLib(), and GetBoxSpatialRelation().
It returns a julian date (in seconds) from a gregorian date.
It returns a julian date (in seconds) from a gregorian date. Internally, postgresql stores julian dates.
| y | A year of a gregorian date. |
| m | A month of a gregorian date. |
| d | A day of a gregorian date. |
Definition at line 273 of file src/terralib/postgis/Utils.h.
References d.
|
inline |
It converts the PostgreSQL foreign key modifier to a TerraLib data type.
| a | PostgreSQL foreign key modifier type. |
The equivalent TerraLib foreign key modifier type.
Definition at line 116 of file src/terralib/postgis/Utils.h.
References te::da::CASCADE, te::da::NO_ACTION, te::da::RESTRICT, te::da::SET_DEFAULT, and te::da::SET_NULL.
Referenced by te::pgis::Transactor::getConstraints(), and te::pgis::Transactor::getForeignKey().
|
inline |
It retrieves information from an unidimensional array.
Requirements on types:
| i | The row. |
| j | The column. |
| result | The result to extract the array. |
| a | The output vector. |
Definition at line 77 of file ConnectedDataSet.cpp.
References te::common::Globals::sm_machineByteOrder, and te::common::SwapBytes().
| std::string te::pgis::GetBindableUpdateSQL | ( | const std::vector< te::dt::Property * > & | properties | ) |
Given a list of properties it constructs a string with bindable parameters that can be used inside an update query.
| properties | A vector with property names that will be used to create the expression. |
Definition at line 497 of file src/terralib/postgis/Utils.cpp.
Referenced by Convert2PostGISWKBType(), and te::pgis::Transactor::update().
| std::string te::pgis::GetBindableWhereSQL | ( | const std::vector< te::dt::Property * > & | properties, |
| const std::size_t | offset = 0 |
||
| ) |
Given a list of properties it creates an AND connected expression with bindable parameters ($n).
| itBegin | The start property. |
| itEnd | The mark of end of properties. |
Definition at line 461 of file src/terralib/postgis/Utils.cpp.
Referenced by Convert2PostGISWKBType().
|
inline |
It converts the spatial relationship to PostGIS dialect.
| rel | The spatial relationship. |
Definition at line 879 of file src/terralib/postgis/Utils.h.
References te::gm::CONTAINS, Convert2TerraLib(), te::gm::COVEREDBY, te::gm::COVERS, te::gm::EQUALS, te::gm::INTERSECTS, te::gm::OVERLAPS, and te::gm::WITHIN.
Referenced by te::pgis::Transactor::getDataSet().
|
inline |
Definition at line 44 of file src/terralib/postgis/EWKBReader.cpp.
References Convert2OGCWKBType(), te::gm::LineStringMType, te::gm::LineStringType, te::gm::LineStringZMType, te::gm::LineStringZType, te::common::Globals::sm_machineByteOrder, te::common::SwapBytes(), and TE_EWKB_SRID_FLAG.
|
inline |
It converts the pgType to a valid TerraLib data type.
| cols | An array with column numbers. |
| dt | The DataSetType to look for the property. |
Definition at line 172 of file src/terralib/postgis/Utils.h.
References te::gm::Envelope::m_llx, te::gm::Envelope::m_lly, te::gm::Envelope::m_urx, and te::gm::Envelope::m_ury.
Referenced by te::pgis::Transactor::getExtent().
| const std::string & te::pgis::GetGeometryName | ( | te::gm::GeomType | t | ) |
It returns the geometry names as usual for PostGIS.
| t | The TerraLib geometry type. |
Definition at line 178 of file src/terralib/postgis/Utils.cpp.
References te::gm::GeometryCollectionMType, te::gm::GeometryCollectionType, te::gm::GeometryCollectionZMType, te::gm::GeometryCollectionZType, te::gm::LineStringMType, te::gm::LineStringType, te::gm::LineStringZMType, te::gm::LineStringZType, te::gm::MultiLineStringMType, te::gm::MultiLineStringType, te::gm::MultiLineStringZMType, te::gm::MultiLineStringZType, te::gm::MultiPointMType, te::gm::MultiPointType, te::gm::MultiPointZMType, te::gm::MultiPointZType, te::gm::MultiPolygonMType, te::gm::MultiPolygonType, te::gm::MultiPolygonZMType, te::gm::MultiPolygonZType, te::gm::PointMType, te::gm::PointType, te::gm::PointZMType, te::gm::PointZType, te::gm::PolygonMType, te::gm::PolygonType, te::gm::PolygonZMType, te::gm::PolygonZType, te::pgis::Globals::sm_geometryCollectionMTypeName, te::pgis::Globals::sm_geometryCollectionTypeName, te::pgis::Globals::sm_geometryTypeName, te::pgis::Globals::sm_lineStringMTypeName, te::pgis::Globals::sm_lineStringTypeName, te::pgis::Globals::sm_multiLineStringMTypeName, te::pgis::Globals::sm_multiLineStringTypeName, te::pgis::Globals::sm_multiPointMTypeName, te::pgis::Globals::sm_multiPointTypeName, te::pgis::Globals::sm_multiPolygonMTypeName, te::pgis::Globals::sm_multiPolygonTypeName, te::pgis::Globals::sm_pointMTypeName, te::pgis::Globals::sm_pointTypeName, te::pgis::Globals::sm_polygonMTypeName, and te::pgis::Globals::sm_polygonTypeName.
Referenced by te::pgis::Transactor::addProperty(), and te::pgis::Transactor::getGeometryTypeName().
|
inline |
It converts the PostgreSQL index string to a TerraLib index type.
| t | PostgreSQL index name (A NULL terminated string). |
The equivalent TerraLib foreign key modifier type.
Definition at line 144 of file src/terralib/postgis/Utils.h.
References te::da::B_TREE_TYPE, te::da::HASH_TYPE, and te::da::R_TREE_TYPE.
Referenced by te::pgis::Transactor::getIndex(), and te::pgis::Transactor::getIndexes().
| std::string te::pgis::GetLoadDataRow | ( | const te::da::DataSetType * | dt, |
| te::da::DataSet * | d, | ||
| PGconn * | conn | ||
| ) |
Definition at line 665 of file src/terralib/postgis/Utils.cpp.
References d, te::dt::CompositeProperty::getProperty(), GetSQLValue(), and te::dt::CompositeProperty::size().
Referenced by Convert2PostGISWKBType().
|
inline |
It converts the spatial relationship to PostGIS dialect.
| rel | The spatial relationship. |
Definition at line 833 of file src/terralib/postgis/Utils.h.
References te::gm::CONTAINS, te::gm::COVEREDBY, te::gm::COVERS, te::gm::CROSSES, te::gm::DISJOINT, te::gm::EQUALS, te::gm::INTERSECTS, te::gm::OVERLAPS, te::gm::TOUCHES, and te::gm::WITHIN.
Referenced by te::pgis::Transactor::getDataSet().
| std::string te::pgis::GetSQLBindValues | ( | std::size_t | nproperties | ) |
Definition at line 480 of file src/terralib/postgis/Utils.cpp.
Referenced by te::pgis::Transactor::add(), and Convert2PostGISWKBType().
| std::string te::pgis::GetSQLValue | ( | const te::dt::Property * | p, |
| std::size_t | propertyPos, | ||
| te::da::DataSet * | d, | ||
| PGconn * | conn | ||
| ) |
Definition at line 535 of file src/terralib/postgis/Utils.cpp.
References te::core::Binary2Hex(), te::dt::BOOLEAN_TYPE, te::dt::BYTE_ARRAY_TYPE, te::dt::CHAR_TYPE, te::dt::DATETIME_TYPE, te::dt::DOUBLE_TYPE, dt, te::dt::FLOAT_TYPE, te::dt::GEOMETRY_TYPE, te::da::DataSet::getBool(), te::da::DataSet::getByteArray(), te::da::DataSet::getChar(), te::da::DataSet::getDateTime(), te::da::DataSet::getDouble(), te::da::DataSet::getFloat(), te::da::DataSet::getGeometry(), te::da::DataSet::getInt16(), te::da::DataSet::getInt32(), te::da::DataSet::getInt64(), te::da::DataSet::getNumeric(), te::da::DataSet::getString(), te::dt::Property::getType(), te::dt::INT16_TYPE, te::dt::INT32_TYPE, te::dt::INT64_TYPE, te::dt::NUMERIC_TYPE, te::dt::STRING_TYPE, TE_TR, te::dt::TimeDuration::toString(), and te::pgis::EWKBWriter::write().
Referenced by Convert2PostGISWKBType(), GetLoadDataRow(), and GetSQLValues().
| std::string te::pgis::GetSQLValues | ( | const te::da::DataSetType * | dt, |
| te::da::DataSet * | d, | ||
| PGconn * | conn | ||
| ) |
Definition at line 516 of file src/terralib/postgis/Utils.cpp.
References d, te::dt::CompositeProperty::getProperty(), GetSQLValue(), and te::dt::CompositeProperty::size().
Referenced by Convert2PostGISWKBType().
|
inline |
It returns a DateTime type from a date loaded by PostgreSQL.
It returns a DateTime type from a date loaded by PostgreSQL. Internelly, PostgreSQL stores julian dates in 4 bytes, so this function has to convert it to gregorian date. Besides that, PostgreSQL stores date as seconds before or after midnight 2000-01-01. Therefore, this function has to sum the number of seconds (2451545 seconds) between 01-01-01 00:00:00 and 01-01-2000 00:00:00 to the date.
| dDate | A julian date in seconds loaded by PostgreSQL. |
| return | A gregorian date from the input julian date. |
Definition at line 346 of file src/terralib/postgis/Utils.h.
References Julian2Date().
Referenced by te::pgis::DataSet::getDateTime(), te::pgis::ConnectedDataSet::getDateTime(), Internal2TimeStamp(), and Internal2TimeStampTZ().
|
inline |
It returns a DateTime type from a time loaded by PostgreSQL.
It returns a DateTime type from a time loaded by PostgreSQL. Internelly, PostgreSQL stores time as seconds.
| tval | The amount of seconds loaded by PostgreSQL. |
| return | A time (hour, minute, second) from the input amount of seconds. |
Definition at line 365 of file src/terralib/postgis/Utils.h.
References td.
Referenced by te::pgis::DataSet::getDateTime(), te::pgis::ConnectedDataSet::getDateTime(), and Internal2TimeStamp().
|
inline |
It returns a DateTime type from a timestamp loaded by PostgreSQL.
It returns a DateTime type from a timestamp loaded by PostgreSQL. Internelly, PostgreSQL stores timestamp as seconds before or after midnight 2000-01-01.
| ival | The timestamp, in seconds, loaded by PostgreSQL. |
| return | A time instant from the input timestamp. |
Definition at line 416 of file src/terralib/postgis/Utils.h.
References Internal2Date(), and Internal2Time().
Referenced by te::pgis::DataSet::getDateTime(), and te::pgis::ConnectedDataSet::getDateTime().
|
inline |
Definition at line 440 of file src/terralib/postgis/Utils.h.
References te::dt::Date::getDate(), te::dt::TimeInstantTZ::getTimeInstantTZ(), Internal2Date(), and Internal2TimeTZ().
Referenced by te::pgis::DataSet::getDateTime(), and te::pgis::ConnectedDataSet::getDateTime().
|
inline |
Definition at line 380 of file src/terralib/postgis/Utils.h.
References td.
Referenced by te::pgis::DataSet::getDateTime(), te::pgis::ConnectedDataSet::getDateTime(), and Internal2TimeStampTZ().
It returns a gregorian date from a julian date (in seconds).
It returns a gregorian date from a julian date (in seconds).
| jd | A julian date in seconds (INPUT). |
| year | The year of a gregorian date that will be filled by this function (OUTPUT). |
| month | The month of a gregorian date that will be filled by this function (OUTPUT). |
| day | The day of a gregorian date that will be filled by this function (OUTPUT). |
Definition at line 307 of file src/terralib/postgis/Utils.h.
Referenced by Internal2Date().
| std::string te::pgis::MakeConnectionStr | ( | const te::core::URI & | connInfo | ) |
Definition at line 384 of file src/terralib/postgis/Utils.cpp.
References te::core::Expand(), te::core::URI::host(), te::core::URI::password(), te::core::URI::path(), te::core::URI::port(), te::core::URI::query(), te::core::URIDecode(), and te::core::URI::user().
Referenced by Convert2OGCWKBType(), and te::pgis::ConnectionPool::initialize().
| void te::pgis::ScapeString | ( | PGconn * | conn, |
| const std::string & | s, | ||
| std::string & | output | ||
| ) |
It escapes a string for use within an SQL command.
| conn | The connection to be used with bytearray. |
| s | The string to be scapaded. |
| output | The string to output the result. |
Definition at line 359 of file src/terralib/postgis/Utils.cpp.
Referenced by Convert2PostGIS().
|
inline |
Definition at line 50 of file src/terralib/postgis/Utils.cpp.
References te::dt::SimpleProperty::getDefaultValue(), te::dt::Property::getType(), te::dt::INT32_TYPE, te::dt::INT64_TYPE, te::dt::SimpleProperty::isAutoNumber(), and te::dt::SimpleProperty::isRequired().
Referenced by te::pgis::Transactor::addProperty(), te::pgis::Transactor::changePropertyDefinition(), and SetColumnDef().
|
inline |
Definition at line 75 of file src/terralib/postgis/Utils.cpp.
References te::common::Convert2String(), te::dt::SimpleProperty::getDefaultValue(), te::dt::NumericProperty::getPrecision(), te::dt::NumericProperty::getScale(), te::dt::SimpleProperty::isRequired(), and te::pgis::Globals::sm_numericTypeName.
| bool te::pgis::SetColumnDef | ( | std::string & | s, |
| const te::dt::Property * | p, | ||
| bool | justDataType = false |
||
| ) |
It writes the PostgreSQL column definition to the output string.
| s | The string to output the column definition. |
| p | The TerraLib propoerty type. |
| Exception | It throws an exception if the data type is not mapped to the PostgreSQL type system. |
Definition at line 243 of file src/terralib/postgis/Utils.cpp.
References te::dt::ARRAY_TYPE, te::dt::BOOLEAN_TYPE, te::dt::BYTE_ARRAY_TYPE, te::dt::CHAR_TYPE, te::dt::DATE, te::dt::DATETIME_TYPE, te::dt::DOUBLE_TYPE, te::dt::FIXED_STRING, te::dt::FLOAT_TYPE, te::dt::GEOMETRY_TYPE, te::dt::StringProperty::getSubType(), te::dt::DateTimeProperty::getSubType(), te::dt::Property::getType(), te::dt::INT16_TYPE, te::dt::INT32_TYPE, te::dt::INT64_TYPE, te::dt::NUMERIC_TYPE, p, SetColumnDef(), te::dt::StringProperty::size(), te::pgis::Globals::sm_booleanTypeName, te::pgis::Globals::sm_byteArrayTypeName, te::pgis::Globals::sm_charTypeName, te::pgis::Globals::sm_dateTypeName, te::pgis::Globals::sm_doubleTypeName, te::pgis::Globals::sm_fixedcharTypeName, te::pgis::Globals::sm_floatTypeName, te::pgis::Globals::sm_geometryTypeName, te::pgis::Globals::sm_int2TypeName, te::pgis::Globals::sm_int8TypeName, te::pgis::Globals::sm_intTypeName, te::pgis::Globals::sm_stringTypeName, te::pgis::Globals::sm_timeStampTypeName, te::pgis::Globals::sm_timeStampTZTypeName, te::pgis::Globals::sm_timeTypeName, te::pgis::Globals::sm_varcharTypeName, te::dt::STRING_TYPE, TE_TR, te::dt::TIME_DURATION, te::dt::TIME_INSTANT, te::dt::TIME_INSTANT_TZ, and te::dt::VAR_STRING.
|
inline |
Definition at line 102 of file src/terralib/postgis/Utils.cpp.
References te::common::Convert2String(), te::dt::SimpleProperty::getDefaultValue(), te::dt::SimpleProperty::isRequired(), and te::dt::StringProperty::size().
|
inline |
Definition at line 127 of file src/terralib/postgis/Utils.cpp.
References te::dt::SimpleProperty::getDefaultValue(), te::dt::ArrayProperty::getElementType(), te::dt::SimpleProperty::isRequired(), and SetColumnDef().
|
inline |
Definition at line 148 of file src/terralib/postgis/Utils.cpp.
References te::common::Convert2String(), te::dt::DATE, te::dt::SimpleProperty::getDefaultValue(), te::dt::DateTimeProperty::getPrecision(), te::dt::DateTimeProperty::getSubType(), te::dt::SimpleProperty::isAutoNumber(), and te::dt::SimpleProperty::isRequired().
| void te::pgis::SplitTableName | ( | const std::string & | fullName, |
| const std::string * | defaultSchema, | ||
| std::string & | schemaName, | ||
| std::string & | tableName | ||
| ) |
| te::pgis::TE_LOG_INFO | ( | TE_TR("TerraLib PostGIS driver shutdown!") | ) |
Referenced by TERRALIB_CPP_PLUGIN_BEGIN().
| te::pgis::TERRALIB_CPP_PLUGIN_BEGIN | ( | Plugin | ) |
Definition at line 53 of file src/terralib/postgis/Plugin.cpp.
References te::da::DataSourceFactory::add(), Build(), te::core::FindInTerraLibPath(), m_initialized, te::serialize::xml::Read(), te::pgis::Globals::sm_capabilities, te::pgis::Globals::sm_queryDialect, TE_LOG_INFO(), TE_TR, and TERRALIB_CPP_PLUGIN_SHUTDOWN.
| te::pgis::m_initialized = false |
Definition at line 93 of file src/terralib/postgis/Plugin.cpp.
Referenced by TERRALIB_CPP_PLUGIN_BEGIN().
| te::pgis::TERRALIB_CPP_PLUGIN_SHUTDOWN |
Definition at line 80 of file src/terralib/postgis/Plugin.cpp.
Referenced by TERRALIB_CPP_PLUGIN_BEGIN().