Inheritance diagram for Geo::OGR::Layer:
Public Class Methods | |
list | Capabilities () |
Public Object Methods | |
scalar | TestCapability (scalar cap) |
Geo::OGR::DataSource | DataSource () |
hash | GetField (scalar field_name) |
CreateField (hash parameters) | |
CreateField (scalar field_definition, scalar approximation_ok) | |
AlterField (scalar field_name, hash new_definition) | |
AlterFieldDefn (scalar field, scalar definition, scalar flags) | |
DeleteField (scalar field) | |
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 () |
ForFeatures (scalar code, scalar in_place) | |
ForGeometries (scalar code, scalar in_place) | |
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) |
list | GetExtent (scalar force=1) |
StartTransaction () | |
CommitTransaction () | |
RollbackTransaction () | |
Geo::OSR::SpatialReference | GetSpatialRef () |
scalar | GetFIDColumn () |
scalar | GetGeometryColumn () |
scalar | GeometryType () |
SetIgnoredFields (list fields) | |
Public Attributes | |
list | CAPABILITIES |
Geo::OGR::Layer::AlterField | ( | scalar | field_name, | |
hash | new_definition | |||
) |
field_name | the name (or index) of the field to be altered | |
new_definition | one or more of Name, Type, and Width |
Geo::OGR::Layer::AlterFieldDefn | ( | scalar | field, | |
scalar | definition, | |||
scalar | flags | |||
) |
field | index of the field whose definition is altered | |
definition | a Geo::OGR::FieldDefn object | |
flags | 1 to alter the name, 2 to alter the type, 4 to alter the width, use combinations 3, 5, 6 or 7 to alter two or more properties |
list Geo::OGR::Layer::Capabilities | ( | ) |
Examples:
@cap = Geo::OGR::Layer::Capabilities(); # the class method @cap = $layer->Capabilities(); # the object method
Geo::OGR::Layer::CommitTransaction | ( | ) |
Geo::OGR::Layer::CreateFeature | ( | scalar | feature | ) |
feature | a Geo::OGR::Feature object |
Geo::OGR::Layer::CreateField | ( | scalar | field_definition, | |
scalar | approximation_ok | |||
) |
field_definition | a Geo::OGR::FieldDefn object | |
approximation_ok | may the field be created in a slightly different form depending on the limitations of the format driver. |
Geo::OGR::Layer::CreateField | ( | hash | parameters | ) |
parameters | named parameters: Name, Type, Justify, Width, Precision |
Geo::OGR::DataSource Geo::OGR::Layer::DataSource | ( | ) |
Geo::OGR::Layer::DeleteFeature | ( | scalar | fid | ) |
fid | feature id |
Geo::OGR::Layer::DeleteField | ( | scalar | field | ) |
Delete an existing field from a layer.
field | name (or index) of the field which is deleted |
Geo::OGR::Layer::ForFeatures | ( | scalar | code, | |
scalar | in_place | |||
) |
Example usage:
$layer->ForFeatures(sub {my $f = shift; $self->DeleteFeature($f->FID)}); # empties the layer
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 |
Geo::OGR::Layer::ForGeometries | ( | scalar | code, | |
scalar | in_place | |||
) |
Example usage:
my $area = 0; $layer->ForGeometries(sub {my $g = shift; $area += $g->Area}); # computes the total area
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 |
scalar Geo::OGR::Layer::GeometryType | ( | ) |
list Geo::OGR::Layer::GetExtent | ( | scalar | force = 1 |
) |
force | compute the extent even if it is expensive |
The order of values is different from those returned by Geo::OGR::Geometry::GetEnvelope.
Geo::OGR::Feature Geo::OGR::Layer::GetFeature | ( | scalar | fid | ) |
scalar Geo::OGR::Layer::GetFeatureCount | ( | scalar | force = 1 |
) |
force |
scalar Geo::OGR::Layer::GetFeaturesRead | ( | ) |
scalar Geo::OGR::Layer::GetFIDColumn | ( | ) |
hash Geo::OGR::Layer::GetField | ( | scalar | field_name | ) |
field_name | the name (or index) of the field |
scalar Geo::OGR::Layer::GetGeometryColumn | ( | ) |
Geo::OGR::FeatureDefn Geo::OGR::Layer::GetLayerDefn | ( | ) |
scalar Geo::OGR::Layer::GetName | ( | ) |
Geo::OGR::Feature Geo::OGR::Layer::GetNextFeature | ( | ) |
Geo::OGR::Geometry Geo::OGR::Layer::GetSpatialFilter | ( | ) |
Geo::OSR::SpatialReference Geo::OGR::Layer::GetSpatialRef | ( | ) |
Geo::OGR::Layer::InsertFeature | ( | scalar | feature | ) |
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.
feature | a Geo::OGR::Feature object or reference to feature data in a hash (as in Geo::OGR::Feature::Row) or in an array (as in Geo::OGR::Feature::Tuple) |
Geo::OGR::Layer::ResetReading | ( | ) |
Initialize the layer object for iterative reading.
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 (the next feature obtained with GetNextFeature is used if feature id is not given). Calls Geo::OGR::Feature::Row.
row | [optional] feature data |
hashref Geo::OGR::Layer::Schema | ( | hash | schema | ) |
Get and/or set the schema of the layer.
schema | The schema hash may contain the keys:
|
Geo::OGR::Layer::SetAttributeFilter | ( | scalar | filter_string | ) |
Set or clear the attribute filter.
filter_string | a SQL WHERE clause or undef to clear the filter. |
Geo::OGR::Layer::SetFeature | ( | scalar | feature | ) |
feature | a Geo::OGR::Feature object |
Geo::OGR::Layer::SetIgnoredFields | ( | list | fields | ) |
fields | a list of field names |
Geo::OGR::Layer::SetNextByIndex | ( | scalar | new_index | ) |
new_index | the index to which set the read cursor in the current iteration |
Geo::OGR::Layer::SetSpatialFilter | ( | scalar | filter | ) |
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 | |||
) |
minx | ||
miny | ||
maxx | ||
maxy |
Geo::OGR::Geometry Geo::OGR::Layer::SpatialFilter | ( | list | filter | ) |
filter | [optional] a rectangle ($minx, $miny, $maxx, $maxy). |
Geo::OGR::Geometry Geo::OGR::Layer::SpatialFilter | ( | scalar | filter | ) |
filter | [optional] a Geo::OGR::Geometry object or a string. An undefined value removes the filter if there is one. |
Geo::OGR::Layer::StartTransaction | ( | ) |
Geo::OGR::Layer::SyncToDisk | ( | ) |
scalar Geo::OGR::Layer::TestCapability | ( | scalar | cap | ) |
cap | A capability string. |
list Geo::OGR::Layer::Tuple | ( | list | tuple | ) |
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.
tuple | [optional] feature data |