#include "ogr_core.h"
Go to the source code of this file.
Functions | |
OGRErr | OGR_G_CreateFromWkb (unsigned char *, OGRSpatialReferenceH, OGRGeometryH *) |
OGRErr | OGR_G_CreateFromWkt (char **, OGRSpatialReferenceH, OGRGeometryH *) |
void | OGR_G_DestroyGeometry (OGRGeometryH) |
OGRGeometryH | OGR_G_CreateGeometry (OGRwkbGeometryType) |
int | OGR_G_GetDimension (OGRGeometryH) |
int | OGR_G_GetCoordinateDimension (OGRGeometryH) |
OGRGeometryH | OGR_G_Clone (OGRGeometryH) |
void | OGR_G_GetEnvelope (OGRGeometryH, OGREnvelope *) |
OGRErr | OGR_G_ImportFromWkb (OGRGeometryH, unsigned char *, int) |
OGRErr | OGR_G_ExportToWkb (OGRGeometryH, OGRwkbByteOrder, unsigned char *) |
int | OGR_G_WkbSize (OGRGeometryH hGeom) |
OGRErr | OGR_G_ImportFromWkt (OGRGeometryH, char **) |
OGRwkbGeometryType | OGR_G_GetGeometryType (OGRGeometryH) |
const char * | OGR_G_GetGeometryName (OGRGeometryH) |
void | OGR_G_DumpReadable (OGRGeometryH, FILE *, const char *) |
void | OGR_G_FlattenTo2D (OGRGeometryH) |
void | OGR_G_AssignSpatialReference (OGRGeometryH, OGRSpatialReferenceH) |
OGRSpatialReferenceH | OGR_G_GetSpatialReference (OGRGeometryH) |
OGRErr | OGR_G_Transform (OGRGeometryH, OGRCoordinateTransformationH) |
OGRErr | OGR_G_TransformTo (OGRGeometryH, OGRSpatialReferenceH) |
int | OGR_G_Intersects (OGRGeometryH, OGRGeometryH) |
int | OGR_G_Equals (OGRGeometryH, OGRGeometryH) |
double | OGR_G_GetArea (OGRGeometryH) |
void | OGR_G_Empty (OGRGeometryH) |
int | OGR_G_GetPointCount (OGRGeometryH) |
double | OGR_G_GetX (OGRGeometryH, int) |
double | OGR_G_GetY (OGRGeometryH, int) |
double | OGR_G_GetZ (OGRGeometryH, int) |
void | OGR_G_GetPoint (OGRGeometryH, int iPoint, double *, double *, double *) |
void | OGR_G_SetPoint (OGRGeometryH, int iPoint, double, double, double) |
void | OGR_G_AddPoint (OGRGeometryH, double, double, double) |
int | OGR_G_GetGeometryCount (OGRGeometryH) |
OGRGeometryH | OGR_G_GetGeometryRef (OGRGeometryH, int) |
OGRErr | OGR_G_AddGeometry (OGRGeometryH, OGRGeometryH) |
OGRErr | OGR_G_AddGeometryDirectly (OGRGeometryH, OGRGeometryH) |
OGRErr | OGR_G_RemoveGeometry (OGRGeometryH, int, int) |
OGRGeometryH | OGRBuildPolygonFromEdges (OGRGeometryH hLinesAsCollection, int bBestEffort, int bAutoClose, double dfTolerance, OGRErr *peErr) |
OGRFieldDefnH | OGR_Fld_Create (const char *, OGRFieldType) |
void | OGR_Fld_Destroy (OGRFieldDefnH) |
void | OGR_Fld_SetName (OGRFieldDefnH, const char *) |
const char * | OGR_Fld_GetNameRef (OGRFieldDefnH) |
OGRFieldType | OGR_Fld_GetType (OGRFieldDefnH) |
void | OGR_Fld_SetType (OGRFieldDefnH, OGRFieldType) |
OGRJustification | OGR_Fld_GetJustify (OGRFieldDefnH) |
void | OGR_Fld_SetJustify (OGRFieldDefnH, OGRJustification) |
int | OGR_Fld_GetWidth (OGRFieldDefnH) |
void | OGR_Fld_SetWidth (OGRFieldDefnH, int) |
int | OGR_Fld_GetPrecision (OGRFieldDefnH) |
void | OGR_Fld_SetPrecision (OGRFieldDefnH, int) |
void | OGR_Fld_Set (OGRFieldDefnH, const char *, OGRFieldType, int, int, OGRJustification) |
const char * | OGR_GetFieldTypeName (OGRFieldType) |
OGRFeatureDefnH | OGR_FD_Create (const char *) |
void | OGR_FD_Destroy (OGRFeatureDefnH) |
const char * | OGR_FD_GetName (OGRFeatureDefnH) |
int | OGR_FD_GetFieldCount (OGRFeatureDefnH) |
OGRFieldDefnH | OGR_FD_GetFieldDefn (OGRFeatureDefnH, int) |
int | OGR_FD_GetFieldIndex (OGRFeatureDefnH, const char *) |
void | OGR_FD_AddFieldDefn (OGRFeatureDefnH, OGRFieldDefnH) |
OGRwkbGeometryType | OGR_FD_GetGeomType (OGRFeatureDefnH) |
void | OGR_FD_SetGeomType (OGRFeatureDefnH, OGRwkbGeometryType) |
int | OGR_FD_Reference (OGRFeatureDefnH) |
int | OGR_FD_Dereference (OGRFeatureDefnH) |
int | OGR_FD_GetReferenceCount (OGRFeatureDefnH) |
OGRFeatureH | OGR_F_Create (OGRFeatureDefnH) |
void | OGR_F_Destroy (OGRFeatureH) |
OGRFeatureDefnH | OGR_F_GetDefnRef (OGRFeatureH) |
OGRErr | OGR_F_SetGeometryDirectly (OGRFeatureH, OGRGeometryH) |
OGRErr | OGR_F_SetGeometry (OGRFeatureH, OGRGeometryH) |
OGRGeometryH | OGR_F_GetGeometryRef (OGRFeatureH) |
OGRFeatureH | OGR_F_Clone (OGRFeatureH) |
int | OGR_F_Equal (OGRFeatureH, OGRFeatureH) |
int | OGR_F_GetFieldCount (OGRFeatureH) |
OGRFieldDefnH | OGR_F_GetFieldDefnRef (OGRFeatureH, int) |
int | OGR_F_GetFieldIndex (OGRFeatureH, const char *) |
int | OGR_F_IsFieldSet (OGRFeatureH, int) |
void | OGR_F_UnsetField (OGRFeatureH, int) |
OGRField * | OGR_F_GetRawFieldRef (OGRFeatureH, int) |
int | OGR_F_GetFieldAsInteger (OGRFeatureH, int) |
double | OGR_F_GetFieldAsDouble (OGRFeatureH, int) |
const char * | OGR_F_GetFieldAsString (OGRFeatureH, int) |
const int * | OGR_F_GetFieldAsIntegerList (OGRFeatureH, int, int *) |
const double * | OGR_F_GetFieldAsDoubleList (OGRFeatureH, int, int *) |
char ** | OGR_F_GetFieldAsStringList (OGRFeatureH, int) |
void | OGR_F_SetFieldInteger (OGRFeatureH, int, int) |
void | OGR_F_SetFieldDouble (OGRFeatureH, int, double) |
void | OGR_F_SetFieldString (OGRFeatureH, int, const char *) |
void | OGR_F_SetFieldIntegerList (OGRFeatureH, int, int, int *) |
void | OGR_F_SetFieldDoubleList (OGRFeatureH, int, int, double *) |
void | OGR_F_SetFieldStringList (OGRFeatureH, int, char **) |
void | OGR_F_SetFieldRaw (OGRFeatureH, int, OGRField *) |
long | OGR_F_GetFID (OGRFeatureH) |
OGRErr | OGR_F_SetFID (OGRFeatureH, long) |
void | OGR_F_DumpReadable (OGRFeatureH, FILE *) |
OGRErr | OGR_F_SetFrom (OGRFeatureH, OGRFeatureH, int) |
const char * | OGR_F_GetStyleString (OGRFeatureH) |
void | OGR_F_SetStyleString (OGRFeatureH, const char *) |
OGRGeometryH | OGR_L_GetSpatialFilter (OGRLayerH) |
void | OGR_L_SetSpatialFilter (OGRLayerH, OGRGeometryH) |
OGRErr | OGR_L_SetAttributeFilter (OGRLayerH, const char *) |
void | OGR_L_ResetReading (OGRLayerH) |
OGRFeatureH | OGR_L_GetNextFeature (OGRLayerH) |
OGRFeatureH | OGR_L_GetFeature (OGRLayerH, long) |
OGRErr | OGR_L_SetFeature (OGRLayerH, OGRFeatureH) |
OGRErr | OGR_L_CreateFeature (OGRLayerH, OGRFeatureH) |
OGRErr | OGR_L_DeleteFeature (OGRLayerH, long) |
OGRFeatureDefnH | OGR_L_GetLayerDefn (OGRLayerH) |
OGRSpatialReferenceH | OGR_L_GetSpatialRef (OGRLayerH) |
OGRErr | OGR_L_GetExtent (OGRLayerH, OGREnvelope *, int) |
int | OGR_L_TestCapability (OGRLayerH, const char *) |
OGRErr | OGR_L_CreateField (OGRLayerH, OGRFieldDefnH, int) |
OGRErr | OGR_L_StartTransaction (OGRLayerH) |
OGRErr | OGR_L_CommitTransaction (OGRLayerH) |
OGRErr | OGR_L_RollbackTransaction (OGRLayerH) |
const char * | OGR_DS_GetName (OGRDataSourceH) |
int | OGR_DS_GetLayerCount (OGRDataSourceH) |
OGRLayerH | OGR_DS_GetLayer (OGRDataSourceH, int) |
OGRLayerH | OGR_DS_GetLayerByName (OGRDataSourceH, const char *) |
OGRLayerH | OGR_DS_CreateLayer (OGRDataSourceH, const char *, OGRSpatialReferenceH, OGRwkbGeometryType, char **) |
int | OGR_DS_TestCapability (OGRDataSourceH, const char *) |
OGRLayerH | OGR_DS_ExecuteSQL (OGRDataSourceH, const char *, OGRGeometryH, const char *) |
void | OGR_DS_ReleaseResultSet (OGRDataSourceH, OGRLayerH) |
const char * | OGR_Dr_GetName (OGRSFDriverH) |
OGRDataSourceH | OGR_Dr_Open (OGRSFDriverH, const char *, int) |
int | OGR_Dr_TestCapability (OGRSFDriverH, const char *) |
OGRDataSourceH | OGR_Dr_CreateDataSource (OGRSFDriverH, const char *, char **) |
OGRDataSourceH | OGROpen (const char *, int, OGRSFDriverH *) |
void | OGRRegisterDriver (OGRSFDriverH) |
int | OGRGetDriverCount (void) |
OGRSFDriverH | OGRGetDriver (int) |
void | OGRRegisterAll (void) |
See also: ogr_geometry.h, ogr_feature.h, ogrsf_frmts.h
|
This function attempts to create a new data source based on the passed driver. The papszOptions argument can be used to control driver specific creation options. These options are normally documented in the format specific documentation. This function is the same as the C++ method OGRSFDriver::CreateDataSource().
|
|
Fetch name of driver (file format). This name should be relatively short (10-40 characters), and should reflect the underlying file format. For instance "ESRI Shapefile". This function is the same as the C++ method OGRSFDriver::GetName().
|
|
Attempt to open file with this driver. This function is the same as the C++ method OGRSFDriver::Open().
|
|
Test if capability is available. One of the following data source capability names can be passed into this function, 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 function is the same as the C++ method OGRSFDriver::TestCapability().
|
|
This function 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. This function is the same as the C++ method OGRDataSource::CreateLayer().
#include "ogrsf_frmts.h" #include "cpl_string.h" ... OGRLayerH *hLayer; char *papszOptions; if( OGR_DS_TestCapability( hDS, ODsCreateLayer ) ) { ... } papszOptions = CSLSetNameValue( papszOptions, "DIM", "2" ); hLayer = OGR_DS_CreateLayer( hDS, "NewLayer", NULL, wkbUnknown, papszOptions ); CSLDestroy( papszOptions ); if( hLayer == NULL ) { ... } |
|
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 handle 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 OGR_DS_ReleaseResultsSet() before the data source is closed (destroyed). 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. This function is the same as the C++ method OGRDataSource::ExecuteSQL();
|
|
Fetch a layer by index. The returned layer remains owned by the OGRDataSource and should not be deleted by the application. This function is the same as the C++ method OGRDataSource::GetLayer().
|
|
Fetch a layer by name. The returned layer remains owned by the OGRDataSource and should not be deleted by the application. This function is the same as the C++ method OGRDataSource::GetLayerByName().
|
|
Get the number of layers in this data source. This function is the same as the C++ method OGRDataSource::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 function is the same as the C++ method OGRDataSource::GetName().
|
|
Release results of OGR_DS_ExecuteSQL(). This function should only be used to deallocate OGRLayers resulting from an OGR_DS_ExecuteSQL() call on the same OGRDataSource. Failure to deallocate a results set before destroying the OGRDataSource may cause errors. This function is the same as the C++ method OGRDataSource::ReleaseResultsSet().
|
|
Test if capability is available. One of the following data source capability names can be passed into this function, 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 function is the same as the C++ method OGRDataSource::TestCapability().
|
|
Duplicate feature. The newly created feature is owned by the caller, and will have it's own reference to the OGRFeatureDefn. This function is the same as the CPP method OGRFeature::Clone().
|
|
Feature factory. Note that the OGRFeature will increment the reference count of it's defining OGRFeatureDefn. Destruction of the OGRFeatureDefn before destruction of all OGRFeatures that depend on it is likely to result in a crash. This function is the same as the CPP method OGRFeature::OGRFeature().
|
|
Destroy feature The feature is deleted, but within the context of the GDAL/OGR heap. This is necessary when higher level applications use GDAL/OGR from a DLL and they want to delete a feature created within the DLL. If the delete is done in the calling application the memory will be freed onto the application heap which is inappropriate. This function is the same as the CPP method OGRFeature::DestroyFeature().
|
|
Dump this feature in a human readable form. This dumps the attributes, and geometry; however, it doesn't definition information (other than field types and names), nor does it report the geometry spatial reference system. This function is the same as the CPP method OGRFeature::DumpReadable().
|
|
Test if two features are the same. Two features are considered equal if the share them (handle equality) same OGRFeatureDefn, have the same field values, and the same geometry (as tested by OGR_G_Equal()) as well as the same feature id. This function is the same as the CPP method OGRFeature::Equal().
|
|
Fetch feature definition. This function is the same as the CPP method OGRFeature::GetDefnRef().
|
|
Get feature identifier. This function is the same as the CPP method OGRFeature::GetFID().
|
|
Fetch field value as a double. OFTString features will be translated using atof(). OFTInteger fields will be cast to double. Other field types, or errors will result in a return value of zero. This function is the same as the CPP method OGRFeature::GetFieldAsDouble().
|
|
Fetch field value as a list of doubles. Currently this function only works for OFTRealList fields. This function is the same as the CPP method OGRFeature::GetFieldAsDoubleList().
|
|
Fetch field value as integer. OFTString features will be translated using atoi(). OFTReal fields will be cast to integer. Other field types, or errors will result in a return value of zero. This function is the same as the CPP method OGRFeature::GetFieldAsInteger().
|
|
Fetch field value as a list of integers. Currently this function only works for OFTIntegerList fields. This function is the same as the CPP method OGRFeature::GetFieldAsIntegerList().
|
|
Fetch field value as a string. OFTReal and OFTInteger fields will be translated to string using sprintf(), but not necessarily using the established formatting rules. Other field types, or errors will result in a return value of zero. This function is the same as the CPP method OGRFeature::GetFieldAsString().
|
|
Fetch field value as a list of strings. Currently this method only works for OFTStringList fields. This function is the same as the CPP method OGRFeature::GetFieldAsStringList().
|
|
Fetch number of fields on this feature. This will always be the same as the field count for the OGRFeatureDefn. This function is the same as the CPP method OGRFeature::GetFieldCount().
|
|
Fetch definition for this field. This function is the same as the CPP method OGRFeature::GetFieldDefnRef().
|
|
Fetch the field index given field name. This is a cover for the OGRFeatureDefn::GetFieldIndex() method. This function is the same as the CPP method OGRFeature::GetFieldIndex().
|
|
Fetch an handle to feature geometry. This function is the same as the CPP method OGRFeature::GetGeometryRef().
|
|
Fetch an handle to the internal field value given the index. This function is the same as the CPP method OGRFeature::GetRawFieldRef().
|
|
Fetch style string for this feature. Set the OGR Feature Style Specification for details on the format of this string, and ogr_featurestyle.h for services available to parse it. This function is the same as the CPP method OGRFeature::GetStyleString().
|
|
Test if a field has ever been assigned a value or not. This function is the same as the CPP method OGRFeature::IsFieldSet().
|
|
Set the feature identifier. For specific types of features this operation may fail on illegal features ids. Generally it always succeeds. Feature ids should be greater than or equal to zero, with the exception of OGRNullFID (-1) indicating that the feature id is unknown. This function is the same as the CPP method OGRFeature::SetFID().
|
|
Set field to double value. OFTInteger and OFTReal fields will be set directly. OFTString fields will be assigned a string representation of the value, but not necessarily taking into account formatting constraints on this field. Other field types may be unaffected. This function is the same as the CPP method OGRFeature::SetField().
|
|
Set field to list of doubles value. This function currently on has an effect of OFTRealList fields. This function is the same as the CPP method OGRFeature::SetField().
|
|
Set field to integer value. OFTInteger and OFTReal fields will be set directly. OFTString fields will be assigned a string representation of the value, but not necessarily taking into account formatting constraints on this field. Other field types may be unaffected. This function is the same as the CPP method OGRFeature::SetField().
|
|
Set field to list of integers value. This function currently on has an effect of OFTIntegerList fields. This function is the same as the CPP method OGRFeature::SetField().
|
|
Set field. The passed value OGRField must be of exactly the same type as the target field, or an application crash may occur. The passed value is copied, and will not be affected. It remains the responsibility of the caller. This function is the same as the CPP method OGRFeature::SetField().
|
|
Set field to string value. OFTInteger fields will be set based on an atoi() conversion of the string. OFTReal fields will be set based on an atof() conversion of the string. Other field types may be unaffected. This function is the same as the CPP method OGRFeature::SetField().
|
|
Set field to list of strings value. This function currently on has an effect of OFTStringList fields. This function is the same as the CPP method OGRFeature::SetField().
|
|
Set one feature from another. Overwrite the contents of this feature from the geometry and attributes of another. The hOtherFeature does not need to have the same OGRFeatureDefn. Field values are copied by corresponding field names. Field types do not have to exactly match. OGR_F_SetField*() function conversion rules will be applied as needed. This function is the same as the CPP method OGRFeature::SetFrom().
|
|
Set feature geometry. This function updates the features geometry, and operate exactly as SetGeometryDirectly(), except that this function does not assume ownership of the passed geometry, but instead makes a copy of it. This function is the same as the CPP OGRFeature::SetGeometry().
|
|
Set feature geometry. This function updates the features geometry, and operate exactly as SetGeometry(), except that this function assumes ownership of the passed geometry. This function is the same as the CPP method OGRFeature::SetGeometryDirectly.
|
|
Set feature style string. This function is the same as the CPP method OGRFeature::SetStyleString().
|
|
Clear a field, marking it as unset. This function is the same as the CPP method OGRFeature::UnsetField().
|
|
Add a new field definition to the passed feature definition. This function should only be called while there are no OGRFeature objects in existance based on this OGRFeatureDefn. The OGRFieldDefn passed in is copied, and remains the responsibility of the caller. This function is the same as the CPP method OGRFeatureDefn::AddFieldDefn.
|
|
Create a new feature definition object to held the field definitions. The OGRFeatureDefn maintains a reference count, but this starts at zero. It is mainly intended to represent a count of OGRFeature's based on this definition. This function is the same as the CPP method OGRFeatureDefn::OGRFeatureDefn().
|
|
Decrements the reference count by one. This function is the same as the CPP method OGRFeatureDefn::Dereference().
|
|
Destroy a feature definition object and release all memory associated with it. This function is the same as the CPP method OGRFeatureDefn::~OGRFeatureDefn().
|
|
Fetch number of fields on the passed feature definition. This function is the same as the CPP OGRFeatureDefn::GetFieldCount().
|
|
Fetch field definition of the passed feature definition. This function is the same as the CPP method OGRFeatureDefn::GetFieldDefn().
|
|
Find field by name. The field index of the first field matching the passed field name (case insensitively) is returned. This function is the same as the CPP method OGRFeatureDefn::GetFieldIndex.
|
|
Fetch the geometry base type of the passed feature definition. This function is the same as the CPP method OGRFeatureDefn::GetGeomType().
|
|
Get name of the OGRFeatureDefn passed as an argument. This function is the same as the CPP method OGRFeatureDefn::GetName().
|
|
Fetch current reference count. This function is the same as the CPP method OGRFeatureDefn::GetReferenceCount().
|
|
Increments the reference count by one. The reference count is used keep track of the number of OGRFeature objects referencing this definition. This function is the same as the CPP method OGRFeatureDefn::Reference().
|
|
Assign the base geometry type for the passed layer (the same as the feature definition). All geometry objects using this type must be of the defined type or a derived type. The default upon creation is wkbUnknown which allows for any geometry type. The geometry type should generally not be changed after any OGRFeatures have been created against this definition. This function is the same as the CPP method OGRFeatureDefn::SetGeomType().
|
|
Create a new field definition. This function is the same as the CPP method OGRFieldDefn::OGRFieldDefn().
|
|
Destroy a field definition.
|
|
Get the justification for this field. This function is the same as the CPP method OGRFieldDefn::GetJustify().
|
|
Fetch name of this field. This function is the same as the CPP method OGRFieldDefn::GetNameRef().
|
|
Get the formatting precision for this field. This should normally be zero for fields of types other than OFTReal. This function is the same as the CPP method OGRFieldDefn::GetPrecision().
|
|
Fetch type of this field. This function is the same as the CPP method OGRFieldDefn::GetType().
|
|
Get the formatting width for this field. This function is the same as the CPP method OGRFieldDefn::GetWidth().
|
|
Set defining parameters for a field in one call. This function is the same as the CPP method OGRFieldDefn::Set().
|
|
Set the justification for this field. This function is the same as the CPP method OGRFieldDefn::SetJustify().
|
|
Reset the name of this field. This function is the same as the CPP method OGRFieldDefn::SetName().
|
|
Set the formatting precision for this field in characters. This should normally be zero for fields of types other than OFTReal. This function is the same as the CPP method OGRFieldDefn::SetPrecision().
|
|
Set the type of this field. This should never be done to an OGRFieldDefn that is already part of an OGRFeatureDefn. This function is the same as the CPP method OGRFieldDefn::SetType().
|
|
Set the formatting width for this field in characters. This function is the same as the CPP method OGRFieldDefn::SetWidth().
|
|
Add a geometry to a geometry container. Some subclasses of OGRGeometryCollection restrict the types of geometry that can be added, and may return an error. The passed geometry is cloned to make an internal copy. There is no SFCOM analog to this method. This function is the same as the CPP method OGRGeometryCollection::addGeometry.
|
|
Add a geometry directly to an existing geometry container. Some subclasses of OGRGeometryCollection restrict the types of geometry that can be added, and may return an error. Ownership of the passed geometry is taken by the container rather than cloning as addGeometry() does. This function is the same as the CPP method OGRGeometryCollection::addGeometryDirectly. There is no SFCOM analog to this method.
|
|
Add a point to a geometry (line string or point). The vertex count of the line string is increased by one, and assigned from the passed location value.
|
|
Assign spatial reference to this object. Any existing spatial reference is replaced, but under no circumstances does this result in the object being reprojected. It is just changing the interpretation of the existing geometry. Note that assigning a spatial reference increments the reference count on the OGRSpatialReference, but does not copy it. This is similar to the SFCOM IGeometry::put_SpatialReference() method. This function is the same as the CPP method OGRGeometry::assignSpatialReference.
|
|
Make a copy of this object. This function relates to the SFCOM IGeometry::clone() method. This function is the same as the CPP method OGRGeometry::clone().
|
|
Create a geometry object of the appropriate type from it's well known binary representation. Note that if nBytes is passed as zero, no checking can be done on whether the pabyData is sufficient. This can result in a crash if the input data is corrupt. This function returns no indication of the number of bytes from the data source actually used to represent the returned geometry object. Use OGR_G_WkbSize() on the returned geometry to establish the number of bytes it required in WKB format. The OGRGeometryFactory::createFromWkb() CPP method is the same as this function.
|
|
Create a geometry object of the appropriate type from it's well known text representation. The OGRGeometryFactory::createFromWkt CPP method is the same as this function.
|
|
Create an empty geometry of desired type. This is equivelent to allocating the desired geometry with new, but the allocation is guaranteed to take place in the context of the GDAL/OGR heap. This function is the same as the CPP method OGRGeometryFactory::createGeometry.
|
|
Destroy geometry object. Equivalent to invoking delete on a geometry, but it guaranteed to take place within the context of the GDAL/OGR heap. This function is the same as the CPP method OGRGeometryFactory::destroyGeometry.
|
|
Dump geometry in well known text format to indicated output file. This method is the same as the CPP method OGRGeometry::dumpReadable.
|
|
Clear geometry information. This restores the geometry to it's initial state after construction, and before assignment of actual geometry. This function relates to the SFCOM IGeometry::Empty() method. This function is the same as the CPP method OGRGeometry::empty().
|
|
Returns two if two geometries are equivalent. This function is the same as the CPP method OGRGeometry::Equals() method.
|
|
Convert a geometry into well known binary format. This function relates to the SFCOM IWks::ExportToWKB() method. This function is the same as the CPP method OGRGeometry::exportToWkb().
|
|
Convert geometry to strictly 2D. In a sense this converts all Z coordinates to 0.0. This function is the same as the CPP method OGRGeometry::flattenTo2D().
|
|
Compute geometry area. Computes the area for an OGRLinearRing, OGRPolygon or OGRMultiPolygon. Undefined for all other geometry types (returns zero). This function utilizes the C++ get_Area() methods such as OGRPolygon::get_Area().
|
|
Get the dimension of the coordinates in this geometry. This function corresponds to the SFCOM IGeometry::GetDimension() method. This function is the same as the CPP method OGRGeometry::getCoordinateDimension().
|
|
Get the dimension of this geometry. This function corresponds to the SFCOM IGeometry::GetDimension() method. It indicates the dimension of the geometry, but does not indicate the dimension of the underlying space (as indicated by OGR_G_GetCoordinateDimension() function). This function is the same as the CPP method OGRGeometry::getDimension().
|
|
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure. This function is the same as the CPP method OGRGeometry::getEnvelope().
|
|
Fetch the number of elements in a geometry.
|
|
Fetch WKT name for geometry type. There is no SFCOM analog to this function. This function is the same as the CPP method OGRGeometry::getGeometryName().
|
|
Fetch geometry from a geometry container. This function returns an handle to a geometry within the container. The returned geometry remains owned by the container, and should not be modified. The handle is only valid untill the next change to the geometry container. Use OGR_G_Clone() to make a copy. This function relates to the SFCOM IGeometryCollection::get_Geometry() method. This function is the same as the CPP method OGRGeometryCollection::getGeometryRef().
|
|
Fetch geometry type. Note that the geometry type may include the 2.5D flag. To get a 2D flattened version of the geometry type apply the wkbFlatten() macro to the return result. This function is the same as the CPP method OGRGeometry::getGeometryType().
|
|
Fetch a point in line string or a point geometry.
|
|
Fetch number of points from a geometry.
|
|
Returns spatial reference system for geometry. This function relates to the SFCOM IGeometry::get_SpatialReference() method. This function is the same as the CPP method OGRGeometry::getSpatialReference().
|
|
Fetch the x coordinate of a point from a geometry.
|
|
Fetch the x coordinate of a point from a geometry.
|
|
Fetch the z coordinate of a point from a geometry.
|
|
Assign geometry from well known binary data. The object must have already been instantiated as the correct derived type of geometry object to match the binaries type. This function relates to the SFCOM IWks::ImportFromWKB() method. This function is the same as the CPP method OGRGeometry::importFromWkb().
|
|
Assign geometry from well known text data. The object must have already been instantiated as the correct derived type of geometry object to match the text type. This function relates to the SFCOM IWks::ImportFromWKT() method. This function is the same as the CPP method OGRGeometry::importFromWkt().
|
|
Do these features intersect? Currently this is not implemented in a rigerous fashion, and generally just tests whether the envelopes of the two features intersect. Eventually this will be made rigerous. This function is the same as the CPP method OGRGeometry::Intersects.
|
|
Remove a geometry from an exiting geometry container. Removing a geometry will cause the geometry count to drop by one, and all "higher" geometries will shuffle down one in index. There is no SFCOM analog to this method. This function is the same as the CPP method OGRGeometryCollection::removeGeometry().
|
|
Set the location of a vertex in a point or linestring geometry. If iPoint is larger than the number of existing points in the linestring, the point count will be increased to accomodate the request.
|
|
Apply arbitrary coordinate transformation to geometry. This function will transform the coordinates of a geometry from their current spatial reference system to a new target spatial reference system. Normally this means reprojecting the vectors, but it could include datum shifts, and changes of units. Note that this function does not require that the geometry already have a spatial reference system. It will be assumed that they can be treated as having the source spatial reference system of the OGRCoordinateTransformation object, and the actual SRS of the geometry will be ignored. On successful completion the output OGRSpatialReference of the OGRCoordinateTransformation will be assigned to the geometry. This function is the same as the CPP method OGRGeometry::transform.
|
|
Transform geometry to new spatial reference system. This function will transform the coordinates of a geometry from their current spatial reference system to a new target spatial reference system. Normally this means reprojecting the vectors, but it could include datum shifts, and changes of units. This function will only work if the geometry already has an assigned spatial reference system, and if it is transformable to the target coordinate system. Because this function requires internal creation and initialization of an OGRCoordinateTransformation object it is significantly more expensive to use this function to transform many geometries than it is to create the OGRCoordinateTransformation in advance, and call transform() with that transformation. This function exists primarily for convenience when only transforming a single geometry. This function is the same as the CPP method OGRGeometry::transformTo.
|
|
Returns size of related binary representation. This function returns the exact number of bytes required to hold the well known binary representation of this geometry object. Its computation may be slightly expensive for complex geometries. This function relates to the SFCOM IWks::WkbSize() method. This function is the same as the CPP method OGRGeometry::WkbSize().
|
|
Fetch human readable name for a field type. This function is the same as the CPP method OGRFieldDefn::GetFieldTypeName().
|
|
What does this do?. This function is the same as the C++ method OGRLayer::CommitTransaction().
|
|
Create and write a new feature within a layer. 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. This function is the same as the C++ method OGRLayer::CreateFeature().
|
|
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 function is the same as the C++ method OGRLayer::CreateField().
|
|
Delete feature from layer. The feature with the indicated feature id is deleted from the layer if supported by the driver. Most drivers do not support feature deletion, and will return OGRERR_UNSUPPORTED_OPERATION. The OGR_L_TestCapability() function may be called with OLCDeleteFeature to check if the driver supports feature deletion. This method is the same as the C++ method OGRLayer::DeleteFeature().
|
|
Fetch the extent of this layer. Returns the extent (MBR) of the data in the layer. If bForce is FALSE, and it would be expensive to establish the extent then OGRERR_FAILURE will be returned indicating that the extent isn't know. If bForce is TRUE then some implementations will actually scan the entire layer once to compute the MBR of all the features in the layer. The returned extent does not take the spatial filter into account. If a spatial filter was previously set then it should be ignored but some implementations may be unable to do that, so it is safer to call OGR_L_GetExtent() without setting a spatial filter. Layers without any geometry may return OGRERR_FAILURE just indicating that no meaningful extents could be collected. This function is the same as the C++ method OGRLayer::GetExtent().
|
|
Fetch a feature by it's 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. If this function returns a non-NULL feature, it is guaranteed that it's feature id (OGR_F_GetFID()) will be the same as nFID. Use OGR_L_TestCapability(OLCRandomRead) to establish if this layer supports efficient random access reading via OGR_L_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 are generally considered interrupted by a OGR_L_GetFeature() call. This function is the same as the C++ method OGRLayer::GetFeature( ).
|
|
Fetch the schema information for this layer. The returned handle to the 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 function is the same as the C++ method OGRLayer::GetLayerDefn().
|
|
Fetch the next available feature from this layer. The returned feature becomes the responsiblity of the caller to delete. 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 function implements sequential access to the features of a layer. The OGR_L_ResetReading() function can be used to start at the beginning again. Random reading, writing and spatial filtering will be added to the OGRLayer in the future. This function is the same as the C++ method OGRLayer::GetNextFeature().
|
|
This function returns the current spatial filter for this layer. The returned pointer is to an internally owned object, and should not be altered or deleted by the caller. This function is the same as the C++ method OGRLayer::GetSpatialFilter().
|
|
Fetch the spatial reference system for this layer. The returned object is owned by the OGRLayer and should not be modified or freed by the application. This function is the same as the C++ method OGRLayer::GetSpatialRef().
|
|
Reset feature reading to start on the first feature. This affects GetNextFeature(). This function is the same as the C++ method OGRLayer::ResetReading().
|
|
What does this do?. This function is the same as the C++ method OGRLayer::RollbackTransaction().
|
|
Set a new attribute query. This function sets the attribute query string to be used when fetching features via the OGR_L_GetNextFeature() function. Only features for which the query evaluates as true will be returned. The query string should be in the format of an SQL WHERE clause. For instance "population > 1000000 and population < 5000000" where population is an attribute in the layer. The query format is a restricted form of SQL WHERE clause as defined "eq_format=restricted_where" about half way through this document: http://ogdi.sourceforge.net/prop/6.2.CapabilitiesMetadata.html Note that installing a query string will generally result in resetting the current reading position (ala OGR_L_ResetReading()). This function is the same as the C++ method OGRLayer::SetAttributeFilter().
|
|
Rewrite an existing feature. This function will write a feature to the layer, based on the feature id within the OGRFeature. Use OGR_L_TestCapability(OLCRandomWrite) to establish if this layer supports random access writing via OGR_L_SetFeature(). This function is the same as the C++ method OGRLayer::SetFeature().
|
|
Set a new spatial filter. This function set the geometry to be used as a spatial filter when fetching features via the OGR_L_GetNextFeature() function. Only features that geometrically intersect the filter geometry will be returned. Currently this test is may be inaccurately implemented, but it is guaranteed that all features who's envelope (as returned by OGR_G_GetEnvelope()) overlaps the envelope of the spatial filter will be returned. This can result in more shapes being returned that should strictly be the case. This function makes an internal copy of the passed geometry. The passed geometry remains the responsibility of the caller, and may be safely destroyed. For the time being the passed filter geometry should be in the same SRS as the layer (as returned by OGR_L_GetSpatialRef()). In the future this may be generalized. This function is the same as the C++ method OGRLayer::SetSpatialFilter.
|
|
What does this do?. This function is the same as the C++ method OGRLayer::StartTransaction().
|
|
Test if this layer supported the named capability. The capability codes that can be tested are represented as strings, but defined constants exists to ensure correct spelling. Specific layer types may implement class specific capabilities, but this can't generally be discovered by the caller.
This function is the same as the C++ method OGRLayer::TestCapability().
|
|
Build a ring from a bunch of arcs.
|
|
Fetch the indicated driver. This function is the same as the C++ method OGRSFDriverRegistrar::GetDriver().
|
|
Fetch the number of registered drivers. This function is the same as the C++ method OGRSFDriverRegistrar::GetDriverCount().
|
|
Open a file / data source with one of the registered drivers. This function loops through all the drivers registered with the driver manager trying each until one succeeds with the given data source. This function is static. Applications don't normally need to use any other OGRSFDriverRegistrar function, not do they normally need to have a pointer to an OGRSFDriverRegistrar instance. If this function fails, CPLGetLastErrorMsg() can be used to check if there is an error message explaining why. This function is the same as the C++ method OGRSFDriverRegistrar::Open().
OGRDataSourceH *hDS; OGRSFDriverH *pahDriver;
hDS = OGROpen( "polygon.shp", 0, pahDriver ); if( hDS == NULL ) { return; }
... use the data source ...
delete hDS; |
|
Register all drivers. |
|
Add a driver to the list of registered drivers. If the passed driver is already registered (based on handle comparison) then the driver isn't registered. New drivers are added at the end of the list of registered drivers. This function is the same as the C++ method OGRSFDriverRegistrar::RegisterDriver().
|