TerraLib 4.1
TePostgreSQL Class Reference

PostgreSQL database access class. More...

#include <TePostgreSQL.h>

Inheritance diagram for TePostgreSQL:
TeDatabase TePostGIS

List of all members.

Public Member Functions

 TePostgreSQL ()
 Constructor.
virtual ~TePostgreSQL ()
 Destructor.
string errorMessage ()
 Returns the error message from the server.
virtual bool newDatabase (const string &database, const string &user, const string &password, const string &host, const int &port=-1, bool terralibModel=true, const std::string &characterSet="")
 Creates a new database based on "template1" and open a connection to the new one.
virtual bool connect (const string &host, const string &user, const string &password, const string &database, int port=-1)
 Opens a conection to a database server.
virtual bool connect (pg_conn *conn)
virtual bool showDatabases (const string &host, const string &user, const string &password, vector< string > &dbNames, int port=-1)
 Show the server databases (only for MySQL, Oracle and PostgreSQL)
void close (void)
 Closes the conection.
bool listTables (vector< string > &tableList)
 Returns a list of tables in a database.
virtual bool listDatabases (std::vector< std::string > &databaseList)
 Returns a lista of databases.
virtual bool dropDatabase (const std::string &databaseName)
 Drop a database.
bool tableExist (const string &table)
 Verifies if a table exist.
virtual bool deleteTable (const string &table)
 Deletes a table. Do not allow the deletion of model tables.
bool columnExist (const string &table, const string &column, TeAttribute &attr)
 Verifies if a table has a column.
virtual bool createTable (const string &table, TeAttributeList &attr)
 Creates a generic table.
virtual bool addColumn (const string &table, TeAttributeRep &rep)
 Adds an attribute field.
bool createRelation (const string &relName, const string &table, const string &fieldName, const string &relatedTable, const string &relatedField, bool cascadeDeletion)
 Creates a reationship between two tables.
TeDBRelationType existRelation (const string &tableName, const string &relName)
 Checks if a relation exist.
bool execute (const string &sql)
 Executes a SQL command that doesnt return a record set tipically a data definition comand.
virtual TeDatabasePortalgetPortal ()
 Returns a portal associated to this database.
bool insertTable (TeTable &table)
 Saves a table and its contents in the database.
bool updateTable (TeTable &table)
 Updates a table and its contents in the database.
bool insertRelationInfo (const int tableId, const string &tField, const string &rTable, const string &rField, int &relId)
 Inserts information about a link to an external table.
bool insertTableInfo (int layerId, TeTable &table, const string &user="")
 Insert information about a table related to a layer.
bool alterTable (const string &tableName, TeAttributeRep &rep, const string &oldColName="")
 Alter a property of a table.
bool alterTable (const string &oldTableName, const string &newTableName)
 Alter a table name.
bool insertBlob (const string &tableName, const string &columnBlob, const string &whereClause, unsigned char *data, int size)
 Saves a large binary objects (BLOB) in a row table.
bool insertProjection (TeProjection *proj)
 Insert information about a geographical projection.
bool insertLayer (TeLayer *layer)
 Insert information about a layer.
bool insertProject (TeProject *proj)
 Insert information about a project.
bool insertRepresentation (int layerId, TeRepresentation &rep)
 Insert information about a geometrical representation.
bool insertView (TeView *view)
 Inserts information about a view.
bool insertViewTree (TeViewTree *tree)
 Inserts view tree information.
bool insertThemeGroup (TeViewTree *tree)
 Inserts a theme group.
bool insertTheme (TeAbstractTheme *theme)
 Inserts theme information.
bool insertThemeTable (int themeId, int tableId, int relationId, int tableOrder)
 Inserts information about a table used by a theme.
virtual bool generateLabelPositions (TeTheme *theme, const std::string &objectId="")
 Generate the label position (x,y) to each object of a theme.
bool insertLegend (TeLegendEntry *legend)
 Inserts legend information.
virtual bool loadPolygonSet (const string &table, TeBox &box, TePolygonSet &ps)
 Returns all polygons inside a given box.
virtual TeDatabasePortalloadPolygonSet (const string &table, TeBox &box)
 Returns a database portal to iterate over the polygons that are inside a given box.
virtual bool locatePolygon (const string &table, TeCoord2D &pt, TePolygon &polygon, const double &tol=0.0)
 Returns the first polygon that contais a given coordinate.
virtual bool locatePolygonSet (const string &table, TeCoord2D &pt, double tol, TePolygonSet &polygons)
 Returns the polygons that contains a give coordinate.
virtual bool insertPolygon (const string &table, TePolygon &p)
 Inserts a polygon.
virtual bool updatePolygon (const string &table, TePolygon &p)
 Updates a polygon.
virtual bool loadLineSet (const string &table, TeBox &box, TeLineSet &linSet)
virtual TeDatabasePortalloadLineSet (const string &table, TeBox &box)
virtual bool insertLine (const string &table, TeLine2D &l)
 Inserts a line.
virtual bool updateLine (const string &table, TeLine2D &l)
 Updates a line.
virtual bool locateLine (const string &table, TeCoord2D &pt, TeLine2D &line, const double &tol=0.0)
 Locates a line.
virtual bool insertPoint (const string &table, TePoint &p)
 Inserts a point.
virtual bool updatePoint (const string &table, TePoint &p)
virtual bool locatePoint (const string &table, TeCoord2D &pt, TePoint &point, const double &tol=0.0)
 Locates a point.
bool insertText (const string &table, TeText &t)
 Inserts text.
bool insertArc (const string &table, TeArc &arc)
 Inserts an arc.
virtual bool insertNode (const string &table, TeNode &node)
 Inserts a node.
virtual bool updateNode (const string &table, TeNode &node)
virtual bool insertCell (const string &table, TeCell &c)
 Inserts a cell.
virtual bool updateCell (const string &table, TeCell &c)
virtual bool locateCell (const string &table, TeCoord2D &pt, TeCell &c, const double &tol=0.0)
virtual bool insertRasterBlock (const string &table, const string &blockId, const TeCoord2D &ll, const TeCoord2D &ur, unsigned char *buf, unsigned long size, int band=0, unsigned int res=1, unsigned int subband=0)
 Insert a raster block into the database.
string getSQLStatistics (TeGroupingAttr &attrs)
 Return a string SQL to calculate the statistics to each cell through database functions.
string getSQLTemporalWhere (TeTimeInterval &timeInterval, TeTemporalRelation timeOperator, const string &initialTime, const string &finalTime)
 Return a string SQL to temporal where.
string getSQLTemporalWhere (int time1, int time2, TeChronon chr, TeTemporalRelation rel, const string &initialTime, const string &finalTime)
 Return a string SQL to temporal where.
string getAutoNumberSQL (const string &table)
 Return the database function to generate autonumber values.
string getSQLTime (const TeTime &t) const
 Decodes a time structure into a time string that PostgreSQL can understand.
string concatValues (vector< string > &values, const string &unionString)
 Concat values in a vector using unionString as the join between each value.
string toUpper (const string &value)
 Returns the SQL function for upper case.
string leftString (const string &name, const int &length)
 Returns the SQL function for substring that starts from left to right with informed length.
virtual bool createSpatialIndex (const string &table, const string &column, TeSpatialIndexType type=TeRTREE, short level=0, short tile=0)
 Creates a spatial index on column table.
virtual string getSQLBoxWhere (const TeBox &box, const TeGeomRep rep, const std::string &tableName)
 Return a string that describes a where clause to return the geometries inside the box.
virtual string getSQLBoxWhere (const string &table1, const string &table2, TeGeomRep rep2, TeGeomRep rep1=TePOLYGONS)
 Returns a string that describes a where clause to return the geometries of the table2 that are inside the geometries box of the table1.
virtual string getSQLBoxSelect (const string &tableName, TeGeomRep rep)
 Return a string SQL to be used in the clause SELECT to select the box (lower_x, lower_y, upper_x, upper_y)
virtual bool getMBRGeom (string tableGeom, string object_id, TeBox &box, string colGeom)
 Returns the box of a specific geometry (object_id)
virtual bool getMBRSelectedObjects (string geomTable, string colGeom, string fromClause, string whereClause, string afterWhereClause, TeGeomRep repType, TeBox &bout, const double &tol=0.0)
 Return the box of a select objects set.
virtual string getSpatialIdxColumn (TeGeomRep rep)
 Returns the name of the column that wiil be the spatially indexed, for a given type of geometry table.
bool beginTransaction ()
 Begins a transaction.
bool commitTransaction ()
 Commits a transaction.
bool rollbackTransaction ()
 Rollbacks a transaction.
virtual std::string getClientEncoding ()
 Gets the client encoding.
virtual bool setClientEncoding (const std::string &characterSet)
 Sets the client encoding.
virtual bool getEncodingList (std::vector< std::string > &vecEncodingList)
 Retrives the list of available character sets.
virtual bool getEncodingList (const std::string &host, const std::string &user, const std::string &password, const int &port, std::vector< std::string > &vecEncodingList)
 Retrives the list of available character sets.
virtual bool getIndexesFromTable (const string &tableName, std::vector< TeDatabaseIndex > &vecIndexes)
 Return a TeDatabaseIndex vector from a table.
virtual bool getAttributeList (const string &tableName, TeAttributeList &attList)
 Gets the list of attributes of a table.
Connection

Methods related with connections.

virtual void setConnection (TeConnection *c)
 Sets a connection that will be used by database.
virtual TeConnectiongetConnection ()
 Gets the connection used by database.

Protected Member Functions

virtual void getInsertRasterBlock (const string &table, const string &blockId, const TeCoord2D &ll, const TeCoord2D &ur, const int &band, const unsigned int &res, const unsigned int &subband, char *buf, const unsigned long &size, string &sql)
 Returns a string with insert of a raster block.
virtual void getUpdateRasterBlock (const string &table, const string &blockId, const TeCoord2D &ll, const TeCoord2D &ur, const int &band, const unsigned int &res, const unsigned int &subband, char *buf, const unsigned long &size, string &sql)
 Returns a string with update of a raster block.
string escapeSequence (const string &from)
 Escape special characters in a string to be used in a SQL statement.
bool realConnect (const string &host, const string &user, const string &password, const string &database, int port=-1)
 Opens a conection to a database server.

Protected Attributes

TePGConnectiontepg_connection_
 Connection to a PostgreSQL server.
TePGConnectiontepg_connection_ref
std::string gistBoxOps_
 Choose GIST OPERATOR beteween PostgreSQL 8.0 and 8.1.
int transactionCounter_
 Keeps the number of opened transactions.

Friends

class TePostgreSQLPortal

Detailed Description

PostgreSQL database access class.

This class contains the implementation of common methods for TerraLib access PostgreSQL. //

Note:
MAKE SURE you have UPGRADE your PostgreSQL database before use this driver. If you need to upgrade without use TerraView, please look at TeUpdateDBVersion.cpp for the routines: updateDB302To310 and PostgreSQLUpdateDB302To310, for a tip on how to upgrade by yourself.
Author:
Gilberto Ribeiro de Queiroz <gribeiro@dpi.inpe.br>

Constructor & Destructor Documentation

TePostgreSQL::TePostgreSQL ( )

Constructor.

TePostgreSQL::~TePostgreSQL ( ) [virtual]

Destructor.


Member Function Documentation

bool TePostgreSQL::addColumn ( const string table,
TeAttributeRep rep 
) [virtual]

Adds an attribute field.

Implements TeDatabase.

bool TePostgreSQL::alterTable ( const string tableName,
TeAttributeRep rep,
const string oldColName = "" 
) [virtual]

Alter a property of a table.

Reimplemented from TeDatabase.

bool TePostgreSQL::alterTable ( const string oldTableName,
const string newTableName 
) [virtual]

Alter a table name.

Reimplemented from TeDatabase.

bool TePostgreSQL::beginTransaction ( void  ) [virtual]

Begins a transaction.

Reimplemented from TeDatabase.

void TePostgreSQL::close ( void  ) [virtual]

Closes the conection.

Implements TeDatabase.

bool TePostgreSQL::columnExist ( const string table,
const string column,
TeAttribute attr 
) [virtual]

Verifies if a table has a column.

Implements TeDatabase.

bool TePostgreSQL::commitTransaction ( void  ) [virtual]

Commits a transaction.

Reimplemented from TeDatabase.

string TePostgreSQL::concatValues ( vector< string > &  values,
const string unionString 
) [virtual]

Concat values in a vector using unionString as the join between each value.

Implements TeDatabase.

bool TePostgreSQL::connect ( const string host,
const string user,
const string password,
const string database,
int  port = -1 
) [virtual]

Opens a conection to a database server.

Implements TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::connect ( pg_conn *  conn) [virtual]
bool TePostgreSQL::createRelation ( const string relName,
const string table,
const string fieldName,
const string relatedTable,
const string relatedField,
bool  cascadeDeletion 
) [virtual]

Creates a reationship between two tables.

Implements TeDatabase.

bool TePostgreSQL::createSpatialIndex ( const string table,
const string column,
TeSpatialIndexType  type = TeRTREE,
short  level = 0,
short  tile = 0 
) [virtual]

Creates a spatial index on column table.

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::createTable ( const string table,
TeAttributeList attr 
) [virtual]

Creates a generic table.

Implements TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::deleteTable ( const string table) [virtual]

Deletes a table. Do not allow the deletion of model tables.

Reimplemented from TeDatabase.

bool TePostgreSQL::dropDatabase ( const std::string databaseName) [virtual]

Drop a database.

Reimplemented from TeDatabase.

string TePostgreSQL::errorMessage ( ) [virtual]

Returns the error message from the server.

Reimplemented from TeDatabase.

string TePostgreSQL::escapeSequence ( const string from) [protected, virtual]

Escape special characters in a string to be used in a SQL statement.

Implements TeDatabase.

bool TePostgreSQL::execute ( const string sql) [virtual]

Executes a SQL command that doesnt return a record set tipically a data definition comand.

Implements TeDatabase.

TeDBRelationType TePostgreSQL::existRelation ( const string tableName,
const string relName 
) [virtual]

Checks if a relation exist.

Implements TeDatabase.

bool TePostgreSQL::generateLabelPositions ( TeTheme theme,
const std::string objectId = "" 
) [virtual]

Generate the label position (x,y) to each object of a theme.

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::getAttributeList ( const string tableName,
TeAttributeList attList 
) [virtual]

Gets the list of attributes of a table.

Reimplemented from TeDatabase.

string TePostgreSQL::getAutoNumberSQL ( const string table)

Return the database function to generate autonumber values.

std::string TePostgreSQL::getClientEncoding ( ) [virtual]

Gets the client encoding.

Reimplemented from TeDatabase.

TeConnection * TePostgreSQL::getConnection ( ) [virtual]

Gets the connection used by database.

Note:
The caller of this method will take the ownership of the returned pointer.

Reimplemented from TeDatabase.

bool TePostgreSQL::getEncodingList ( const std::string host,
const std::string user,
const std::string password,
const int &  port,
std::vector< std::string > &  vecEncodingList 
) [virtual]

Retrives the list of available character sets.

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::getEncodingList ( std::vector< std::string > &  vecEncodingList) [virtual]

Retrives the list of available character sets.

Reimplemented from TeDatabase.

bool TePostgreSQL::getIndexesFromTable ( const string tableName,
std::vector< TeDatabaseIndex > &  vecIndexes 
) [virtual]

Return a TeDatabaseIndex vector from a table.

Reimplemented from TeDatabase.

void TePostgreSQL::getInsertRasterBlock ( const string table,
const string blockId,
const TeCoord2D ll,
const TeCoord2D ur,
const int &  band,
const unsigned int &  res,
const unsigned int &  subband,
char *  buf,
const unsigned long &  size,
string sql 
) [protected, virtual]

Returns a string with insert of a raster block.

bool TePostgreSQL::getMBRGeom ( string  tableGeom,
string  object_id,
TeBox box,
string  colGeom 
) [virtual]

Returns the box of a specific geometry (object_id)

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::getMBRSelectedObjects ( string  geomTable,
string  colGeom,
string  fromClause,
string  whereClause,
string  afterWhereClause,
TeGeomRep  repType,
TeBox bout,
const double &  tol = 0.0 
) [virtual]

Return the box of a select objects set.

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

TeDatabasePortal * TePostgreSQL::getPortal ( ) [virtual]

Returns a portal associated to this database.

Implements TeDatabase.

Reimplemented in TePostGIS.

string TePostgreSQL::getSpatialIdxColumn ( TeGeomRep  rep) [virtual]

Returns the name of the column that wiil be the spatially indexed, for a given type of geometry table.

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

string TePostgreSQL::getSQLBoxSelect ( const string tableName,
TeGeomRep  rep 
) [virtual]

Return a string SQL to be used in the clause SELECT to select the box (lower_x, lower_y, upper_x, upper_y)

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

string TePostgreSQL::getSQLBoxWhere ( const TeBox box,
const TeGeomRep  rep,
const std::string tableName 
) [virtual]

Return a string that describes a where clause to return the geometries inside the box.

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

string TePostgreSQL::getSQLBoxWhere ( const string table1,
const string table2,
TeGeomRep  rep2,
TeGeomRep  rep1 = TePOLYGONS 
) [virtual]

Returns a string that describes a where clause to return the geometries of the table2 that are inside the geometries box of the table1.

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

string TePostgreSQL::getSQLStatistics ( TeGroupingAttr attrs) [virtual]

Return a string SQL to calculate the statistics to each cell through database functions.

Reimplemented from TeDatabase.

string TePostgreSQL::getSQLTemporalWhere ( TeTimeInterval timeInterval,
TeTemporalRelation  timeOperator,
const string initialTime,
const string finalTime 
) [virtual]

Return a string SQL to temporal where.

Reimplemented from TeDatabase.

string TePostgreSQL::getSQLTemporalWhere ( int  time1,
int  time2,
TeChronon  chr,
TeTemporalRelation  rel,
const string initialTime,
const string finalTime 
) [virtual]

Return a string SQL to temporal where.

Reimplemented from TeDatabase.

string TePostgreSQL::getSQLTime ( const TeTime t) const [virtual]

Decodes a time structure into a time string that PostgreSQL can understand.

Reimplemented from TeDatabase.

void TePostgreSQL::getUpdateRasterBlock ( const string table,
const string blockId,
const TeCoord2D ll,
const TeCoord2D ur,
const int &  band,
const unsigned int &  res,
const unsigned int &  subband,
char *  buf,
const unsigned long &  size,
string sql 
) [protected, virtual]

Returns a string with update of a raster block.

bool TePostgreSQL::insertArc ( const string table,
TeArc arc 
) [virtual]

Inserts an arc.

Implements TeDatabase.

bool TePostgreSQL::insertBlob ( const string tableName,
const string columnBlob,
const string whereClause,
unsigned char *  data,
int  size 
) [virtual]

Saves a large binary objects (BLOB) in a row table.

Implements TeDatabase.

bool TePostgreSQL::insertCell ( const string table,
TeCell c 
) [virtual]

Inserts a cell.

Implements TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::insertLayer ( TeLayer layer) [virtual]

Insert information about a layer.

Implements TeDatabase.

bool TePostgreSQL::insertLegend ( TeLegendEntry legend) [virtual]

Inserts legend information.

Implements TeDatabase.

bool TePostgreSQL::insertLine ( const string table,
TeLine2D l 
) [virtual]

Inserts a line.

Implements TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::insertNode ( const string table,
TeNode node 
) [virtual]

Inserts a node.

Implements TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::insertPoint ( const string table,
TePoint p 
) [virtual]

Inserts a point.

Implements TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::insertPolygon ( const string table,
TePolygon p 
) [virtual]

Inserts a polygon.

Implements TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::insertProject ( TeProject proj) [virtual]

Insert information about a project.

Implements TeDatabase.

bool TePostgreSQL::insertProjection ( TeProjection proj) [virtual]

Insert information about a geographical projection.

Implements TeDatabase.

bool TePostgreSQL::insertRasterBlock ( const string table,
const string blockId,
const TeCoord2D ll,
const TeCoord2D ur,
unsigned char *  buf,
unsigned long  size,
int  band = 0,
unsigned int  res = 1,
unsigned int  subband = 0 
) [virtual]

Insert a raster block into the database.

Implements TeDatabase.

bool TePostgreSQL::insertRelationInfo ( const int  tableId,
const string tField,
const string rTable,
const string rField,
int &  relId 
) [virtual]

Inserts information about a link to an external table.

Implements TeDatabase.

bool TePostgreSQL::insertRepresentation ( int  layerId,
TeRepresentation rep 
) [virtual]

Insert information about a geometrical representation.

Implements TeDatabase.

bool TePostgreSQL::insertTable ( TeTable table) [virtual]

Saves a table and its contents in the database.

Reimplemented from TeDatabase.

bool TePostgreSQL::insertTableInfo ( int  layerId,
TeTable table,
const string user = "" 
) [virtual]

Insert information about a table related to a layer.

Implements TeDatabase.

bool TePostgreSQL::insertText ( const string table,
TeText t 
) [virtual]

Inserts text.

Implements TeDatabase.

bool TePostgreSQL::insertTheme ( TeAbstractTheme theme) [virtual]

Inserts theme information.

Implements TeDatabase.

bool TePostgreSQL::insertThemeGroup ( TeViewTree tree) [virtual]

Inserts a theme group.

Implements TeDatabase.

bool TePostgreSQL::insertThemeTable ( int  themeId,
int  tableId,
int  relationId,
int  tableOrder 
) [virtual]

Inserts information about a table used by a theme.

Implements TeDatabase.

bool TePostgreSQL::insertView ( TeView view) [virtual]

Inserts information about a view.

Implements TeDatabase.

bool TePostgreSQL::insertViewTree ( TeViewTree tree) [virtual]

Inserts view tree information.

Implements TeDatabase.

string TePostgreSQL::leftString ( const string name,
const int &  length 
) [virtual]

Returns the SQL function for substring that starts from left to right with informed length.

Reimplemented from TeDatabase.

bool TePostgreSQL::listDatabases ( std::vector< std::string > &  databaseList) [virtual]

Returns a lista of databases.

Reimplemented from TeDatabase.

bool TePostgreSQL::listTables ( vector< string > &  ) [virtual]

Returns a list of tables in a database.

Reimplemented from TeDatabase.

bool TePostgreSQL::loadLineSet ( const string table,
TeBox box,
TeLineSet linSet 
) [virtual]

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

TeDatabasePortal * TePostgreSQL::loadLineSet ( const string table,
TeBox box 
) [virtual]

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::loadPolygonSet ( const string table,
TeBox box,
TePolygonSet ps 
) [virtual]

Returns all polygons inside a given box.

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

TeDatabasePortal * TePostgreSQL::loadPolygonSet ( const string table,
TeBox box 
) [virtual]

Returns a database portal to iterate over the polygons that are inside a given box.

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::locateCell ( const string table,
TeCoord2D pt,
TeCell c,
const double &  tol = 0.0 
) [virtual]

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::locateLine ( const string table,
TeCoord2D pt,
TeLine2D line,
const double &  tol = 0.0 
) [virtual]

Locates a line.

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::locatePoint ( const string table,
TeCoord2D pt,
TePoint point,
const double &  tol = 0.0 
) [virtual]

Locates a point.

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::locatePolygon ( const string table,
TeCoord2D pt,
TePolygon polygon,
const double &  tol = 0.0 
) [virtual]

Returns the first polygon that contais a given coordinate.

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::locatePolygonSet ( const string table,
TeCoord2D pt,
double  tol,
TePolygonSet polygons 
) [virtual]

Returns the polygons that contains a give coordinate.

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::newDatabase ( const string database,
const string user,
const string password,
const string host,
const int &  port = -1,
bool  terralibModel = true,
const std::string characterSet = "" 
) [virtual]

Creates a new database based on "template1" and open a connection to the new one.

Implements TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::realConnect ( const string host,
const string user,
const string password,
const string database,
int  port = -1 
) [protected]

Opens a conection to a database server.

bool TePostgreSQL::rollbackTransaction ( ) [virtual]

Rollbacks a transaction.

Reimplemented from TeDatabase.

bool TePostgreSQL::setClientEncoding ( const std::string characterSet) [virtual]

Sets the client encoding.

Reimplemented from TeDatabase.

void TePostgreSQL::setConnection ( TeConnection c) [virtual]

Sets a connection that will be used by database.

Reimplemented from TeDatabase.

bool TePostgreSQL::showDatabases ( const string host,
const string user,
const string password,
vector< string > &  dbNames,
int  port = -1 
) [virtual]

Show the server databases (only for MySQL, Oracle and PostgreSQL)

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::tableExist ( const string table) [virtual]

Verifies if a table exist.

Implements TeDatabase.

string TePostgreSQL::toUpper ( const string value) [virtual]

Returns the SQL function for upper case.

Implements TeDatabase.

bool TePostgreSQL::updateCell ( const string table,
TeCell c 
) [virtual]

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::updateLine ( const string table,
TeLine2D l 
) [virtual]

Updates a line.

Implements TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::updateNode ( const string table,
TeNode node 
) [virtual]

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::updatePoint ( const string table,
TePoint p 
) [virtual]

Reimplemented from TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::updatePolygon ( const string table,
TePolygon p 
) [virtual]

Updates a polygon.

Implements TeDatabase.

Reimplemented in TePostGIS.

bool TePostgreSQL::updateTable ( TeTable table) [virtual]

Updates a table and its contents in the database.

Reimplemented from TeDatabase.


Friends And Related Function Documentation

friend class TePostgreSQLPortal [friend]

Member Data Documentation

Choose GIST OPERATOR beteween PostgreSQL 8.0 and 8.1.

Connection to a PostgreSQL server.

Keeps the number of opened transactions.

Reimplemented from TeDatabase.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines