NAME

OSM::Tree::Way -- OSM Way

SYNOPSIS

DESCRIPTION

the Way-Object derived from OSM::Tree::BASE

AUTHOR

ToPeG

METHODS

center()

get the center of this way

returns a longitude,latitude pair

or undef,undef if the way has no Nodes

Example:

 my ($lon,$lat)= $way->center();
length()

get the lenth of this way

returns the length

Example:

 my $length= $way->length();
bbox()

get the Boundary box of this way

returns (lonmin,latmin,lonmax,latmax)

Example:

 my ($lonin,$latmin)= $way->bbox();
node(ID)

get a node-object corresponding to the ID and this way

see OSM::Tree::Node for more

return a node-object or undef if the ID not exists in this way

node_add([NodeID | <NODE> | <HASH>], <POS>)

add a node to the NodeList

see OSM::Tree::node_add() for more

return 1 on success

node_add_append(NodeID | <NODE> | <HASH>)

add a node to the NodeList

see OSM::Tree::node_add() for more

return 1 on success

node_add_after([NodeID | <NODE> | <HASH>], <node>)

add a node to the NodeList after the defined Node or NodeId

see OSM::Tree::node_add() for more

return 1 on success

node_add_bevor([NodeID | <NODE> | <HASH>], <node>)

add a node to the NodeList after the defined Node or NodeId

see OSM::Tree::node_add() for more

return 1 on success

node_del(ID)

delete a node from the NodeList return 1 on success

node_list(<CODE>)

get a list of all node-objects corresponding to this way if an coderefence is given it will use as filter.

see OSM::Tree::Node for more

returns a list of node-objects or an empty list if there are no nodes

node_id_list()

get a list of all node-IDs corresponding to this way

returns a list of node-IDs or an empty list if there are no node-IDs

node_id_add(ID,<POS>)

delete a node ID from the Node_list

return 1 on succcess

node_id_del(ID)

delete node by id

return 1 on succcess

node_list_length()

get the length the list of all nodes

returns the length of the node-list

node_exists(ID)

get the length the list of all nodes

returns the length of the node-list

polygon(<OPTIONS>)

make OSM::Tree::Polygon Object from this way

returns undef or an OSM::Tree::Polygon Object

if OSM::Tree::Polygon is not loadable (As example Math::Polygon is not einstalled ) this Method returns undef.

see: OSM::Tree::Polygon

See also

OSM::Tree::BASE

OSM::Tree::Node

OSM::Tree::Way

OSM::Tree::Relation

OSM::Tree::TagList

OSM::Tree::Polygon

OSM::Tree