Inherited by Geo::Vector::Layer.
Inheritance diagram for Geo::Vector:

Public Class Methods | |
| list | geometry_types () |
| Returns a list of valid geometry types. | |
| list | render_as_modes () |
| Returns a list of valid render as modes. | |
| ref hash | layers (scalar driver, scalar data_source) |
| Lists the layers that are available in a data source. | |
| void | delete_layer (scalar driver, scalar data_source, scalar layer) |
| Attempts to delete a layer from a datasource. | |
| Geo::Vector | new (scalar data_source) |
| Create a new Geo::Vector object for the first layer in a given OGR data souce. | |
| Geo::Vector | new (hash params) |
| Create a new Geo::Vector object. | |
Public Object Methods | |
| driver () | |
| The driver of the object. | |
| dump (hash parameters) | |
| Print the contents of the layer. | |
| init_iterate (hash options) | |
| Reset reading features from the object iteratively. | |
| next_feature () | |
| Return a feature iteratively or undef if no more features. | |
| get_next () | |
| scalar | buffer (hash params) |
| Create a new Geo::Vector object, whose features are buffer areas to the original. | |
| scalar | within (scalar other, hash params) |
| Return the features from this layer that are within the features of other. | |
| scalar | add (scalar other, hash params) |
| Add features from the other layer to this layer. | |
| scalar | feature_count () |
| Count the number of features in the layer. | |
| Geo::OSR::SpatialReference | srs (hash params) |
| Get or set (set is not yet implemented) the spatial reference system of the layer. | |
| scalar | field_count (hash params) |
| For a layer object returns the number of fields in the layer schema. For a feature set object requires a named parameter that specifies the feature. | |
| scalar | geometry_type (hash params) |
| For a layer object returns the geometry type of the layer. For a feature set object requires a named parameter that specifies the feature. | |
| hashref | schema (hashref schema) |
| Get or set the schema of the layer. | |
| hashref | schema (scalar feature, hashref schema) |
| Get or set the schema of a feature in a feature collection. | |
| Geo::OGR::FeatureDefn | defn () |
| Create a FeatureDefn object, which is needed to create feature objects for this layer. | |
| list | value_range (hash params) |
| Returns a list of the value range of the field. | |
| list | value_range (scalar field_name) |
| Returns a list of the value range of the field. | |
| hashref | feature (scalar fid, scalar feature) |
| Get, add or update a feature. | |
| Geo::OGR::Geometry | geometry (scalar fid, scalar geometry) |
| Get, set or add a geometry. | |
| Geo::OGR::Feature | make_feature (hash feature) |
| Creates a Geo::OGR::Feature object from attribute data and a Geo::OGC::Geometry object. | |
| void | add_feature (hash feature) |
| Adds a feature to the layer. | |
| listref | features (hash params) |
| Returns features satisfying the given requirement. | |
| list | world (hash params) |
| Get the bounding box (xmin, ymin, xmax, ymax) of the layer or one of its features. | |
| Geo::Vector | copy (hash params) |
| Copy selected or all features from the layer into a new layer. | |
| Geo::Raster | rasterize (hash params) |
| Creates a new Geo::Raster from this Geo::Vector object. | |
| void | overlay_graph (Gtk2::Gdk::Pixmap pixmap) |
| Creates from the objects graph an overlay graph (incl. vertices and edges) as a pixmap. | |
Public Functions | |
| retval | MIN () |
| retval | MAX () |
Classes | |
| class | Feature |
| class | Layer |
| class | Layer |
| class | Layer |
| class | Layer |
| class | Layer |
| class | Layer |
| class | Layer |
| class | Layer |
| class | Layer |
| class | Layer |
This module should be discussed in geo-perl@list.hut.fi.
The homepage of this module is http://geoinformatics.tkk.fi/twiki/bin/view/Main/GeoinformaticaSoftware.
Copyright (c) 2005- by Ari Jolma
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.
| scalar Geo::Vector::add | ( | scalar | other, | |
| hash | params | |||
| ) |
Add features from the other layer to this layer.
| other | A Geo::Vector object | |
| params | Named parameters, used for creating the new object, if one is created, and for iterating through the features of other. |
| void Geo::Vector::add_feature | ( | hash | feature | ) |
Adds a feature to the layer.
| feature | As in make_feature. |
| scalar Geo::Vector::buffer | ( | hash | params | ) |
Create a new Geo::Vector object, whose features are buffer areas to the original.
| [in] | params | Named parameters: (see also the named parameters of Geo::Vector::new).
|
| Geo::Vector Geo::Vector::copy | ( | hash | params | ) |
Copy selected or all features from the layer into a new layer.
| [in] | params | is a list of named parameters. They are forwarded to constructor (new) and init_iterate. If no value is given the defaults are taken from this layer. |
| Geo::OGR::FeatureDefn Geo::Vector::defn | ( | ) |
Create a FeatureDefn object, which is needed to create feature objects for this layer.
| void Geo::Vector::delete_layer | ( | scalar | driver, | |
| scalar | data_source, | |||
| scalar | layer | |||
| ) |
Attempts to delete a layer from a datasource.
| [in] | driver | |
| [in] | data_source | |
| [in] | layer | Name of the layer that should be deleted. |
| Geo::Vector::driver | ( | ) |
| Geo::Vector::dump | ( | hash | parameters | ) |
Print the contents of the layer.
| hashref Geo::Vector::feature | ( | scalar | fid, | |
| scalar | feature | |||
| ) |
Get, add or update a feature.
Example of retrieving:
$feature = $vector->feature($i);
Example of updating:
$vector->feature($i, $feature);
Example of adding:
$vector->feature($feature);
| [in] | fid | The FID of the feature if updating |
| [in] | feature | Geo::OGR::Feature object to add or to update. |
| The | fid is higher than the feature count. |
| scalar Geo::Vector::feature_count | ( | ) |
Count the number of features in the layer.
| listref Geo::Vector::features | ( | hash | params | ) |
Returns features satisfying the given requirement.
| [in] | params | is a list named parameters
|
| scalar Geo::Vector::field_count | ( | hash | params | ) |
For a layer object returns the number of fields in the layer schema. For a feature set object requires a named parameter that specifies the feature.
Each feature in a feature set object may have its own schema.
| Geo::OGR::Geometry Geo::Vector::geometry | ( | scalar | fid, | |
| scalar | geometry | |||
| ) |
Get, set or add a geometry.
| $fid | (optional) The feature id, whose geometry to set or get. | |
| $geometry | (optional) The geometry, which to set or add. |
| scalar Geo::Vector::geometry_type | ( | hash | params | ) |
For a layer object returns the geometry type of the layer. For a feature set object requires a named parameter that specifies the feature.
| [in] | params | Named parameters:
|
| list Geo::Vector::geometry_types | ( | ) |
Returns a list of valid geometry types.
| Geo::Vector::get_next | ( | ) |
| Geo::Vector::init_iterate | ( | hash | options | ) |
Reset reading features from the object iteratively.
| options | Named parameters, all are optional.
|
| ref hash Geo::Vector::layers | ( | scalar | driver, | |
| scalar | data_source | |||
| ) |
Lists the layers that are available in a data source.
| Geo::OGR::Feature Geo::Vector::make_feature | ( | hash | feature | ) |
Creates a Geo::OGR::Feature object from attribute data and a Geo::OGC::Geometry object.
| [in] | feature | a hash whose keys are field names or 'geometry' and values are field values, or, for geometry, well-known text or an object which responds to AsText method by returning well-known text. |
| retval Geo::Vector::MAX | ( | ) |
| retval Geo::Vector::MIN | ( | ) |
| Geo::Vector Geo::Vector::new | ( | hash | params | ) |
Create a new Geo::Vector object.
A Geo::Vector object is either a wrapped Geo::OGR::Layer or a collection of Geo::OGR::Feature objects. Without any parameters an empty OGR memory layer without any attributes is created. A feature collection object does not have a unique schema.
| params | Named parameters, all are optional: (see also the named parameters of the Geo::Vector::layer method)
|
| Geo::Vector Geo::Vector::new | ( | scalar | data_source | ) |
Create a new Geo::Vector object for the first layer in a given OGR data souce.
An example of creating a Geo::Vector object for a ESRI shapefile:
$v = Geo::Vector->new("borders.shp");
| data_source | An OGR data source string |
| Geo::Vector::next_feature | ( | ) |
Return a feature iteratively or undef if no more features.
| void Geo::Vector::overlay_graph | ( | Gtk2::Gdk::Pixmap | pixmap | ) |
Creates from the objects graph an overlay graph (incl. vertices and edges) as a pixmap.
| [in,out] | pixmap | Gtk2::Gdk::Pixmap |
| Geo::Raster Geo::Vector::rasterize | ( | hash | params | ) |
Creates a new Geo::Raster from this Geo::Vector object.
The new Geo::Raster has the size and extent of the Geo::Raster $this and draws the layer on it. The raster is boolean integer raster unless value_field is given. If value_field is floating point value, the returned raster is a floating point raster. render_as hash is optional, but if given should be one of 'Native', 'Points', 'Lines', or 'Polygons'. $fid (optional) is the number of the feature to render.
| [in] | params | is a list of named parameters:
|
| list Geo::Vector::render_as_modes | ( | ) |
Returns a list of valid render as modes.
| hashref Geo::Vector::schema | ( | scalar | feature, | |
| hashref | schema | |||
| ) |
Get or set the schema of a feature in a feature collection.
| [in] | feature | the index of the feature, whose schema to get or set. |
| [in] | schema | (optional) a reference to a hash specifying the schema. |
| hashref Geo::Vector::schema | ( | hashref | schema | ) |
Get or set the schema of the layer.
Schema is a hash whose keyes are GeometryType, FID, and Fields. Fields is a reference to a list of field schemas. A field schema is a hash whose keys are Name, Type, Justify, Width, and Precision. This is similar to schemas in Geo::OGR.
| [in] | schema | (optional) a reference to a hash specifying the schema. |
| Geo::OSR::SpatialReference Geo::Vector::srs | ( | hash | params | ) |
Get or set (set is not yet implemented) the spatial reference system of the layer.
SRS (Spatial reference system) is a geographic coordinate system code number in the EPSG database (European Petroleum Survey Group, http://www.epsg.org/). Default value is 4326, which is for WGS84.
| [in] | params | (optional) Named parameters:
|
| list Geo::Vector::value_range | ( | scalar | field_name | ) |
Returns a list of the value range of the field.
| [in] | field_name | The name of the field, whose min and max values are looked up. |
| list Geo::Vector::value_range | ( | hash | params | ) |
Returns a list of the value range of the field.
| [in] | params | Named parameters:
|
| scalar Geo::Vector::within | ( | scalar | other, | |
| hash | params | |||
| ) |
Return the features from this layer that are within the features of other.
| list Geo::Vector::world | ( | hash | params | ) |
Get the bounding box (xmin, ymin, xmax, ymax) of the layer or one of its features.
The method uses Geo::OGR::Geometry::GetEnvelope() or Geo::OGR::Layer::GetExtent().
Example of getting a bounding box:
@bb = $vector->world(feature=><feature_index>);
| [in] | params | is a list of named parameters:
|
1.4.7