OGR
|
Public Member Functions | |
virtual const char * | GetName () |
Return the layer name. More... | |
virtual OGRFeatureDefn * | GetLayerDefn () |
Fetch the schema information for this layer. More... | |
virtual OGRErr | CreateField (OGRFieldDefn *poField, int bApproxOK=TRUE) |
Create a new field on a layer. More... | |
virtual OGRErr | DeleteField (int iField) |
Delete an existing field on a layer. More... | |
virtual OGRErr | ReorderFields (int *panMap) |
Reorder all the fields of a layer. More... | |
virtual OGRErr | AlterFieldDefn (int iField, OGRFieldDefn *poNewFieldDefn, int nFlags) |
Alter the definition of an existing field on a layer. More... | |
virtual OGRErr | CreateGeomField (OGRGeomFieldDefn *poField, int bApproxOK=TRUE) |
Create a new geometry field on a layer. More... | |
virtual OGRFeature * | GetNextFeature () |
Fetch the next available feature from this layer. More... | |
virtual OGRFeature * | GetFeature (GIntBig nFID) |
Fetch a feature by its identifier. More... | |
virtual OGRErr | ISetFeature (OGRFeature *poFeature) |
Rewrite an existing feature. More... | |
virtual OGRErr | ICreateFeature (OGRFeature *poFeature) |
Create and write a new feature within a layer. More... | |
![]() | |
virtual OGRGeometry * | GetSpatialFilter () |
This method returns the current spatial filter for this layer. More... | |
virtual void | SetSpatialFilter (OGRGeometry *) |
Set a new spatial filter. More... | |
virtual void | SetSpatialFilterRect (double dfMinX, double dfMinY, double dfMaxX, double dfMaxY) |
Set a new rectangular spatial filter. More... | |
virtual void | SetSpatialFilter (int iGeomField, OGRGeometry *) |
Set a new spatial filter. More... | |
virtual void | SetSpatialFilterRect (int iGeomField, double dfMinX, double dfMinY, double dfMaxX, double dfMaxY) |
Set a new rectangular spatial filter. More... | |
virtual OGRErr | SetAttributeFilter (const char *) |
Set a new attribute query. More... | |
virtual void | ResetReading () |
Reset feature reading to start on the first feature. More... | |
virtual OGRErr | SetNextByIndex (GIntBig nIndex) |
Move read cursor to the nIndex'th feature in the current resultset. More... | |
virtual OGRErr | DeleteFeature (GIntBig nFID) |
Delete feature from layer. More... | |
virtual OGRwkbGeometryType | GetGeomType () |
Return the layer geometry type. More... | |
virtual OGRSpatialReference * | GetSpatialRef () |
Fetch the spatial reference system for this layer. More... | |
virtual GIntBig | GetFeatureCount (int bForce=TRUE) |
Fetch the feature count in this layer. More... | |
virtual OGRErr | GetExtent (int iGeomField, OGREnvelope *psExtent, int bForce=TRUE) |
Fetch the extent of this layer, on the specified geometry field. More... | |
virtual OGRErr | GetExtent (OGREnvelope *psExtent, int bForce=TRUE) |
Fetch the extent of this layer. More... | |
virtual int | TestCapability (const char *) |
Test if this layer supported the named capability. More... | |
virtual OGRErr | SyncToDisk () |
Flush pending changes to disk. More... | |
virtual OGRStyleTable * | GetStyleTable () |
Returns layer style table. More... | |
virtual void | SetStyleTableDirectly (OGRStyleTable *poStyleTable) |
Set layer style table. More... | |
virtual void | SetStyleTable (OGRStyleTable *poStyleTable) |
Set layer style table. More... | |
virtual const char * | GetFIDColumn () |
This method returns the name of the underlying database column being used as the FID column, or "" if not supported. More... | |
virtual const char * | GetGeometryColumn () |
This method returns the name of the underlying database column being used as the geometry column, or "" if not supported. More... | |
virtual OGRErr | SetIgnoredFields (const char **papszFields) |
Set which fields can be omitted when retrieving features from the layer. More... | |
![]() | |
OGRErr | SetFeature (OGRFeature *poFeature) CPL_WARN_UNUSED_RESULT |
Rewrite an existing feature. More... | |
OGRErr | CreateFeature (OGRFeature *poFeature) CPL_WARN_UNUSED_RESULT |
Create and write a new feature within a layer. More... | |
virtual int | FindFieldIndex (const char *pszFieldName, int bExactMatch) |
Find the index of field in the layer. More... | |
OGRErr | Intersection (OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=NULL, GDALProgressFunc pfnProgress=NULL, void *pProgressArg=NULL) |
Intersection of two layers. More... | |
OGRErr | Union (OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=NULL, GDALProgressFunc pfnProgress=NULL, void *pProgressArg=NULL) |
Union of two layers. More... | |
OGRErr | SymDifference (OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg) |
Symmetrical difference of two layers. More... | |
OGRErr | Identity (OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=NULL, GDALProgressFunc pfnProgress=NULL, void *pProgressArg=NULL) |
Identify the features of this layer with the ones from the identity layer. More... | |
OGRErr | Update (OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=NULL, GDALProgressFunc pfnProgress=NULL, void *pProgressArg=NULL) |
Update this layer with features from the update layer. More... | |
OGRErr | Clip (OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=NULL, GDALProgressFunc pfnProgress=NULL, void *pProgressArg=NULL) |
Clip off areas that are not covered by the method layer. More... | |
OGRErr | Erase (OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=NULL, GDALProgressFunc pfnProgress=NULL, void *pProgressArg=NULL) |
Remove areas that are covered by the method layer. More... | |
int | Reference () |
Increment layer reference count. More... | |
int | Dereference () |
Decrement layer reference count. More... | |
int | GetRefCount () const |
Fetch reference count. More... | |
OGRErr | ReorderField (int iOldFieldPos, int iNewFieldPos) |
Reorder an existing field on a layer. More... | |
Friends | |
class | OGRDataSourceWithTransaction |
Additional Inherited Members |
|
virtual |
Alter the definition of an existing field on a layer.
You must use this to alter the definition of an existing field of a real layer. Internally the OGRFeatureDefn for the layer will be updated to reflect the altered field. Applications should never modify the OGRFeatureDefn used by a layer directly.
This method should not be called while there are feature objects in existence that were obtained or created with the previous layer definition.
Not all drivers support this method. You can query a layer to check if it supports it with the OLCAlterFieldDefn capability. Some drivers may only support this method while there are still no features in the layer. When it is supported, the existing features of the backing file/database should be updated accordingly. Some drivers might also not support all update flags.
This function is the same as the C function OGR_L_AlterFieldDefn().
iField | index of the field whose definition must be altered. |
poNewFieldDefn | new field definition |
nFlags | combination of ALTER_NAME_FLAG, ALTER_TYPE_FLAG, ALTER_WIDTH_PRECISION_FLAG, ALTER_NULLABLE_FLAG and ALTER_DEFAULT_FLAG to indicate which of the name and/or type and/or width and precision fields and/or nullability from the new field definition must be taken into account. |
Reimplemented from OGRLayerDecorator.
|
virtual |
Create a new field on a layer.
You must use this to create new fields on a real layer. Internally the OGRFeatureDefn for the layer will be updated to reflect the new field. Applications should never modify the OGRFeatureDefn used by a layer directly.
This method should not be called while there are feature objects in existence that were obtained or created with the previous layer definition.
Not all drivers support this method. You can query a layer to check if it supports it with the OLCCreateField capability. Some drivers may only support this method while there are still no features in the layer. When it is supported, the existing features of the backing file/database should be updated accordingly.
Drivers may or may not support not-null constraints. If they support creating fields with not-null constraints, this is generally before creating any feature to the layer.
This function is the same as the C function OGR_L_CreateField().
poField | field definition to write to disk. |
bApproxOK | If TRUE, the field may be created in a slightly different form depending on the limitations of the format driver. |
Reimplemented from OGRLayerDecorator.
Referenced by GetName().
|
virtual |
Create a new geometry field on a layer.
You must use this to create new geometry fields on a real layer. Internally the OGRFeatureDefn for the layer will be updated to reflect the new field. Applications should never modify the OGRFeatureDefn used by a layer directly.
This method should not be called while there are feature objects in existence that were obtained or created with the previous layer definition.
Not all drivers support this method. You can query a layer to check if it supports it with the OLCCreateGeomField capability. Some drivers may only support this method while there are still no features in the layer. When it is supported, the existing features of the backing file/database should be updated accordingly.
Drivers may or may not support not-null constraints. If they support creating fields with not-null constraints, this is generally before creating any feature to the layer.
This function is the same as the C function OGR_L_CreateGeomField().
poField | geometry field definition to write to disk. |
bApproxOK | If TRUE, the field may be created in a slightly different form depending on the limitations of the format driver. |
Reimplemented from OGRLayerDecorator.
|
virtual |
Delete an existing field on a layer.
You must use this to delete existing fields on a real layer. Internally the OGRFeatureDefn for the layer will be updated to reflect the deleted field. Applications should never modify the OGRFeatureDefn used by a layer directly.
This method should not be called while there are feature objects in existence that were obtained or created with the previous layer definition.
Not all drivers support this method. You can query a layer to check if it supports it with the OLCDeleteField capability. Some drivers may only support this method while there are still no features in the layer. When it is supported, the existing features of the backing file/database should be updated accordingly.
This function is the same as the C function OGR_L_DeleteField().
iField | index of the field to delete. |
Reimplemented from OGRLayerDecorator.
|
virtual |
Fetch a feature by its identifier.
This function will attempt to read the identified feature. The nFID value cannot be OGRNullFID. Success or failure of this operation is unaffected by the spatial or attribute filters (and specialized implementations in drivers should make sure that they do not take into account spatial or attribute filters).
If this method returns a non-NULL feature, it is guaranteed that its feature id (OGRFeature::GetFID()) will be the same as nFID.
Use OGRLayer::TestCapability(OLCRandomRead) to establish if this layer supports efficient random access reading via GetFeature(); however, the call should always work if the feature exists as a fallback implementation just scans all the features in the layer looking for the desired feature.
Sequential reads (with GetNextFeature()) are generally considered interrupted by a GetFeature() call.
The returned feature should be free with OGRFeature::DestroyFeature().
This method is the same as the C function OGR_L_GetFeature().
nFID | the feature id of the feature to read. |
Reimplemented from OGRLayerDecorator.
|
virtual |
Fetch the schema information for this layer.
The returned OGRFeatureDefn is owned by the OGRLayer, and should not be modified or freed by the application. It encapsulates the attribute schema of the features of the layer.
This method is the same as the C function OGR_L_GetLayerDefn().
Reimplemented from OGRLayerDecorator.
Referenced by GetName().
|
inlinevirtual |
Return the layer name.
This returns the same content as GetLayerDefn()->OGRFeatureDefn::GetName(), but for a few drivers, calling GetName() directly can avoid lengthy layer definition initialization.
This method is the same as the C function OGR_L_GetName().
If this method is derived in a driver, it must be done such that it returns the same content as GetLayerDefn()->OGRFeatureDefn::GetName().
Reimplemented from OGRLayerDecorator.
References CreateField(), and GetLayerDefn().
|
virtual |
Fetch the next available feature from this layer.
The returned feature becomes the responsibility of the caller to delete with OGRFeature::DestroyFeature(). It is critical that all features associated with an OGRLayer (more specifically an OGRFeatureDefn) be deleted before that layer/datasource is deleted.
Only features matching the current spatial filter (set with SetSpatialFilter()) will be returned.
This method implements sequential access to the features of a layer. The ResetReading() method can be used to start at the beginning again.
Features returned by GetNextFeature() may or may not be affected by concurrent modifications depending on drivers. A guaranteed way of seeing modifications in effect is to call ResetReading() on layers where GetNextFeature() has been called, before reading again. Structural changes in layers (field addition, deletion, ...) when a read is in progress may or may not be possible depending on drivers. If a transaction is committed/aborted, the current sequential reading may or may not be valid after that operation and a call to ResetReading() might be needed.
This method is the same as the C function OGR_L_GetNextFeature().
Reimplemented from OGRLayerDecorator.
|
virtual |
Create and write a new feature within a layer.
This method is implemented by drivers and not called directly. User code should use CreateFeature() instead.
The passed feature is written to the layer as a new feature, rather than overwriting an existing one. If the feature has a feature id other than OGRNullFID, then the native implementation may use that as the feature id of the new feature, but not necessarily. Upon successful return the passed feature will have been updated with the new feature id.
poFeature | the feature to write to disk. |
Reimplemented from OGRLayerDecorator.
|
virtual |
Rewrite an existing feature.
This method is implemented by drivers and not called directly. User code should use SetFeature() instead.
This method will write a feature to the layer, based on the feature id within the OGRFeature.
poFeature | the feature to write. |
Reimplemented from OGRLayerDecorator.
|
virtual |
Reorder all the fields of a layer.
You must use this to reorder existing fields on a real layer. Internally the OGRFeatureDefn for the layer will be updated to reflect the reordering of the fields. Applications should never modify the OGRFeatureDefn used by a layer directly.
This method should not be called while there are feature objects in existence that were obtained or created with the previous layer definition.
panMap is such that,for each field definition at position i after reordering, its position before reordering was panMap[i].
For example, let suppose the fields were "0","1","2","3","4" initially. ReorderFields([0,2,3,1,4]) will reorder them as "0","2","3","1","4".
Not all drivers support this method. You can query a layer to check if it supports it with the OLCReorderFields capability. Some drivers may only support this method while there are still no features in the layer. When it is supported, the existing features of the backing file/database should be updated accordingly.
This function is the same as the C function OGR_L_ReorderFields().
panMap | an array of GetLayerDefn()->OGRFeatureDefn::GetFieldCount() elements which is a permutation of [0, GetLayerDefn()->OGRFeatureDefn::GetFieldCount()-1]. |
Reimplemented from OGRLayerDecorator.