#include <ogrsf_frmts.h>
Public Member Functions | |
virtual const char * | GetName ()=0 |
virtual int | GetLayerCount ()=0 |
virtual OGRLayer * | GetLayer (int)=0 |
virtual OGRLayer * | GetLayerByName (const char *) |
virtual OGRErr | DeleteLayer (int) |
virtual int | TestCapability (const char *)=0 |
virtual OGRLayer * | CreateLayer (const char *pszName, OGRSpatialReference *poSpatialRef=NULL, OGRwkbGeometryType eGType=wkbUnknown, char **papszOptions=NULL) |
virtual OGRLayer * | ExecuteSQL (const char *pszStatement, OGRGeometry *poSpatialFilter, const char *pszDialect) |
virtual void | ReleaseResultSet (OGRLayer *poResultsSet) |
virtual OGRErr | SyncToDisk () |
int | Reference () |
int | Dereference () |
int | GetRefCount () const |
int | GetSummaryRefCount () const |
OGRErr | Release () |
When an OGRDataSource is destroyed, all it's associated OGRLayers objects are also destroyed.
|
This method attempts to create a new layer on the data source with the indicated name, coordinate system, geometry type. The papszOptions argument can be used to control driver specific creation options. These options are normally documented in the format specific documentation.
#include "ogrsf_frmts.h" #include "cpl_string.h" ... OGRLayer *poLayer; char *papszOptions; if( !poDS->TestCapability( ODsCreateLayer ) ) { ... } papszOptions = CSLSetNameValue( papszOptions, "DIM", "2" ); poLayer = poDS->CreateLayer( "NewLayer", NULL, wkbUnknown, papszOptions ); CSLDestroy( papszOptions ); if( poLayer == NULL ) { ... } |
|
Delete the indicated layer from the datasource. If this method is supported the ODsCDeleteLayer capability will test TRUE on the OGRDataSource. This method is the same as the C function OGR_DS_DeleteLayer().
|
|
Decrement datasource reference count. This method is the same as the C function OGR_DS_Dereference().
|
|
Execute an SQL statement against the data store. The result of an SQL query is either NULL for statements that are in error, or that have no results set, or an OGRLayer pointer representing a results set from the query. Note that this OGRLayer is in addition to the layers in the data store and must be destroyed with OGRDataSource::ReleaseResultsSet() before the data source is closed (destroyed). This method is the same as the C function OGR_DS_ExecuteSQL(). For more information on the SQL dialect supported internally by OGR review the OGR SQL document. Some drivers (ie. Oracle and PostGIS) pass the SQL directly through to the underlying RDBMS.
|
|
Fetch a layer by index. The returned layer remains owned by the OGRDataSource and should not be deleted by the application. This method is the same as the C function OGR_DS_GetLayer().
|
|
Fetch a layer by name. The returned layer remains owned by the OGRDataSource and should not be deleted by the application. This method is the same as the C function OGR_DS_GetLayerByName().
|
|
Get the number of layers in this data source. This method is the same as the C function OGR_DS_GetLayerCount().
|
|
Returns the name of the data source. This string should be sufficient to open the data source if passed to the same OGRSFDriver that this data source was opened with, but it need not be exactly the same string that was used to open the data source. Normally this a filename. This method is the same as the C function OGR_DS_GetName().
|
|
Fetch reference count. This method is the same as the C function OGR_DS_GetRefCount().
|
|
Fetch reference count of datasource and all owned layers. This method is the same as the C function OGR_DS_GetSummaryRefCount().
|
|
Increment datasource reference count. This method is the same as the C function OGR_DS_Reference().
|
|
Drop a reference to this datasource, and if the reference count drops to zero close (destroy) the datasource. Internally this actually calls the OGRSFDriverRegistrary::ReleaseDataSource() method. This method is essentially a convenient alias. This method is the same as the C function OGRReleaseDataSource().
|
|
Release results of ExecuteSQL(). This method should only be used to deallocate OGRLayers resulting from an ExecuteSQL() call on the same OGRDataSource. Failure to deallocate a results set before destroying the OGRDataSource may cause errors. This method is the same as the C function OGR_L_ReleaseResultsSet().
|
|
Flush pending changes to disk. This call is intended to force the datasource to flush any pending writes to disk, and leave the disk file in a consistent state. It would not normally have any effect on read-only datasources. Some data sources do not implement this method, and will still return OGRERR_NONE. An error is only returned if an error occurs while attempting to flush to disk. The default implementation of this method just calls the SyncToDisk() method on each of the layers. Conceptionally, calling SyncToDisk() on a datasource should include any work that might be accomplished by calling SyncToDisk() on layers in that data source. This method is the same as the C function OGR_DS_SyncToDisk().
|
|
Test if capability is available. One of the following data source capability names can be passed into this method, and a TRUE or FALSE value will be returned indicating whether or not the capability is available for this object.
The define macro forms of the capability names should be used in preference to the strings themselves to avoid mispelling. This method is the same as the C function OGR_DS_TestCapability().
|