Services_OpenStreetMap
[ class tree: Services_OpenStreetMap ] [ index: Services_OpenStreetMap ] [ all elements ]

Class: Services_OpenStreetMap_API_V06

Source Location: /Services_OpenStreetMap-1.0.0RC2/Services/OpenStreetMap/API/V06.php

Class Overview


Services_OpenStreetMap_API_V06


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 25]
Services_OpenStreetMap_API_V06


[ Top ]


Class Variables

=

[line 35]

  • Access: protected

Type:   mixed


[ Top ]

=

[line 35]

  • Access: protected

Type:   mixed


[ Top ]

$config =  null

[line 49]

Config object, contains setting on how to interact with API Endpoint
  • Access: protected



[ Top ]

$elements =  ['changeset'

[line 35]

Elements supported by the API (v0.6).

Used for validation purposes.

  • Access: protected

Type:   array


[ Top ]

$newId =  -1

[line 58]

Counter for assigning IDs to [newly] created objects.
  • Access: protected

Type:   int


[ Top ]

$transport =  null

[line 42]

Transport
  • Access: protected



[ Top ]



Method Detail

createChangeset   [line 189]

Services_OpenStreetMap_Changeset createChangeset( [bool $atomic = true])

Create a changeset.

Used to transmit changes (creation, updates, deletion) to the server. Username and password must be set.

  1.  $config = array('user' => 'fred@example.net''password' => 'wilma4eva');
  2.  $osm = new Services_OpenStreetMap($config);
  3.  $changeset $osm->createChangeset();


Parameters:

boolean   $atomic   —  atomic changeset?

[ Top ]

createNode   [line 240]

Services_OpenStreetMap_Node createNode( float $latitude, float $longitude, [array $tags = []])

Create and return a Services_OpenStreetMap_Node

Latitude and longitude must be specified, array of tags optional.

  1.  $node $osm->createNode($lat$lonarray('building' => 'yes'));

  • Access: public

Parameters:

float   $latitude   —  Latitude of node
float   $longitude   —  Longitude of node
array   $tags   —  Array of key->value tag pairs.

[ Top ]

getChangeset   [line 165]

Services_OpenStreetMap_Object getChangeset( string $id, [string $version = null])

Get details of specified changeset.

Optionally specify version of the changeset.

  1.  $changeset $osm->getChangeset(123456);

  • Throws: Services_OpenStreetMap_Exception
  • Access: public

Parameters:

string   $id   —  numeric ID of changeset
string   $version   —  optional

[ Top ]

getConfig   [line 79]

Services_OpenStreetMap_Config|null getConfig( )

Get current Config object
  • Access: public

[ Top ]

getNode   [line 462]

Services_OpenStreetMap_Node|false getNode( string $nodeID, [mixed $version = null])

Get details of specified node.

Optionally, version of the node can be specified also.

  1.  $osm = new Services_OpenStreetMap();
  2.  var_dump($osm->getNode(52245107));

  • Throws: Services_OpenStreetMap_Exception
  • Access: public

Parameters:

string   $nodeID   —  nodeID
mixed   $version   —  [optional] version of node

[ Top ]

getNodes   [line 492]

Services_OpenStreetMap_Nodes getNodes( )

Return an array of specified nodes.

If none can be retrieved, for example if they all have been deleted, then the boolean false value is returned.

  1.  $osm = new Services_OpenStreetMap();
  2.  var_dump($osm->getNodes(5224510752245108));
Or
  1.  $osm = new Services_OpenStreetMap();
  2.  var_dump($osm->getNodes(array(5224510752245108)));

  • Access: public

[ Top ]

getNotesByBbox   [line 516]

Services_OpenStreetMap_Notes getNotesByBbox( string $minLon, string $minLat, string $maxLon, string $maxLat, [int $limit = 100], [int $closed = 7])

Retrieve bug data by bounding box.
  • Throws: Services_OpenStreetMap_Exception
  • Throws: HTTP_Request2_Exception
  • Access: public

Parameters:

string   $minLon   —  Min Longitude (leftmost point)
string   $minLat   —  Min Latitude (bottom point)
string   $maxLon   —  Max Longitude (rightmost point)
string   $maxLat   —  Max Latitude (top point)
integer   $limit   —  Number of entries to return at max, defaults to 100
integer   $closed   —  Number of days a bug needs to be closed to not be included in the returned dataset. 0 means only open bugs are returned, -1 means all are. Defaults to 7.

[ Top ]

getNotesBySearch   [line 561]

Services_OpenStreetMap_Notes getNotesBySearch( string $searchTerm, [int $limit = 100], [int $closed = 7], [string $displayName = ''], [int $user = 0], [string $from = ''], [string $to = ''])

Retrieve bug data by search.
  • Throws: Services_OpenStreetMap_Exception
  • Throws: HTTP_Request2_Exception
  • Access: public

Parameters:

string   $searchTerm   —  Term(s) to search on
int   $limit   —  Number of entries to return at max, defaults to 100
int   $closed   —  Number of days a bug needs to be closed to not be included in the returned dataset. 0 means only open bugs are returned, -1 means all are. Defaults to 7.
string   $displayName   —  Display-name of the creator of the returned notes. Does not work together with the user parameter
int   $user   —  Valid user id
string   $from   —  Start date in which to search notes within
string   $to   —  End date in which to search notes within. Defaults to current date

[ Top ]

getPermissions   [line 615]

array|false getPermissions( )

Return array of granted permissions.

The return array may be empty if authorisation failed.

  • allow_read_prefs (read user preferences)
  • allow_write_prefs (modify user preferences)
  • allow_write_diary (create diary entries, comments and make friends)
  • allow_write_api (modify the map)
  • allow_read_gpx (read private GPS traces)
  • allow_write_gpx (upload GPS traces)

  • Throws: Services_OpenStreetMap_Exception
  • Throws: HTTP_Request2_Exception
  • Access: public

[ Top ]

getRelation   [line 124]

Services_OpenStreetMap_Object getRelation( mixed $relationID, [mixed $version = null])

Get details of specified relation.

Optionally specify which version of the relation to be retrieved.

  1.  $r $osm->getRelation(1234567);
  2.  $r $osm->getRelation(12345672);

  • Throws: Services_OpenStreetMap_Exception
  • Access: public

Parameters:

mixed   $relationID   —  ID of relation
mixed   $version   —  [optional] version of relation

[ Top ]

getRelations   [line 142]

Services_OpenStreetMap_Objects getRelations( )

Return an array of specified relations.

Call with relation ids as parameters.

  1.  $relations $osm->getRelations($relationId$relation2Id);

  • Access: public

[ Top ]

getTransport   [line 103]

Services_OpenStreetMap_Transport. getTransport( )

Retrieve the current Transport instance.
  • Access: public

[ Top ]

getUser   [line 284]

Services_OpenStreetMap_User|false getUser( )

Get a Services_OpenStreetMap_User object for the [current] user.

May return false if the user could not be found for any reason.


[ Top ]

getUserById   [line 353]

Services_OpenStreetMap_User|false getUserById( int $id)

Get a Services_OpenStreetMap_User object for the specified user.

May return false if the user could not be found for any reason.


Parameters:

integer   $id   —  User Id.

[ Top ]

getWay   [line 390]

Services_OpenStreetMap_Object getWay( mixed $wayID, [mixed $version = null])

Get details of specified way
  • Throws: Services_OpenStreetMap_Exception
  • Access: public

Parameters:

mixed   $wayID   —  wayID
mixed   $version   —  [optional] version of way

[ Top ]

getWayFull   [line 412]

Services_OpenStreetMap_Way getWayFull( mixed $wayID, mixed $version)

Get way plus full XML of all nodes referenced by it.

API call retrieves a way or relation and all other elements referenced by it

  • Throws: Services_OpenStreetMap_Exception
  • Access: public

Parameters:

mixed   $wayID   —  wayID
mixed   $version   —  Version of way

[ Top ]

getWays   [line 438]

Services_OpenStreetMap_Ways getWays( )

Return an array of specified ways.

Any number of ways can be specified.

  1.  $ways $osm->getWays($wayId$way2Id);

  • Access: public

[ Top ]

searchChangesets   [line 206]

Services_OpenStreetMap_Changesets searchChangesets( array $criteria)

Search changesets for specified criteria.
  • Throws: Services_OpenStreetMap_RuntimeException
  • Access: public

Parameters:

array   $criteria   —  Array of Services_OpenStreetMap_Criterion objects.

[ Top ]

setConfig   [line 67]

Services_OpenStreetMap_API_V06 setConfig( Services_OpenStreetMap_Config $config)

Set Config object
  • Access: public

Parameters:

Services_OpenStreetMap_Config   $config   —  Config object.

[ Top ]

setTransport   [line 91]

Services_OpenStreetMap_API_V06 setTransport( Services_OpenStreetMap_Transport $transport)

Set the Transport instance.
  • Access: public

Parameters:

Services_OpenStreetMap_Transport   $transport   —  Transport instance.

[ Top ]


Documentation generated on Tue, 28 May 2019 19:19:08 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.