List of all members.
Member Function Documentation
- Parameters:
-
field_name | the name (or index) of the field to be altered |
new_definition | one or more of Name, Type, and Width |
Examples:
- 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.
- Deprecated:
- use Geo::OGR::Layer::InsertFeature which accepts Perl data and checks for geometry type and attribute data
- Note:
- The feature should have the same schema as the layer.
Inserts a feature into the layer. The given feature's id may change.
- Parameters:
-
- Parameters:
-
parameters | named parameters: Name, Type, Justify, Width, Precision |
- Returns:
- the data source object to which this layer object belongs to.
Delete an existing field from a layer.
- Parameters:
-
field | name (or index) of the field which is deleted |
- Note:
- experimental, the syntax may change
Call code for all features. This is a simple wrapper for ResetReading and while(GetNextFeature).
Example usage:
$layer->ForFeatures(sub {my $f = shift; $self->DeleteFeature($f->FID)}); # empties the layer
- Parameters:
-
code | a reference to a subroutine, which is called with each feature as an argument |
in_place | if set to true, the feature is stored back to the layer |
- Note:
- experimental, the syntax may change
Call code for all geometries. This is a simple wrapper for ResetReading and while(GetNextFeature).
Example usage:
my $area = 0;
$layer->ForGeometries(sub {my $g = shift; $area += $g->Area}); # computes the total area
- Parameters:
-
code | a reference to a subroutine, which is called with each geometry as an argument |
in_place | if set to true, the geometry is stored back to the layer |
- Parameters:
-
force | compute the extent even if it is expensive |
- Note:
- In scalar context returns a reference to an anonymous array containing the extent.
-
The order of values is different from those returned by Geo::OGR::Geometry::GetEnvelope.
- Returns:
- the extent ($minx, $miny, $maxx, $maxy)
- Parameters:
-
- Returns:
- integer
- Returns:
- the name of the underlying database column being used as the FID column, or "" if not supported.
- Parameters:
-
field_name | the name (or index) of the field |
- Returns:
- the schema of the field in a hash (in list context) or in an anonymous hash
- Returns:
- the name of the underlying database column being used as the geometry column, or "" if not supported
- Returns:
- iteratively Geo::OGR::Feature objects from the layer. The iteration obeys the spatial and the attribute filter.
Creates a new feature which has the schema of the layer and initializes it with data from the argument. Then inserts the feature into the layer (using CreateFeature). Uses Geo::OGR::Feature::Row or Geo::OGR::Feature::Tuple.
- Parameters:
-
Initialize the layer object for iterative reading.
Get and/or set the data of a feature that has the supplied feature id (the next feature obtained with GetNextFeature is used if feature id is not given). Calls Geo::OGR::Feature::Row.
- Parameters:
-
row | [optional] feature data |
- Returns:
- a reference to feature data in a hash
Get and/or set the schema of the layer.
- Parameters:
-
schema | The 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.
Set or clear the attribute filter.
- Parameters:
-
filter_string | a SQL WHERE clause or undef to clear the filter. |
- Note:
- The feature should have the same schema as the layer.
Replaces a feature in the layer based on the given feature's id. Requires RandomWrite capability.
- Parameters:
-
- Parameters:
-
fields | a list of field names |
- Parameters:
-
new_index | the index to which set the read cursor in the current iteration |
- Parameters:
-
filter | [optional] a Geo::OGR::Geometry object. If not given, removes the filter if there is one. |
- Parameters:
-
filter | [optional] a rectangle ($minx, $miny, $maxx, $maxy). |
- Returns:
- a new Geo::OGR::Geometry object
- Parameters:
-
- Returns:
- a boolean value indicating whether the layer has the specified capability.
Get and/set the data of a feature that has the supplied feature id (the next feature obtained with GetNextFeature is used if feature id is not given). The order of the data in the tuple is: feature id, Geometry, fields in their order. Calls Geo::OGR::Feature::Tuple.
- Parameters:
-
tuple | [optional] feature data |
- Note:
- The schema of the tuple needs to be the same as that of the layer.
- Returns:
- a reference to feature data in an array
Member Data Documentation
The documentation for this class was generated from the following file: