Geo::GDAL 1.8.0

Geo::OGR::Layer Class Reference

Inheritance diagram for Geo::OGR::Layer:
Inheritance graph
[legend]

List of all members.

Public Class Methods

list Capabilities ()

Public Object Methods

scalar TestCapability (scalar cap)
hashref Schema (hash schema)
hashref Row (hash row)
list Tuple (list tuple)
Geo::OGR::Geometry SpatialFilter (scalar filter)
Geo::OGR::Geometry SpatialFilter (list filter)
 SetSpatialFilter (scalar filter)
 SetSpatialFilterRect (scalar minx, scalar miny, scalar maxx, scalar maxy)
Geo::OGR::Geometry GetSpatialFilter ()
 SetAttributeFilter (scalar filter_string)
 ResetReading ()
Geo::OGR::Feature GetNextFeature ()
 SetNextByIndex (scalar new_index)
scalar GetFeaturesRead ()
scalar GetName ()
Geo::OGR::Feature GetFeature (scalar fid)
 SetFeature (scalar feature)
 CreateFeature (scalar feature)
 InsertFeature (scalar feature)
 DeleteFeature (scalar fid)
 SyncToDisk ()
Geo::OGR::FeatureDefn GetLayerDefn ()
scalar GetFeatureCount (scalar force=1)
listref GetExtent (scalar force=1)
 CreateField (scalar field_def, scalar approx_ok=1)
 StartTransaction ()
 CommitTransaction ()
 RollbackTransaction ()
Geo::OSR::SpatialReference GetSpatialRef ()
scalar GetRefCount ()

Member Function Documentation

list Geo::OGR::Layer::Capabilities ( )
Returns:
a list of capabilities. The class method returns a list of all potential capabilities a layer may have; the object method returns a list of all capabilities the layer has.
Geo::OGR::Layer::CommitTransaction ( )
Geo::OGR::Layer::CreateFeature ( scalar  feature)

Inserts a feature into the layer. The given feature's id may change.

Parameters:
featurea Geo::OGR::Feature object
Geo::OGR::Layer::CreateField ( scalar  field_def,
scalar  approx_ok = 1 
)
Parameters:
field_defa Geo::OGR::FieldDefn object
approx_ok
Geo::OGR::Layer::DeleteFeature ( scalar  fid)
Parameters:
fidfeature id
listref Geo::OGR::Layer::GetExtent ( scalar  force = 1)
Parameters:
force
Returns:
the extent = ($minx, $miny, $maxx, $maxy) as a listref
Geo::OGR::Feature Geo::OGR::Layer::GetFeature ( scalar  fid)
Parameters:
fidfeature id
Returns:
a new Geo::OGR::Feature object
scalar Geo::OGR::Layer::GetFeatureCount ( scalar  force = 1)
Parameters:
force
Returns:
integer
scalar Geo::OGR::Layer::GetFeaturesRead ( )
Returns:
integer
Geo::OGR::FeatureDefn Geo::OGR::Layer::GetLayerDefn ( )
Returns:
a new Geo::OGR::FeatureDefn object
scalar Geo::OGR::Layer::GetName ( )
Returns:
Geo::OGR::Feature Geo::OGR::Layer::GetNextFeature ( )
Returns:
a new Geo::OGR::Feature object
scalar Geo::OGR::Layer::GetRefCount ( )
Returns:
integer
Geo::OGR::Geometry Geo::OGR::Layer::GetSpatialFilter ( )
Returns:
a new Geo::OGR::Geometry object
Geo::OSR::SpatialReference Geo::OGR::Layer::GetSpatialRef ( )
Returns:
a new Geo::OSR::SpatialReference object
Geo::OGR::Layer::InsertFeature ( scalar  feature)

Same as CreateFeature except that the parameter feature may be a hashref (%row) or a listref (@tuple) that is fed to a Geo::OGR::Feature object's Row or Tuple method that is created in inserted into the layer.

Parameters:
featurea Geo::OGR::Feature object, or %row or @tuple
Geo::OGR::Layer::ResetReading ( )
Geo::OGR::Layer::RollbackTransaction ( )
hashref Geo::OGR::Layer::Row ( hash  row)

Get and/or set the data of a feature that has the supplied feature id (gets next if feature id is not given). The keys of the row are the field names. Special names FID and Geometry are used for feature id and Geometry respectively. The geometry is a Geo::OGR::Geometry object whose data is owned by the feature. It is ok to set only a subset of the fields, those fields whose keys do not exist are left unchanged.

Parameters:
row[optional]
Returns:
hashref Geo::OGR::Layer::Schema ( hash  schema)

Get and/or set the schema of the layer.

Parameters:
schemaThe schema hash may contain the keys:

  • Fields A reference to a list of field definitions (either Geo::OGR::FieldDefn objects or hashrefs from which they can be created).
  • ApproxOK (optional) A flag specifying whether it is ok to change the requested field definition to accommodate limitations of the layer.
Returns:
a reference to a schema hash, which has keys:
  • Name The name of this layer.
  • GeometryType The type of the geometries in this layer (a string).
  • Fields An array of references to hashes of field definitions.
Geo::OGR::Layer::SetAttributeFilter ( scalar  filter_string)

Set or clear the attribute filter.

Parameters:
filter_stringa SQL WHERE clause or undef to clear the filter.
Geo::OGR::Layer::SetFeature ( scalar  feature)

Replaces a feature in the layer based on the given feature's id. Requires RandomWrite capability

Parameters:
featurea Geo::OGR::Feature object
Geo::OGR::Layer::SetNextByIndex ( scalar  new_index)
Parameters:
new_indexthe index to which set the read cursor
Geo::OGR::Layer::SetSpatialFilter ( scalar  filter)
Parameters:
filter[optional] a Geo::OGR::Geometry object. If not given, removes the filter if there is one.
Geo::OGR::Layer::SetSpatialFilterRect ( scalar  minx,
scalar  miny,
scalar  maxx,
scalar  maxy 
)
Parameters:
minx
miny
maxx
maxy
Geo::OGR::Geometry Geo::OGR::Layer::SpatialFilter ( list  filter)
Parameters:
filter[optional] a rectangle ($minx, $miny, $maxx, $maxy).
Returns:
a new Geo::OGR::Geometry object
Geo::OGR::Geometry Geo::OGR::Layer::SpatialFilter ( scalar  filter)
Parameters:
filter[optional] a Geo::OGR::Geometry object or a string. An undefined value removes the filter if there is one.
Returns:
a new Geo::OGR::Geometry object
Geo::OGR::Layer::StartTransaction ( )
Geo::OGR::Layer::SyncToDisk ( )
scalar Geo::OGR::Layer::TestCapability ( scalar  cap)
Parameters:
capA capability string.
Returns:
a boolean value indicating whether the layer has the specified capability.
list Geo::OGR::Layer::Tuple ( list  tuple)

Get and/set the data of a feature that has the supplied feature id (gets next if feature id is not given). The order of the data in the tuple is: feature id, Geometry, fields in their order. The geometry is a Geo::OGR::Geometry object whose data is owned by the feature. It is ok to leave Geometry undefined, it is set only if it is defined.

Parameters:
tuple[optional]
Returns:

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