Services_OpenStreetMap

# Class: Services_OpenStreetMap_Way

Source Location: /OpenStreetMap/Way.php

### Class Overview

    Services_OpenStreetMap_Object
       |
       --Services_OpenStreetMap_Way

Services_OpenStreetMap_Way

#### Author(s):

- Ken Guest <kguest@php.net>

### Variables

- $dirtyNodes
- $nodes
- $nodesNew
- $type

### Methods

- addNode
- getAddress
- getNodes
- isClosed
- osmChangeXml
- removeNode

### Inherited Variables

#### Class: Services_OpenStreetMap_Object

Services_OpenStreetMap_Object::$action
Services_OpenStreetMap_Object::$changesetId
Services_OpenStreetMap_Object::$config
Services_OpenStreetMap_Object::$dirty
Services_OpenStreetMap_Object::$id
Services_OpenStreetMap_Object::$obj
Services_OpenStreetMap_Object::$tags
Services_OpenStreetMap_Object::$transport
Services_OpenStreetMap_Object::$xml

### Inherited Methods

#### Class: Services_OpenStreetMap_Object

Services_OpenStreetMap_Object::delete()
  Mark the object as deleted.
Services_OpenStreetMap_Object::getAttributes()
  Return the attributes set for this object in question.
Services_OpenStreetMap_Object::getConfig()
  Get current Config object
Services_OpenStreetMap_Object::getId()
  Retrieve the id of the object in question.
Services_OpenStreetMap_Object::getOsmChangeXml()
  Generate and return the OsmChange XML required to record the changes made to the object in question.
Services_OpenStreetMap_Object::getRelations()
  Get all relations referring to the object in question.
Services_OpenStreetMap_Object::getTag()
  Return value of specified tag as set against this object.
Services_OpenStreetMap_Object::getTags()
  Return the tags set for this object in question.
Services_OpenStreetMap_Object::getTransport()
  Retrieve the current Transport instance.
Services_OpenStreetMap_Object::getType()
  Return which type of object this is.
Services_OpenStreetMap_Object::getUid()
  Retrieve the uid of the object in question.
Services_OpenStreetMap_Object::getUser()
  Retrieve the user (creator/editor) of the object in question.
Services_OpenStreetMap_Object::getVersion()
  Retrieve the version of the object in question
Services_OpenStreetMap_Object::getXml()
  getXml
Services_OpenStreetMap_Object::history()
  Get each distinct version of an object.
Services_OpenStreetMap_Object::osmChangeXml()
  Amend changeXML with specific updates as appropriate.
Services_OpenStreetMap_Object::setChangesetId()
  Set the Changeset Id for this object.
Services_OpenStreetMap_Object::setConfig()
  Set Config object
Services_OpenStreetMap_Object::setId()
  Set the id value of the object in question.
Services_OpenStreetMap_Object::setTag()
  setTag
Services_OpenStreetMap_Object::setTags()
  Set a number of tags at once, using an associative array.
Services_OpenStreetMap_Object::setTransport()
  Set the Transport instance.
Services_OpenStreetMap_Object::setVal()
  Store a specified value.
Services_OpenStreetMap_Object::setXml()
  setXml
Services_OpenStreetMap_Object::__toString()
  If modified, return the osmChangeXML for the object, otherwise the defining XML.

### Class Details

[line 25]
Services_OpenStreetMap_Way

#### Tags:

author: | Ken Guest <kguest@php.net>
link: | Way.php
license: | BSD

[ Top ]

### Class Variables

#### $dirtyNodes = false

[line 30]

#### Tags:

access: | protected

Type: | mixed

[ Top ]

#### $nodes = array()

[line 28]

#### Tags:

access: | protected

Type: | mixed

[ Top ]

#### $nodesNew = array()

[line 29]

#### Tags:

access: | protected

Type: | mixed

[ Top ]

#### $type = 'way'

[line 27]

#### Tags:

access: | protected

Type: | mixed
Overrides: | Array

[ Top ]

### Class Methods

### method addNode [line 81]

`Services_OpenStreetMap_Way addNode( Services_OpenStreetMap_Node $node)`

Add a node to the way.

#### Tags:

access: | public

#### Parameters:

node | $node | An Services_OpenStreetMap_Node object.

[ Top ]

### method getAddress [line 181]

`array getAddress( )`

Return address [tags], as an array, if set on a closed way.

#### Tags:

access: | public

[ Top ]

### method getNodes [line 60]

`array getNodes( )`

Return an array containing the IDs of all nodes in the way.

#### Tags:

access: | public

[ Top ]

### method isClosed [line 37]

`boolean isClosed( )`

Return true if the way can be considered 'closed'.

#### Tags:

access: | public

[ Top ]

### method osmChangeXml [line 138]

`string osmChangeXml( string $xml)`

Amend osmChangeXml with specific updates pertinent to this Way object.

#### Tags:

see: | Services_OpenStreetMap_Object::getOsmChangeXml()
link: | http://wiki.openstreetmap.org/wiki/OsmChange
access: | public

Overrides Services_OpenStreetMap_Object::osmChangeXml() (Amend changeXML with specific updates as appropriate.)

#### Parameters:

string | $xml | OSM Change XML as generated by getOsmChangeXml

[ Top ]

### method removeNode [line 103]

`Services_OpenStreetMap_Way removeNode( node $node)`

Remove a node from the way.

#### Tags:

throws: | Services_OpenStreetMap_InvalidArgumentException
access: | public

#### Parameters:

node | $node | Either a Node object or an id/ref of such an object.

[ Top ]

Documentation generated on Wed, 26 Sep 2012 01:24:55 +0100 by phpDocumentor 1.4.4