| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Friends
TeSqlServerSpatial Class Reference

A driver class to an SQL Server Spatial database accessible using ADO library. More...

`#include <TeAdoSqlServerSpatial.h>`

Inheritance diagram for TeSqlServerSpatial:

List of all members.

## Public Member Functions

| TeSqlServerSpatial ()
| Empty Constructor.
| ~TeSqlServerSpatial ()
| Destructor.
virtual bool | connect (const string &host, const string &user, const string &password, const string &database, int port=-1)
| Opens a connection to a database server passing all parameters needed.
bool | columnExist (const string &table, const string &column, TeAttribute &attr)
| columnExist
bool | createTable (const string &table, TeAttributeList &attr)
| createTable
bool | alterTable (const string &table, TeAttributeRep &rep, const string &oldColName="")
| alterTable
bool | generateLabelPositions (TeTheme *theme, const std::string &objectId="")
| generateLabelPositions
bool | insertPolygonSet (const string &table, TePolygonSet &ps)
| insertPolygonSet
bool | insertPolygon (const string &table, TePolygon &p)
| insertPolygon
bool | insertLineSet (const string &table, TeLineSet &ls)
| insertLineSet
bool | insertLine (const string &table, TeLine2D &l)
| insertLine
bool | insertPointSet (const string &table, TePointSet &ps)
| insertPointSet
bool | insertPoint (const string &table, TePoint &p)
| insertPoint
bool | insertTextSet (const string &table, TeTextSet &ts)
| insertTextSet
bool | insertText (const string &table, TeText &t)
| insertText
virtual bool | createTextGeometry (const string &table)
| createTextGeometry
virtual string | getSQLBoxWhere (const TeBox &box, const TeGeomRep rep, const std::string &)
| getSQLBoxWhere
virtual std::string | getSQLOrderBy (const TeGeomRep &rep) const
| getSQLOrderBy
TeDatabasePortal * | getPortal ()
| getPortal
bool | createSpatialIndex (const string &table, const string &columns, TeSpatialIndexType type, short level, short tile)
| createSpatialIndex
virtual bool | getMBRSelectedObjects (string geomTable, string colGeom, string fromClause, string whereClause, string afterWhereClause, TeGeomRep repType, TeBox &bout, const double &tol)
| Return the box of a specific geometry (object_id)
virtual bool | locatePoint (const string &table, TeCoord2D &pt, TePoint &point, const double &tol)
virtual bool | locatePolygon (const string &table, TeCoord2D &pt, TePolygon &polygon, const double &tol)
| 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 | locateLine (const string &table, TeCoord2D &pt, TeLine2D &line, const double &tol=0.0)
virtual bool | locateLineSet (const string &table, TeCoord2D &pt, TeLineSet &ls, const double &tol=0.0)

## Protected Member Functions

virtual std::string | STGeomFromWkb (const TePolygon &polygon)
virtual std::string | STGeomFromText (const TePolygon &polygon)
| STGeomFromText.
virtual std::string | STGeomFromText (const TeLine2D &line)
| STGeomFromText.
virtual std::string | STGeomFromText (const TePoint &point)
| STGeomFromText.
virtual bool | PutBinaryIntoVariant (VARIANT &ovData, BYTE *pBuf, unsigned long cBufLen)
| PutBinaryIntoVariant.

## Friends

class | TeSqlServerSpatialPortal

## Detailed Description

A driver class to an SQL Server Spatial database accessible using ADO library.

## Constructor & Destructor Documentation

TeSqlServerSpatial::TeSqlServerSpatial | ( |  | ) |

Empty Constructor.

TeSqlServerSpatial::~TeSqlServerSpatial | ( |  | ) |

Destructor.

## Member Function Documentation

bool TeSqlServerSpatial::alterTable | ( | const string & | table,
|  | TeAttributeRep & | rep,
|  | const string & | oldColName = `""`
| ) |  | `[virtual]`

alterTable

Method to alter table structure

Parameters:

  table | table name
  rep | Terralib Attribute representation
  oldColName | old column name

Returns:
  returns true whether sucess

Reimplemented from TeSqlServer.

bool TeSqlServerSpatial::columnExist | ( | const string & | table,
|  | const string & | column,
|  | TeAttribute & | attr
| ) |  | `[virtual]`

columnExist

Method to check if column exists

Parameters:

  table | table name
  column | column name
  attr | terralib attribute

Returns:
  returns true whether column exist

Reimplemented from TeSqlServer.

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

Opens a connection to a database server passing all parameters needed.

Reimplemented from TeSqlServer.

bool TeSqlServerSpatial::createSpatialIndex | ( | const string & | table,
|  | const string & | columns,
|  | TeSpatialIndexType | type,
|  | short | level,
|  | short | tile
| ) |  | `[virtual]`

createSpatialIndex

Create a SQL Server Spatial Index

Reimplemented from TeDatabase.

bool TeSqlServerSpatial::createTable | ( | const string & | table,
|  | TeAttributeList & | attr
| ) |  | `[virtual]`

createTable

Method to create a table

Parameters:

  table | table name
  attr | terralib attribute

Returns:
  returns true whether create table with sucess

Reimplemented from TeSqlServer.

bool TeSqlServerSpatial::createTextGeometry | ( | const string & | table | ) | `[virtual]`

createTextGeometry

Method to create a terralib text geometry table

Parameters:

  table | table name

Returns:
  returns true whether sucess

bool TeSqlServerSpatial::generateLabelPositions | ( | TeTheme * | theme,
|  | const std::string & | objectId = `""`
| ) |  | `[virtual]`

generateLabelPositions

Method to generate labels positions to terralib theme when created

Parameters:

  theme | terralib theme
  objectid | object identify

Returns:
  returns true whether sucess

Reimplemented from TeSqlServer.

bool TeSqlServerSpatial::getMBRSelectedObjects | ( | string | geomTable,
|  | string | colGeom,
|  | string | fromClause,
|  | string | whereClause,
|  | string | afterWhereClause,
|  | TeGeomRep | repType,
|  | TeBox & | bout,
|  | const double & | tol
| ) |  | `[virtual]`

Return the box of a specific geometry (object_id)

Reimplemented from TeDatabase.

TeDatabasePortal * TeSqlServerSpatial::getPortal | ( |  | ) | `[virtual]`

getPortal

Method to return the terralib database portal

Returns:
  returns the terralib database portal

Reimplemented from TeSqlServer.

string TeSqlServerSpatial::getSQLBoxWhere | ( | const TeBox & | box,
|  | const TeGeomRep | rep,
|  | const std::string & |
| ) |  | `[virtual]`

getSQLBoxWhere

Method to return the espatial sql box where

Parameters:

  box | terralib bounding box
  rep | representation

Returns:
  returns the spatial sql box where string

Reimplemented from TeDatabase.

std::string TeSqlServerSpatial::getSQLOrderBy | ( | const TeGeomRep & | rep | ) | const`[virtual]`

getSQLOrderBy

Method to return the SQL Order By

Parameters:

  rep | terralib representation

Returns:
  returns the sql string

Reimplemented from TeDatabase.

bool TeSqlServerSpatial::insertLine | ( | const string & | table,
|  | TeLine2D & | l
| ) |  | `[virtual]`

insertLine

Method to insert the terralib line to spatial database

Parameters:

  table | table name
  l | terralib line

Returns:
  returns true whether sucess

Reimplemented from TeSqlServer.

bool TeSqlServerSpatial::insertLineSet | ( | const string & | table,
|  | TeLineSet & | ls
| ) |  | `[virtual]`

insertLineSet

Method to insert the terralib line list to spatial database

Parameters:

  table | table name
  ls | terralib line list

Returns:
  returns true whether sucess

Reimplemented from TeSqlServer.

bool TeSqlServerSpatial::insertPoint | ( | const string & | table,
|  | TePoint & | p
| ) |  | `[virtual]`

insertPoint

Method to insert the terralib point to database

Parameters:

  table | table name
  p | terralib point

Returns:
  returns true whether sucess

Reimplemented from TeSqlServer.

bool TeSqlServerSpatial::insertPointSet | ( | const string & | table,
|  | TePointSet & | ps
| ) |  | `[virtual]`

insertPointSet

Method to insert the terralib point list

Parameters:

  table | table name
  ps | terralib point list

Returns:
  returns true whether sucess

Reimplemented from TeSqlServer.

bool TeSqlServerSpatial::insertPolygon | ( | const string & | table,
|  | TePolygon & | p
| ) |  | `[virtual]`

insertPolygon

Method to insert the polygon to spatial database

Parameters:

  table | table name
  p | terralib polygon

Returns:
  returns true whether sucess

Reimplemented from TeSqlServer.

bool TeSqlServerSpatial::insertPolygonSet | ( | const string & | table,
|  | TePolygonSet & | ps
| ) |  | `[virtual]`

insertPolygonSet

Method to insert the polygon list to spatial database

Parameters:

  table | table name
  ps | terralib polygon list

Returns:
  returns true whether sucess

Reimplemented from TeSqlServer.

bool TeSqlServerSpatial::insertText | ( | const string & | table,
|  | TeText & | t
| ) |  | `[virtual]`

insertText

Method to insert terralib text to database

Parameters:

  table | table name
  t | terralib text

Returns:
  returns true whether sucess

Reimplemented from TeSqlServer.

bool TeSqlServerSpatial::insertTextSet | ( | const string & | table,
|  | TeTextSet & | ts
| ) |  | `[virtual]`

insertTextSet

Method to insert the terralib text list to database

Parameters:

  table | table name
  ts | terralib text list

Returns:
  returns true whether sucess

Reimplemented from TeSqlServer.

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

Reimplemented from TeDatabase.

bool TeSqlServerSpatial::locateLineSet | ( | const string & | table,
|  | TeCoord2D & | pt,
|  | TeLineSet & | ls,
|  | const double & | tol = `0.0`
| ) |  | `[virtual]`

Reimplemented from TeDatabase.

bool TeSqlServerSpatial::locatePoint | ( | const string & | table,
|  | TeCoord2D & | pt,
|  | TePoint & | point,
|  | const double & | tol
| ) |  | `[virtual]`

Reimplemented from TeDatabase.

bool TeSqlServerSpatial::locatePolygon | ( | const string & | table,
|  | TeCoord2D & | pt,
|  | TePolygon & | polygon,
|  | const double & | tol
| ) |  | `[virtual]`

Returns the first polygon that contais a given coordinate.

Reimplemented from TeDatabase.

bool TeSqlServerSpatial::locatePolygonSet | ( | const string & | table,
|  | TeCoord2D & | pt,
|  | double | tol,
|  | TePolygonSet & | polygons
| ) |  | `[virtual]`

Returns the polygons that contains a give coordinate.

Reimplemented from TeDatabase.

bool TeSqlServerSpatial::PutBinaryIntoVariant | ( | VARIANT & | ovData,
|  | BYTE * | pBuf,
|  | unsigned long | cBufLen
| ) |  | `[protected, virtual]`

PutBinaryIntoVariant.

Method to transform the binary data to variant

Parameters:

  ovData | variant
  pBuf | binary data
  cBufLen | buf length

std::string TeSqlServerSpatial::STGeomFromText | ( | const TeLine2D & | line | ) | `[protected, virtual]`

STGeomFromText.

Method to convert a terralib line to wbt

Parameters:

  line | terralib line

Returns:
  returns the sql in wbt format

std::string TeSqlServerSpatial::STGeomFromText | ( | const TePolygon & | polygon | ) | `[protected, virtual]`

STGeomFromText.

Method to convert a terralib polygon to wbt

Parameters:

  polygon | terralib polygon

Returns:
  returns the sql in wbt format

std::string TeSqlServerSpatial::STGeomFromText | ( | const TePoint & | point | ) | `[protected, virtual]`

STGeomFromText.

Method to convert a terralib point to wbt

Parameters:

  point | terralib point

Returns:
  returns the sql in wbt format

std::string TeSqlServerSpatial::STGeomFromWkb | ( | const TePolygon & | polygon | ) | `[protected, virtual]`

## Friends And Related Function Documentation

friend class TeSqlServerSpatialPortal`[friend]`

The documentation for this class was generated from the following files:

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/ado/TeAdoSqlServerSpatial.h
- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/ado/TeAdoSqlServerSpatial.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines