Geo::OGR::Feature Class Reference

Inherits Geo::OGR.

Inheritance diagram for Geo::OGR::Feature:

Inheritance graph
[legend]
List of all members.

Public Class Methods

Geo::OGR::Feature new (scalar feature_def)
Geo::OGR::Feature create (hash schema)

Public Object Methods

hashref Schema (hash schema)
hashref Row (hash row)
list Tuple (list tuple)
Geo::OGR::FeatureDefn GetDefnRef ()
Geo::OGR::FieldDefn GetFieldDefnRef (scalar field)
scalar GetFieldType (scalar field)
 SetGeometry (scalar geometry)
scalar Geometry (scalar geometry)
scalar ReferenceGeometry (scalar geometry)
Geo::OGR::Feature Clone ()
scalar Equal (scalar feature)
scalar GetFieldIndex (scalar name)
scalar GetFieldCount ()
list GetField (scalar field)
 SetField (scalar field, list value)
 SetFrom (scalar other, scalar forgiving=1, hashref map)
scalar IsFieldSet (scalar field)
 UnsetField (scalar field)
scalar FID (scalar fid)
scalar GetFID ()
 SetFID (scalar fid)
 DumpReadable ()
scalar StyleString (scalar string)
scalar GetStyleString ()
 SetStyleString (scalar string)

Member Function Documentation

Geo::OGR::Feature Geo::OGR::Feature::Clone (  ) 

Returns:
a new Geo::OGR::Feature object

Geo::OGR::Feature Geo::OGR::Feature::create ( hash  schema  ) 

Parameters:
schema as in Schema
Returns:
a new Geo::OGR::Feature object

Geo::OGR::Feature::DumpReadable (  ) 

scalar Geo::OGR::Feature::Equal ( scalar  feature  ) 

Parameters:
feature a Geo::OGR::Feature object for comparison
Returns:
boolean

scalar Geo::OGR::Feature::FID ( scalar  fid  ) 

Parameters:
fid [optional] the id to set for this feature
Returns:
integer the id of this feature

scalar Geo::OGR::Feature::Geometry ( scalar  geometry  ) 

Set or get the geometry in the feature. When setting, does a check against the schema (GeometryType) of the feature.

Parameters:
geometry [optional] a Geo::OGR::Geometry object or data from which such can be created (using Geo::OGR::Geometry::create)
Returns:
a copy of the geometry in the feature as a Geo::OGR::Geometry object (in a non-void context)

Geo::OGR::FeatureDefn Geo::OGR::Feature::GetDefnRef (  ) 

Returns:
a new Geo::OGR::FeatureDefn object

scalar Geo::OGR::Feature::GetFID (  ) 

Returns:
integer the feature id

list Geo::OGR::Feature::GetField ( scalar  field  ) 

Note:
A number of GetFieldAs* methods exist but they are not documented. Syntax $feature->{field} can be used to access the field (v1.9.0)
Parameters:
field the name (or index) of the field
Returns:
the value of the field, which may be a scalar or a list, depending on the field type.

scalar Geo::OGR::Feature::GetFieldCount (  ) 

Returns:
an integer

Geo::OGR::FieldDefn Geo::OGR::Feature::GetFieldDefnRef ( scalar  field  ) 

Parameters:
field the name (or index) of the field
Returns:
a new Geo::OGR::FieldDefn object

scalar Geo::OGR::Feature::GetFieldIndex ( scalar  name  ) 

Parameters:
name the name of the field
Returns:
integer the index of the field (0..Count-1)

scalar Geo::OGR::Feature::GetFieldType ( scalar  field  ) 

Parameters:
field the name (or index) of the field
Returns:
one of field types

scalar Geo::OGR::Feature::GetStyleString (  ) 

Returns:
a string

scalar Geo::OGR::Feature::IsFieldSet ( scalar  field  ) 

Parameters:
field the name (or index) of the field
Returns:
boolean

Geo::OGR::Feature Geo::OGR::Feature::new ( scalar  feature_def  ) 

Parameters:
feature_def a Geo::OGR::FeatureDefn object
Returns:
a new Geo::OGR::Feature object

scalar Geo::OGR::Feature::ReferenceGeometry ( scalar  geometry  ) 

Create a new Geo::OGR::Geometry object, which references the geometry within the feature and/or create a reference to the argument geometry within the feature. This method maintains a link between the two objects and will not let the feature object be destroyed while the geometry object exists. Use with caution.

Note:
a.k.a. SetGeometryDirectly (only reference in), GetGeometry (only create with a reference), GetGeometryRef (only create with a reference and do not create the link between the objects).
Parameters:
geometry [optional] a Geo::OGR::Geometry object
Returns:
a new Geo::OGR::Geometry object in a non-void context

hashref Geo::OGR::Feature::Row ( hash  row  ) 

Note:
This method discards the data the destination feature (or layer) does not support. Changes in data due to differences between field types may also occur.
Get and/or set the data of the feature. The key of the (key,value) pairs of the row is the field name. Special field names FID and Geometry are used for feature id and geometry respectively. The geometry is set and get using the Geo::OGR::Feature::Geometry method. Field values are set using the Geo::OGR::Feature::SetField method.
Parameters:
row [optional] feature data in a hash
Returns:
a reference to feature data in a hash

hashref Geo::OGR::Feature::Schema ( hash  schema  ) 

Get or set the schema. The schema is a hash (Name => name, GeometryType => geometry_type, Fields => [list of Geo::OGR::FieldDefn objects or hashrefs from which such can be created]. The Name and GeometryType cannot be set and the Fields are added to the schema. Fields is an array of hashrefs that contain schemas of FieldDefns

Parameters:
schema [optional]
Returns:

Geo::OGR::Feature::SetFID ( scalar  fid  ) 

Parameters:
fid the feature id

Geo::OGR::Feature::SetField ( scalar  field,
list  value 
)

Note:
Syntax $feature->{field} can be used to access the field (v1.9.0)
Parameters:
field the name (or index) of the field
value is a string, integer, double, a list (year, month, day), a list (hour, minute, second, tzflag), a list (year, month, day, hour, minute, second, tzflag), or a list of integers, doubles, or strings.
Note:
If value is not given or is undefined this method unsets the field.

Geo::OGR::Feature::SetFrom ( scalar  other,
scalar  forgiving = 1,
hashref  map 
)

Parameters:
other a Geo::OGR::Feature object
forgiving [optional] set to false if the operation should not continue if output fields do not match some of the source fields
map [optional] a mapping from output field indexes to source fields, include into the hash all field indexes of this feature which should be set

Geo::OGR::Feature::SetGeometry ( scalar  geometry  ) 

Deprecated:
use Geometry, which accepts Perl data and checks the geometry type Copy geometry into this feature.
Parameters:
geometry a Geo::OGR::Geometry object

Geo::OGR::Feature::SetStyleString ( scalar  string  ) 

Parameters:
string 

scalar Geo::OGR::Feature::StyleString ( scalar  string  ) 

Parameters:
string [optional]
Returns:

list Geo::OGR::Feature::Tuple ( list  tuple  ) 

Note:
This method discards the data the destination feature (or layer) does not support. Changes in data due to differences between field types may also occur.

The schema of the tuple needs to be the same as that of the feature.

Get and/set the data of the feature. The order of the data in the tuple is: field_id, geometry, fields in their order. The geometry is set and get using the Geo::OGR::Feature::Geometry method. Field values are set using the Geo::OGR::Feature::SetField method.
Parameters:
tuple [optional] feature data in an array
Returns:
feature data in an array

Geo::OGR::Feature::UnsetField ( scalar  field  ) 

Note:
Field value can be unset by calling SetField without parameters or with an undefined argument.
Parameters:
field the name (or index) of the field


The documentation for this class was generated from the following file:
Generated on 26 May 2013 for Geo::GDAL by  doxygen 1.4.7