Geo::GDAL 1.9

Geo::OGR::Feature Class Reference

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 param)
scalar GetFieldType (scalar field)
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:
schemaas in Schema
Returns:
a new Geo::OGR::Feature object
Geo::OGR::Feature::DumpReadable ( )
scalar Geo::OGR::Feature::Equal ( scalar  feature)
Parameters:
featurea 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)

Get a copy of the geometry as a new Geo::OGR::Geometry object and/or copy the geometry into the feature.

Note:
a.k.a. SetGeometry (only copy into)
Parameters:
geometry[optional] a Geo::OGR::Geometry object
Returns:
a new 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:
fieldthe index (0..Count-1) or the name 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  param)
Parameters:
paramthe index (0..count-1) or the name of the field
Returns:
a new Geo::OGR::FieldDefn object
scalar Geo::OGR::Feature::GetFieldIndex ( scalar  name)
Parameters:
namethe name of the field
Returns:
integer the index of the field (0..Count-1)
scalar Geo::OGR::Feature::GetFieldType ( scalar  field)
Parameters:
fieldthe index (0..count-1) or the name of the field
Returns:
one of field types
scalar Geo::OGR::Feature::GetStyleString ( )
Returns:
a string
scalar Geo::OGR::Feature::IsFieldSet ( scalar  field)
Parameters:
fieldthe index (0..Count-1) or the name of the field
Returns:
boolean
Geo::OGR::Feature Geo::OGR::Feature::new ( scalar  feature_def)
Parameters:
feature_defa 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)

Get and/or set the data of the feature. The key of the key value, pairs of the row is the field name. Special names FID and Geometry are used for feature id and Geometry respectively. The geometry is a Geo::OGR::Geometry object whose data is or will become owned by the feature; or data from which a geometry object can be created (a hashref that is fed to Geo::OGR::Geometry::create). 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::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:
fidthe 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:
fieldthe index (0..Count-1) or the name of the field
valueis 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:
othera 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::SetStyleString ( scalar  string)
Parameters:
string
scalar Geo::OGR::Feature::StyleString ( scalar  string)
Parameters:
string[optional]
Returns:
list Geo::OGR::Feature::Tuple ( list  tuple)

Get and/set the data of the feature. The order of the data in the tuple is: FID, Geometry, fields in their order. The geometry is a Geo::OGR::Geometry object whose data is or will become owned by the feature; or data from which a geometry object can be created (a hashref that is fed to Geo::OGR::Geometry::create). It is ok to leave FID and Geometry undefined, they are set only if they are defined.

Parameters:
tuple[optional]
Returns:
Geo::OGR::Feature::UnsetField ( scalar  field)
Note:
Field value can be unset by calling SetField without parameters or with an undefined argument.
Parameters:
fieldthe index (0..Count-1) or the name of the field

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