Elements

Extends \Joomla\OpenStreetMap\OpenStreetMapObject

OpenStreetMap API Elements class for the Joomla Framework

deprecated
since

1.0

deprecated

The joomla/openstreetmap package is deprecated

Methods

__construct

Constructor

__construct(array $options = array(), \Joomla\Http\Http $client = null, \Joomla\OpenStreetMap\OAuth $oauth = null) 
inherited
since

1.0

Arguments

$options

arrayOpenStreetMap options object.

$client

\Joomla\Http\HttpThe HTTP client object.

$oauth

\Joomla\OpenStreetMap\OAuthOpenStreetMap OAuth client

createNode

Method to create a node

createNode(integer $changeset, float $latitude, float $longitude, \Joomla\OpenStreetMap\arary $tags) : array
since

1.0

Arguments

$changeset

integerChangeset id

$latitude

floatLatitude of the node

$longitude

floatLongitude of the node

$tags

\Joomla\OpenStreetMap\araryArray of tags for a node

Response

arrayThe XML response

createRelation

Method to create a relation

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

1.0

Arguments

$changeset

integerChangeset id

$tags

arrayArray of tags for a relation

$members

arrayArray of members for a relation eg: $members = array(array("type"=>"node", "role"=>"stop", "ref"=>"123"), array("type"=>"way", "ref"=>"123"))

Response

arrayThe XML response

createWay

Method to create a way

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

1.0

Arguments

$changeset

integerChangeset id

$tags

arrayArray of tags for a way

$nds

arrayNode ids to refer

Response

arrayThe XML response

deleteElement

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

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

1.0

throws

\DomainException

Arguments

$element

string[node|way|relation]

$id

integerElement identifier

$version

integerElement version

$changeset

integerChangeset identifier

$latitude

floatLatitude of the element

$longitude

floatLongitude of the element

Response

arrayThe XML response

fullElement

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

fullElement(string $element, integer $id) : array
since

1.0

throws

\DomainException

Arguments

$element

string[way|relation]

$id

integerIdentifier

Response

arrayThe XML response

getOption

Get an option from the OpenStreetMapObject instance.

getOption(string $key) : mixed
inherited
since

1.0

Arguments

$key

stringThe name of the option to get.

Response

mixedThe option value.

historyOfElement

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

historyOfElement(string $element, integer $id) : array
since

1.0

throws

\DomainException

Arguments

$element

string[node|way|relation]

$id

integerElement identifier

Response

arrayThe XML response

multiFetchElements

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

multiFetchElements(string $element, string $params) : array
since

1.0

throws

\DomainException

Arguments

$element

string[nodes|ways|relations] - use plural word

$params

stringComma separated list of ids belonging to type $element

Response

arrayThe XML response

readElement

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

readElement(string $element, integer $id) : array
since

1.0

throws

\DomainException

Arguments

$element

string[node|way|relation]

$id

integerElement identifier

Response

arrayThe XML response

redaction

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

redaction(string $element, integer $id, integer $version, integer $redactionId) : array
since

1.0

throws

\DomainException

Arguments

$element

string[node|way|relation]

$id

integerElement identifier

$version

integerElement version

$redactionId

integerRedaction id

Response

arrayThe xml response

relationsForElement

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

relationsForElement(string $element, integer $id) : array
since

1.0

throws

\DomainException

Arguments

$element

string[node|way|relation]

$id

integerElement identifier

Response

arrayThe XML response

sendRequest

Method to send the request which does not require authentication.

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

1.0

throws

\DomainException

Arguments

$path

stringThe path of the request to make

$method

stringThe request method.

$headers

arrayThe headers passed in the request.

$data

mixedEither an associative array or a string to be sent with the post request.

Response

\SimpleXMLElementThe XML response

setOption

Set an option for the OpenStreetMapObject instance.

setOption(string $key, mixed $value) : \Joomla\OpenStreetMap\OpenStreetMapObject
inherited
since

1.0

Arguments

$key

stringThe name of the option to set.

$value

mixedThe option value to set.

Response

\Joomla\OpenStreetMap\OpenStreetMapObjectThis object for method chaining.

updateElement

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

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

1.0

throws

\DomainException

Arguments

$element

string[node|way|relation]

$xml

stringFull reperentation of the element with a version number

$id

integerElement identifier

Response

arrayThe xml response

versionOfElement

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

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

1.0

throws

\DomainException

Arguments

$element

string[node|way|relation]

$id

integerElement identifier

$version

integerElement version

Response

arrayThe XML response

waysForNode

Method to get ways for a Node element

waysForNode(integer $id) : array
since

1.0

Arguments

$id

integerNode identifier

Response

arrayThe XML response

Properties

options

Options for the OpenStreetMap object.

inherited
since

1.0

Type(s)

array

client

The HTTP client object to use in sending HTTP requests.

inherited
since

1.0

Type(s)

\Joomla\Http\Http

oauth

The OAuth client.

inherited
since

1.0

Type(s)

\Joomla\OpenStreetMap\OAuth