Geo::GDAL  2.0
Geo::OGR::Feature Class Reference

A collection of non-spatial and spatial attributes. More...

+ Inheritance diagram for Geo::OGR::Feature:
+ Collaboration diagram for Geo::OGR::Feature:

Public Member Functions

public Geo::OGR::Feature Clone ()
 
public method DumpReadable ()
 
public scalar Equal (scalar feature)
 
public scalar FID (scalar id)
 Get or set the id of this feature. More...
 
public method Field (scalar name, array Value)
 Get or set the field. More...
 
public method FillUnsetWithDefault ()
 
public scalar Geometry (scalar name, scalar geometry)
 Get or set the value of a geometry field. More...
 
public Geo::OGR::FeatureDefn GetDefn ()
 
public scalar GetFID ()
 
public list GetField (scalar name)
 
public method GetFieldAsBinary ()
 
public method GetFieldAsInteger64 ()
 
public Geo::OGR::FieldDefn GetFieldDefn (scalar name)
 
public list GetFieldNames ()
 
public hash reference GetSchema ()
 Get the schema of this feature. More...
 
public scalar GetStyleString ()
 
public scalar IsFieldSet (scalar field)
 
public hash reference Row (hash row)
 
public method SetFID (scalar id)
 
public method SetField (scalar name, array Value)
 
public method SetFieldBinaryFromHexString ()
 
public method SetFieldInteger64 ()
 
public method SetFrom (scalar other, scalar forgiving=1, hashref map)
 
public method SetStyleString (scalar string)
 
public list Tuple (array tuple)
 
public method UnsetField (scalar field)
 
public scalar Validate (list flags)
 
public Geo::OGR::Feature new (hash schema)
 
- Public Member Functions inherited from Geo::OGR
public list ByteOrders ()
 
public scalar GeometryTypeModify (scalar type, scalar modifier)
 
public scalar GeometryTypeTest (scalar type, scalar test, scalar type2)
 
public list GeometryTypes ()
 
public Geo::OGR::Driver GetDriver (scalar name)
 
public list GetDriverNames ()
 
public method GetNonLinearGeometriesEnabledFlag ()
 
public Geo::OGR::DataSource GetOpenDS (scalar number)
 
public scalar GetOpenDSCount ()
 
public method OLMD_FID64 ()
 
public Geo::OGR::DataSource Open (scalar name, scalar update=0)
 
public Geo::OGR::DataSource OpenShared (scalar name, scalar update=0)
 
public method SetGenerate_DB2_V72_BYTE_ORDER (scalar Generate_DB2_V72_BYTE_ORDER)
 
public method SetNonLinearGeometriesEnabledFlag ()
 

Detailed Description

A collection of non-spatial and spatial attributes.

A feature is a collection of non-spatial and spatial attributes and an id, which is a special attribute, and data records according to this data model. Attributes are called fields and some fields are spatial, i.e., their value is a geometry. Fields have at least a name and a type. Features may exist within a layer or separetely. The data model of a feature is a definition object.

Definition at line 6542 of file all.pm.

Member Function Documentation

public Geo::OGR::Feature Geo::OGR::Feature::Clone ( )
Returns
a new Geo::OGR::Feature object
Code:
click to view
public method Geo::OGR::Feature::DumpReadable ( )

Write the contents of this feature to stdout.

Code:
click to view
public scalar Geo::OGR::Feature::Equal ( scalar  feature)
Parameters
featurea Geo::OGR::Feature object for comparison
Returns
boolean
Code:
click to view
public scalar Geo::OGR::Feature::FID ( scalar  id)

Get or set the id of this feature.

Parameters
id[optional] the id to set for this feature.
Returns
integer the id of this feature.
Code:
click to view
public method Geo::OGR::Feature::Field ( scalar  name,
array  Value 
)

Get or set the field.

Parameters
namethe name of the field.
Valuea scalar or list depending on the field type.
Returns
the value of the field, which may be a scalar or a list, depending on the field type.
Code:
click to view
public method Geo::OGR::Feature::FillUnsetWithDefault ( )
Code:
click to view
public scalar Geo::OGR::Feature::Geometry ( scalar  name,
scalar  geometry 
)

Get or set the value of a geometry field.

Note
This method delivers the functionality of undocumented methods SetGeometry($geometry), SetGeometryDirectly, SetGeomField, SetGeomFieldDirectly, GetGeometry, GetGeometryRef.

Set or get the geometry in the feature. When setting, does a check against the schema (GeometryType) of the feature. The ownership of the geometry is given (if the parameter is an object) or kept to the feature and thus the geometry will keep the feature alive as long as the geometry is alive.

Parameters
name[optional] the name of the spatial field, whose geometry is to be set. If not given, sets or gets the geometry of the first spatial field.
geometry[optional] a Geo::OGR::Geometry object or a hash array from which such can be created (using Geo::OGR::Geometry::new)
Returns
in a non-void context the geometry in the feature as a Geo::OGR::Geometry object.
Code:
click to view
public Geo::OGR::FeatureDefn Geo::OGR::Feature::GetDefn ( )
Note
A.k.a GetDefnRef.
Returns
a Geo::OGR::FeatureDefn object, which represents the definition of this feature.
Code:
click to view
public scalar Geo::OGR::Feature::GetFID ( )
Returns
the feature id (an integer).
Code:
click to view
public list Geo::OGR::Feature::GetField ( scalar  name)
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
namethe name of the field
Returns
the value of the field, which may be a scalar or a list, depending on the field type.
Code:
click to view
public method Geo::OGR::Feature::GetFieldAsBinary ( )
Code:
click to view
public method Geo::OGR::Feature::GetFieldAsInteger64 ( )
Code:
click to view
public Geo::OGR::FieldDefn Geo::OGR::Feature::GetFieldDefn ( scalar  name)
Note
A.k.a GetFieldDefnRef
Parameters
namethe name of the field.
Returns
a new Geo::OGR::FieldDefn object that represents the field in question.
Code:
click to view
public list Geo::OGR::Feature::GetFieldNames ( )

Get the names of the fields in this feature.

Code:
click to view
public hash reference Geo::OGR::Feature::GetSchema ( )

Get the schema of this feature.

Returns
the schema of this layer, as in Geo::OGR::FeatureDefn::Schema.
Code:
click to view
public scalar Geo::OGR::Feature::GetStyleString ( )
Returns
a string
Code:
click to view
public scalar Geo::OGR::Feature::IsFieldSet ( scalar  field)
Parameters
fieldthe name (or index) of the field
Returns
boolean
Code:
click to view
public Geo::OGR::Feature Geo::OGR::Feature::new ( hash  schema)

Class method.

Parameters
schemaas in Schema
Returns
a new Geo::OGR::Feature object
Code:
click to view
public hash reference 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. Spatial fields are returned as Geo::OGR::Geometry objects.
Code:
click to view
public method Geo::OGR::Feature::SetFID ( scalar  id)
Parameters
idthe feature id.
Code:
click to view
public method Geo::OGR::Feature::SetField ( scalar  name,
array  Value 
)
Note
Syntax $feature->{field} can be used to access the field (v1.9.0)
Parameters
namethe name of the field.
Valuea 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.
Code:
click to view
public method Geo::OGR::Feature::SetFieldBinaryFromHexString ( )
Code:
click to view
public method Geo::OGR::Feature::SetFieldInteger64 ( )
Code:
click to view
public method 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
Code:
click to view
public method Geo::OGR::Feature::SetStyleString ( scalar  string)
Parameters
string
Code:
click to view
public list Geo::OGR::Feature::Tuple ( array  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 expected data in the tuple is ([feature_id,] non-spatial fields, spatial fields). The fields in the order they are in the schema. Field values are set using the Geo::OGR::Feature::Field method. Geometries are set and get using the Geo::OGR::Feature::Geometry method.

Parameters
tuple[optional] feature data in an array
Returns
feature data in an array
Code:
click to view
public method Geo::OGR::Feature::UnsetField ( scalar  field)
Note
Field value can be unset by calling SetField without parameters or with an undefined argument.
Parameters
fieldthe name (or index) of the field
Code:
click to view
public scalar Geo::OGR::Feature::Validate ( list  flags)
Parameters
flagsone of more of null, geom_type, width, allow_null_when_default, or all.
Exceptions
croakswith an error message if the feature is not valid.
Returns
integer denoting the validity of the feature object.
Code:
click to view

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