- Main Page
- Classes
- Files
- Directories
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# SFCTable Class Reference

`#include <sfctable.h>`

List of all members.

## Public Member Functions
void | SetTableName (const char *)
const char * | GetTableName ()
int | ReadSchemaInfo (CDataSource *, CSession *=NULL)
void | ReleaseIUnknowns ()
int | GetSpatialRefID ()
int | HasGeometry ()
int | GetGeometryType ()
BYTE * | GetWKBGeometry (int *pnSize)
OGRGeometry * | GetOGRGeometry ()

## Detailed Description

Abstract representation of a rowset (table) with spatial features.

This class is intended to simplify access to spatial rowsets, and to centralize all the rules for selecting geometry columns, getting the spatial reference system of a rowset, and special feature access short cuts with selected providers. It is based on the ATL CTable class with a dynamic accessor.

## Member Function Documentation

void SFCTable::SetTableName | ( | const char * | pszTableName | ) |

Set the table name.

This is primarily needed if the SFCTable is created by means other than SFCDataSource::CreateSFCTable(). The table name is needed to collect information from the ogis columns schema rowset.

Parameters:

  | pszTableName | the name of the table from which this SFCTable is derived.

const char * SFCTable::GetTableName | ( |  | ) |

Get the name of this rowsets table.

Returns:
  a pointer to an internal table name. May be NULL if not known. Should not be modified or freed by the application.

int SFCTable::ReadSchemaInfo | ( | CDataSource * | poDS,
|  | CSession * | poSession = `NULL` |
| ) |  |  |

Read required schema rowset information.

This method is normally called by SFCDataSource::CreateSFCTable(), but if the SFCTable is created by another means, it is necessary so that the SFCTable can get information from the schema rowsets about the geometry column, SRS and so forth.

If an SFCTable is instantiated wihtout this method ever being called a number of the OpenGIS related aspects of the table will not be operational.

Parameters:

  | poDS | a CDataSource (or SFCDataSource) on which this SFCTable was created.
  | poSession | optional Session to be used internally to access various schema rowsets.

Returns:
  TRUE if reading of schema information succeeds.

void SFCTable::ReleaseIUnknowns | ( |  | ) |

Release any IUnknowns in current record.

It is very important that this be called once, and only once for each record read on an SFCTable if there may be IUnknowns (generally ISequentialStreams for the geometry column).

Unfortunately, the CRowset::ReleaseRows() doesn't take care of this itself.

int SFCTable::GetSpatialRefID | ( |  | ) |

Fetch the spatial reference system id of this table.

This method returns the id of the spatial reference system for this table. All geometries in this table should have this spatial reference system. The SFCDataSource::GetWKTFromSRSId() method can be used to transform this id into a useful form.

Returns:
  spatial reference system id. The value will be -1 if not known.

int SFCTable::HasGeometry | ( |  | ) |

Does this table have geometry?

Returns:
  this method returns TRUE if this table has an identifiable geometry column.

int SFCTable::GetGeometryType | ( |  | ) |

Fetch the geometry type of this table.

This method returns the well known binary type of the geometry in this table. This integer can be cast to the type OGRwkbGeometryType in order to use symbolic constants. The intent is that all objects in this table would be of the returned class, or a derived class. It will generally be zero (wkbUnknown) if nothing is known about the geometry types in the table.

Zero (wkbUnknown) will be returned if there is no column info schema rowset (from which this value is normally extracted).

Returns:
  well known geometry type.

BYTE * SFCTable::GetWKBGeometry | ( | int * | pnSize | ) |

Fetch geometry binary column binary data.

Note that the returned pointer is to an internal buffer, and will be invalidated by the next record read operation. The data should not be freed or modified.

Parameters:

  | pnSize | pointer to an integer into which the number of bytes returned may be put. This may be NULL.

Returns:
  a pointer to the binary data or NULL if the fetch fails.

OGRGeometry * SFCTable::GetOGRGeometry | ( |  | ) |

Fetch the OGRGeometry for this record.

The reading of the BLOB column, and translation into an OGRGeometry subclass is handled automatically. The returned object becomes the responsibility of the caller and should be destroyed with delete.

Returns:
  pointer to an OGRGeometry, or NULL if the read fails.

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

- sfctable.h
- sfctable.cpp

Generated for GDAL by 1.5.1.