| CopyLayer(Layer src_layer, char new_name, char options = None) -> Layer
|
Duplicate an existing layer. |
| CreateLayer( char name, SpatialReference srs = None,OGRwkbGeometryType geom_type = wkbUnknown, char options = None) -> Layer |
Attempts to create a new layer on the data source with the indicated name, coordinate system, geometry type. |
| DeleteLayer(value) |
Deletes the layer given an index or layer name |
| ExecuteSQL( char statement, Geometry spatialFilter = None, char dialect = "") -> Layer |
Execute an SQL statement against the data store. |
| GetDriver() -> Driver |
Returns the
driver that the dataset was opened with |
| GetLayer( Layer=0) ->layer |
Return the layer given an index or a name |
| GetLayerByIndex( int index = 0) -> Layer |
Return the layer by index |
| GetLayerByName( char layer_name) -> Layer |
Return the layer by name |
| GetLayerCount()-> int |
Get the number of layers in this data source |
| GetName() -> char |
Returns the name of the data source. |
| GetRefCount() -> int |
Fetch reference count. |
| GetSummaryRefCount() -> int |
Fetch reference count of datasource and all owned layers. |
| TestCapability( char cap) -> bool |
Test if capability is available. |
| Feature(FeatureDefn feature_def) -> Feature |
Create Feature |
| Clone() -> Feature |
Duplicate feature. |
| Destroy() -> None |
Delete (in memory) a feature |
| DumpReadable( ) -> None |
Dump this feature in a human readable form |
| ExportToJson(as_object=False)->object
|
Exports a GeoJSON object which represents the Feature.
Theas_object parameter determines whether the returned value
should be a Python object instead of a string. |
| Equal( Feature feature) -> bool |
Test if two features are the same. |
| GetDefnRef() -> FeatureDefn |
Fetch feature definition. |
| GetFID( ) -> int |
Get feature identifier. |
| GetField( fld_index) ->object |
Fetch field value |
| GetFieldAsDateTime(int id)-> list |
Fetch field value as date and time. Currently this method only works for
OFTDate, OFTTime and OFTDateTime fields. |
| GetFieldAsDouble( int id) -> double |
Fetch field value as a double. |
| GetFieldAsDouble char name) -> double |
Fetch field value as a double. |
| GetFieldAsDoubleList int id) ->list |
Fetch field value as a list of doubles. |
| GetFieldAsDoubleList char name) ->list |
Fetch field value as a list of doubles. |
| GetFieldAsInteger( int id) -> int |
Fetch field value as integer. |
| GetFieldAsInteger( char name) -> int |
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. |
| GetFieldAsIntegerList( int id) -> list |
Fetch field value as a list of integers. |
| GetFieldAsString( int id) -> char |
Fetch field value as a string. |
| GetFieldAsString( char name) -> char |
Fetch field value as a string. |
| GetFieldAsStringList( int id) -> char |
Fetch field value as a list of strings. |
| GetFieldCount() -> int |
Fetch number of fields on this feature |
| GetFieldDefnRef( int id) -> FieldDefn |
Fetch definition for this field |
| GetFieldDefnRef( char name) -> FieldDefn |
Fetch definition for this field |
| GetFieldIndex(char name) -> int |
Fetch the field index given field name. |
| GetFieldType( int id) -> OGRFieldType |
Fetch the field type. |
| GetFieldType( char name) -> OGRFieldType |
Fetch the field type. |
| GetGeometryRef(int id) -> OGRFieldType |
Fetch an handle to feature geometry. |
| GetGeometryRef(char name) -> Geometry
|
Fetch an handle to feature geometry. |
| GetStyleString( ) -> char |
Fetch style string for this feature. |
| IsFieldSet(int id) -> bool |
Test if a field has ever been assigned a value or not. |
| IsFieldSet(char name) -> bool |
Test if a field has ever been assigned a value or not. |
| SetFID(int fid) -> OGRErr |
Set the feature identifier.Feature ids should be greater than or equal to zero,
with the exception of OGRNullFID (-1) indicating that the feature id is unknown.
|
| SetField( int id, char value) -> None |
Set field |
| SetField( char name, char value) -> None |
Set field |
| SetField( int id, int value)) -> None |
Set field |
| SetField( char name, int value) -> None |
Set field |
| SetField( int id, double value) -> None |
Set field |
| SetField( char name, double value) -> None |
Set field |
| SetField( int id, int year, int month, int day, int hour, int minute, int second, int tzflag) -> None |
Set field |
| SetField( char name, int year, int month, int day, int hour, int minute, int second, int tzflag) -> None |
Set field |
| SetFieldDoubleList( int id, int nList) ) -> None |
Set field to list of doubles value. |
| SetFieldIntegerList( int id, int nList) -> None |
Set field to list of integers value. |
| SetFieldStringList( int id, char pList) -> None |
Set field to list of strings value. |
| SetFrom( Feature other, int forgiving = 1) -> OGRErr |
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. |
| SetGeometry( Geometry geom) -> OGRErr |
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 |
| SetGeometryDirectly(Geometry geom) -> OGRErr |
Set feature geometry. |
| SetStyleString( char the_string) -> None |
Set feature style string. |
| UnsetField(int id) -> None |
Clear a field, marking it as unset. |
| UnsetField(char name) -> None |
Clear a field, marking it as unset. |
| __init__(self, OGRwkbGeometryType type = wkbUnknown, char wkt = None,
int wkb = 0, char gml = None) -> Geometry |
Geometry( OGRwkbGeometryType type = wkbUnknown, char wkt = None,
int wkb = 0, char gml = None)#create an Geometry oject |
| AddGeometry(Geometry other) -> OGRErr |
Add a geometry |
| AddGeometryDirectly(Geometry other_disown) -> OGRErr |
Add a geometry directly |
| AddPoint(double x, double y, double z = 0) -> None |
Add a point to a geometry (line string or point). |
| AddPoint_2D( double x, double y) -> None |
Add a point to a geometry (line string or point). |
| AssignSpatialReference( SpatialReference reference) =>None |
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. |
| Buffer( double distance, int quadsecs = 30) -> Geometry |
Builds a new geometry containing the buffer region around the geometry on
which it is invoked. The buffer is a polygon containing the region within
the buffer distance of the original geometry. |
| Centroid() -> Geometry |
Compute and return centroid of surface |
| Clone(self) -> Geometry |
Make a copy of this object. |
| CloseRings() ->None |
Force rings to be closed |
| Contains( Geometry other) -> bool |
Tests if this geometry contains the other geometry. |
| ConvexHull() -> Geometry |
Compute convex hull.A new geometry object is created and returned containing the
convex hull of the geometry on which the method is invoked |
| Crosses( Geometry other) -> bool |
Tests if this geometry and the other geometry are crossing. |
| Difference(Geometry other) -> Geometry |
Generates a new geometry which is the region of this geometry with the region of the other geometry removed. |
| Disjoint( Geometry other) -> bool |
Tests if this geometry and the other geometry are disjoint. |
| Distance( Geometry other) -> double |
Returns the shortest distance between the two geometries. |
| Empty()->None |
Clear geometry information. This restores the geometry to it's initial state after construction, and before assignment of actual geometry. |
| Equal(Geometry other) -> bool |
Tests for equality |
| ExportToGML() -> retStringAndCPLFree |
Convert a geometry into GML format |
| ExportToJson() -> retStringAndCPLFree |
Convert a geometry into GeoJSON format |
| ExportToKML( char altitude_mode = None) -> retStringAndCPLFree |
Convert a geometry into KML format. |
| ExportToWkb( OGRwkbByteOrder byte_order = wkbXDR) -> OGRErr |
Convert a geometry into well known binary format. |
| ExportToWkt() -> OGRErr |
Convert a geometry into well known text format. |
| FlattenTo2D() |
Convert geometry to strictly 2D. In a sense this converts all Z coordinates to 0.0. |
| GetArea() -> double |
Compute geometry area |
| GetBoundary() -> Geometry |
Compute boundary on this object. A new geometry object is created and returned containing
the boundary of the geometry on which the method is invoked. |
| GetCoordinateDimension() -> int |
Get the dimension of the coordinates in this geometry. |
| GetDimension() -> int |
Get the dimension of this geometry. |
| GetEnvelope()-> Geometry |
Computes and returns the bounding envelope for this geometry |
| GetGeometryCount() -> int |
Fetch the number of elements in a geometry |
| GetGeometryName() -> char |
Fetch WKT name for geometry type. |
| GetGeometryRef( int geom) -> Geometry |
Fetch geometry. |
| GetGeometryType() -> OGRwkbGeometryType |
Fetch geometry type. |
| GetPoint( int iPoint = 0)-> list |
Fetch a point in line string or a point geometry |
| GetPointCount() -> int |
Fetch number of points from a geometry |
| GetPoint_2D( int iPoint = 0) |
Fetch a point in line string or a point geometry. |
| GetSpatialReference() -> SpatialReference |
Returns spatial reference system for geometry. |
| GetX( int point = 0) -> double |
Fetch the x coordinate of the first point from a geometry |
| GetY( int point = 0) -> double |
Fetch the y coordinate of the first point from a geometry |
| GetZ( int point = 0) -> double |
Fetch the z coordinate of the first point from a geometry |
| Intersect(Geometry other) -> bool |
Tests for intersection |
| Intersection( Geometry other) -> Geometry |
Compute intersection. |
| IsEmpty() -> bool |
Test if the geometry is empty. |
| IsRing() -> bool |
Test if the geometry is a ring. |
| IsSimple() -> bool |
Returns TRUE if the geometry is simple |
| IsValid () -> bool |
Test if the geometry is valid. |
| Overlaps( Geometry other) -> bool |
Test for overlap. Tests if this geometry and the other geometry overlap,
that is their intersection has a non-zero are |
| Segmentize( double dfMaxLength)->None |
Modify the geometry such it has no segment longer then the given
distance. Interpolated points will have Z and M values (if needed)
set to 0. Distance computation is performed in 2d only
|
| SetCoordinateDimension(int dimension) ->None |
Set the coordinate dimension |
| SetPoint( int point, double x, double y, double z = 0) ->None |
Set the location of a vertex in a point or linestring geometry |
| SetPoint_2D( int point, double x, double y) ) ->None |
Set the location of a vertex in a point or linestring geometry |
| SymmetricDifference( Geometry other) -> Geometry |
Generates a new geometry which is the symmetric difference of this geometry and the other geometry. |
| Touches( Geometry other) -> bool |
Tests if this geometry and the other geometry are touching. |
| Transform( CoordinateTransformation trans) -> OGRErr |
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.
|
| TransformTo( SpatialReference reference) -> OGRErr |
Transform geometry to new spatial reference system. 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.
|
| Union( Geometry other) -> Geometry |
Generates a new geometry which is the region of union of the two geometries operated on. |
| Within( Geometry other) -> bool |
Tests if this geometry is within the other geometry. |
| WkbSize(self) -> int |
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. |
| CommitTransaction() -> OGRErr |
For datasources which support transactions, CommitTransaction commits a transaction. |
| CreateFeature(Feature feature) -> OGRErr |
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. |
| CreateField( FieldDefn field_def, int approx_ok = 1) -> OGRErr |
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. |
| CreateFields(fields) |
Create a list of fields on the Layer. |
| DeleteFeature( long fid) -> OGRErr |
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. |
| GetExtent( int force = 1) -> OGRErr |
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.
Depending on the drivers, the returned extent may or may not take the spatial filter into account.
Layers without any
geometry may return OGRERR_FAILURE just indicating that no meaningful extents could be collected. |
| GetFIDColumn() -> char |
This method returns the name of the underlying database column being used as the FID column,
or "" if not supported. |
| GetFeature( long fid) -> Feature |
Fetch a feature by its identifier. Success or failure of this operation is
unaffected by the spatial or attribute filters. |
| GetFeatureCount( int force = 1) -> int |
Returns the number of features in the layer. For dynamic databases the count may not be exact. |
| GetFeaturesRead() -> GIntBig(long int) |
Return the total number of features read |
| GetGeometryColumn() -> char |
Returns the name of the underlying database column being used as the geometry column, or "" if not supported. |
| GetLayerDefn(self) -> FeatureDefn |
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. |
| GetName() -> char |
Return the layer name |
| GetNextFeature() -> Feature |
Fetch the next available feature from this layer.The returned feature becomes the responsiblity
of the caller to delete. 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 ResetReading() function can be used to start at the beginning again. |
| GetRefCount() -> int |
Fetch reference count. |
| GetSpatialFilter() -> Geometry |
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. |
| GetSpatialRef() -> SpatialReference |
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 |
| ResetReading() ->None |
Reset feature reading to start on the first feature. |
| RollbackTransaction() -> OGRErr |
For datasources which support transactions, this method will roll back a datasource to its state
before the start of the current transaction. Datasources which do not support transactions
will always return OGRERR_NONE. |
| SetAttributeFilter( char filter_string) -> OGRErr |
Sets the attribute query string to be used when fetching features via the GetNextFeature() function.
The query string should be in the format of an SQL WHERE clause. Forinstance
"population > 1000000 and population < 5000000" where population is an attribute in the layer. |
| SetFeature( Feature feature) -> OGRErr |
Write a feature to the layer, based on the feature id within the OGRFeature. |
| SetNextByIndex( long new_index) -> OGRErr |
allows positioning of a layer such that the GetNextFeature() call will read the requested feature, where nIndex is an absolute index |
| SetSpatialFilter( Geometry filter) ->None |
Set a new spatial filter. This function set the geometry to be used as a spatial filter
when fetching features via the GetNextFeature() function. Only features that geometrically intersect
the filter geometry will be returned.
|
| SetSpatialFilterRect(double minx, double miny, double maxx, double maxy) ->None |
Set a new rectangular spatial filter.
This method set rectangle to be used as a spatial filter when fetching features via the GetNextFeature() method.
Only features that geometrically intersect the given rectangle will be returned. The x/y values should
be in the same coordinate system as the layer as a whole (as returned by :GetSpatialRef()).
Internally this method is normally implemented as creating a 5 vertex closed rectangular polygon
and passing it to OGRLayer::SetSpatialFilter(). It exists as a convenience.
The only way to clear a spatial filter set with this method is to call SetSpatialFilter(NULL). |
| StartTransaction() -> OGRErr |
For datasources which support transactions, StartTransaction creates a transaction.
Datasources which do not support transactions will always return OGRERR_NONE. |
| SyncToDisk() -> OGRErr |
Flush pending changes to disk. This call is intended to force the layer 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 layers do not implement this method,
and will still return OGRERR_NONE. The default implementation just returns OGRERR_NONE.
An error is only returned if an error occurs while attempting to flush to disk.
|
| TestCapability( char cap) -> bool |
Test if this layer supported the named capability (see talble of constants below). |
| ApproximateArcAngles(double dfCenterX, double dfCenterY, double dfZ, double dfPrimaryRadius, double dfSecondaryAxis, double dfRotation, double dfStartAngle, double dfEndAngle, double dfMaxAngleStepSizeDegrees) -> Geometry |
Stroke arc to linestring |
| BuildPolygonFromEdges(Geometry hLineCollection, int bBestEffort = 0, int bAutoClose = 0, double dfTolerance = 0) -> Geometry |
Build a ring from a bunch of arcs. |
| CreateGeometryFromGML(char input_string) -> Geometry |
Create a new Geometry from a GML string |
| CreateGeometryFromJson(char input_string) -> Geometry |
Create a new Geometry from a GeoJSON string |
| CreateGeometryFromWkb(int len, SpatialReference reference = None) -> Geometry |
Create a new Geometry from a well known binary (wkb) content |
| CreateGeometryFromWkt(char val, SpatialReference reference = None) -> Geometry |
Create a new Geometry from a well known text (wkt) string. |
| DontUseExceptions() ->None |
Use return code instead of exceptions |
| GeneralCmdLineProcessor(char papszArgv, int nOptions = 0) -> char |
General utility option processing |
| GetDriver(int driver_number) -> Driver |
Fetch the indicated driver. |
| GetDriverByName(char name) -> Driver |
Fetch the indicated driver. |
| GetDriverCount() -> int |
Fetch the number of registered drivers. |
| GetOpenDS(int ds_number) -> DataSource |
Return the iDS th datasource opened. |
| GetOpenDSCount() -> int |
Return the number of opened datasources. |
| Open(char filename, int update = 0) -> DataSource |
Open a file / data source with one of the registered drivers. |
| OpenShared(char filename, int update = 0) -> DataSource |
Open a file / data source with one of the registered drivers. |
| RegisterAll() ->None |
Register all known configured OGR drivers |
| UseExceptions() ->None |
Use exceptions instead of error return codes. |