class JOpenstreetmapElements extends JOpenstreetmapObject

Openstreetmap API Elements class for the Joomla Platform

Methods

__construct( Registry $options = null, JHttp $client = null, JOpenstreetmapOauth $oauth = null)

Constructor

mixed
getOption( string $key)

Get an option from the JOpenstreetmapObject instance.

setOption( string $key, mixed $value)

Set an option for the JOpenstreetmapObject instance.

sendRequest( string $path, string $method = 'GET', array $headers = array(), mixed $data = '')

Method to send the request which does not require authentication.

array
createNode( integer $changeset, float $latitude, float $longitude, array $tags)

Method to create a node

array
createWay( integer $changeset, array $tags, array $nds)

Method to create a way

array
createRelation( integer $changeset, array $tags, array $members)

Method to create a relation

array
readElement( string $element, integer $id)

Method to read an element [node|way|relation]

array
updateElement( string $element, string $xml, integer $id)

Method to update an Element [node|way|relation]

array
deleteElement( string $element, integer $id, integer $version, integer $changeset, float $latitude = null, float $longitude = null)

Method to delete an element [node|way|relation]

array
historyOfElement( string $element, integer $id)

Method to get history of an element [node|way|relation]

array
versionOfElement( string $element, integer $id, integer $version)

Method to get details about a version of an element [node|way|relation]

array
multiFetchElements( string $element, string $params)

Method to get data about multiple ids of an element [node|way|relation]

array
relationsForElement( string $element, integer $id)

Method to get relations for an Element [node|way|relation]

array
waysForNode( integer $id)

Method to get ways for a Node element

array
fullElement( string $element, integer $id)

Method to get full information about an element [way|relation]

array
redaction( string $element, integer $id, integer $version, integer $redaction_id)

Method used by the DWG to hide old versions of elements containing data privacy or copyright infringements

Details

__construct( Registry $options = null, JHttp $client = null, JOpenstreetmapOauth $oauth = null)

Constructor

Parameters

Registry $options &$options Openstreetmap options object.
JHttp $client The HTTP client object.
JOpenstreetmapOauth $oauth Openstreetmap oauth client

mixed getOption( string $key)

Get an option from the JOpenstreetmapObject instance.

Parameters

string $key The name of the option to get.

Return Value

mixed The option value.

JOpenstreetmapObject setOption( string $key, mixed $value)

Set an option for the JOpenstreetmapObject instance.

Parameters

string $key The name of the option to set.
mixed $value The option value to set.

Return Value

JOpenstreetmapObject This object for method chaining.

SimpleXMLElement sendRequest( string $path, string $method = 'GET', array $headers = array(), mixed $data = '')

Method to send the request which does not require authentication.

Parameters

string $path The path of the request to make
string $method The request method.
array $headers The headers passed in the request.
mixed $data Either an associative array or a string to be sent with the post request.

Return Value

SimpleXMLElement The XML response

Exceptions

DomainException

array createNode( integer $changeset, float $latitude, float $longitude, array $tags)

Method to create a node

Parameters

integer $changeset Changeset id
float $latitude Latitude of the node
float $longitude Longitude of the node
array $tags Array of tags for a node

Return Value

array The XML response

array createWay( integer $changeset, array $tags, array $nds)

Method to create a way

Parameters

integer $changeset Changeset id
array $tags Array of tags for a way
array $nds Node ids to refer

Return Value

array The XML response

array createRelation( integer $changeset, array $tags, array $members)

Method to create a relation

Parameters

integer $changeset Changeset id
array $tags Array of tags for a relation
array $members Array of members for a relation eg: $members = array(array("type"=>"node", "role"=>"stop", "ref"=>"123"), array("type"=>"way", "ref"=>"123"))

Return Value

array The XML response

array readElement( string $element, integer $id)

Method to read an element [node|way|relation]

Parameters

string $element [node|way|relation]
integer $id Element identifier

Return Value

array The XML response

Exceptions

DomainException

array updateElement( string $element, string $xml, integer $id)

Method to update an Element [node|way|relation]

Parameters

string $element [node|way|relation]
string $xml Full reperentation of the element with a version number
integer $id Element identifier

Return Value

array The xml response

Exceptions

DomainException

array deleteElement( string $element, integer $id, integer $version, integer $changeset, float $latitude = null, float $longitude = null)

Method to delete an element [node|way|relation]

Parameters

string $element [node|way|relation]
integer $id Element identifier
integer $version Element version
integer $changeset Changeset identifier
float $latitude Latitude of the element
float $longitude Longitude of the element

Return Value

array The XML response

Exceptions

DomainException

array historyOfElement( string $element, integer $id)

Method to get history of an element [node|way|relation]

Parameters

string $element [node|way|relation]
integer $id Element identifier

Return Value

array The XML response

Exceptions

DomainException

array versionOfElement( string $element, integer $id, integer $version)

Method to get details about a version of an element [node|way|relation]

Parameters

string $element [node|way|relation]
integer $id Element identifier
integer $version Element version

Return Value

array The XML response

Exceptions

DomainException

array multiFetchElements( string $element, string $params)

Method to get data about multiple ids of an element [node|way|relation]

Parameters

string $element [nodes|ways|relations] - use plural word
string $params Comma separated list of ids belonging to type $element

Return Value

array The XML response

Exceptions

DomainException

array relationsForElement( string $element, integer $id)

Method to get relations for an Element [node|way|relation]

Parameters

string $element [node|way|relation]
integer $id Element identifier

Return Value

array The XML response

Exceptions

DomainException

array waysForNode( integer $id)

Method to get ways for a Node element

Parameters

integer $id Node identifier

Return Value

array The XML response

array fullElement( string $element, integer $id)

Method to get full information about an element [way|relation]

Parameters

string $element [way|relation]
integer $id Identifier

Return Value

array The XML response

Exceptions

DomainException

array redaction( string $element, integer $id, integer $version, integer $redaction_id)

Method used by the DWG to hide old versions of elements containing data privacy or copyright infringements

Parameters

string $element [node|way|relation]
integer $id Element identifier
integer $version Element version
integer $redaction_id Redaction id

Return Value

array The xml response

Exceptions

DomainException