src/Elements.php
public function createWay($changeset, $tags, $nds)
	{
		$token = $this->oauth->getToken();

		// Set parameters.
		$parameters = array(
			'oauth_token' => $token['key'],
		);

		// Set the API base
		$base = 'way/create';

		// Build the request path.
		$path = $this->getOption('api.url') . $base;

		$tagList = '';

		// Create XML node
		if (!empty($tags))
		{
			foreach ($tags as $key => $value)
			{
				$tagList .= '<tag k="' . $key . '" v="' . $value . '"/>';
			}
		}

		$ndList = '';

		if (!empty($nds))
		{
			foreach ($nds as $value)
			{
				$ndList .= '<nd ref="' . $value . '"/>';
			}
		}

		$xml = '<?xml version="1.0" encoding="UTF-8"?>
				<osm version="0.6" generator="JoomlaOpenStreetMap">
				<way changeset="' . $changeset . '">'
					. $tagList
					. $ndList .
				'</way>
			</osm>';

		$header['Content-Type'] = 'text/xml';

		// Send the request.
		$response = $this->oauth->oauthRequest($path, 'PUT', $parameters, $xml, $header);

		return $response->body;
	}
public function createWay($changeset, $tags, $nds)
	{
		$token = $this->oauth->getToken();

		// Set parameters.
		$parameters = array(
			'oauth_token' => $token['key'],
		);

		// Set the API base
		$base = 'way/create';

		// Build the request path.
		$path = $this->getOption('api.url') . $base;

		$tagList = '';

		// Create XML node
		if (!empty($tags))
		{
			foreach ($tags as $key => $value)
			{
				$tagList .= '<tag k="' . $key . '" v="' . $value . '"/>';
			}
		}

		$ndList = '';

		if (!empty($nds))
		{
			foreach ($nds as $value)
			{
				$ndList .= '<nd ref="' . $value . '"/>';
			}
		}

		$xml = '<?xml version="1.0" encoding="UTF-8"?>
				<osm version="0.6" generator="JoomlaOpenStreetMap">
				<way changeset="' . $changeset . '">'
					. $tagList
					. $ndList .
				'</way>
			</osm>';

		$header['Content-Type'] = 'text/xml';

		// Send the request.
		$response = $this->oauth->oauthRequest($path, 'PUT', $parameters, $xml, $header);

		return $response->body;
	}
public function createWay ( $ changeset , $ tags , $ nds ) { $ token = $ this -> oauth -> getToken ( ) ; // Set parameters. $ parameters = array ( 'oauth_token' => $ token [ 'key' ] , ) ; // Set the API base $ base = 'way/create' ; // Build the request path. $ path = $ this -> getOption ( 'api.url' ) . $ base ; $ tagList = '' ; // Create XML node if ( ! empty ( $ tags ) ) { foreach ( $ tags as $ key => $ value ) { $ tagList .= '<tag k="' . $ key . '" v="' . $ value . '"/>' ; } } $ ndList = '' ; if ( ! empty ( $ nds ) ) { foreach ( $ nds as $ value ) { $ ndList .= '<nd ref="' . $ value . '"/>' ; } } $ xml = '<?xml version="1.0" encoding="UTF-8"?>
				<osm version="0.6" generator="JoomlaOpenStreetMap">
				<way changeset="' . $ changeset . '">' . $ tagList . $ ndList . '</way>
			</osm>' ; $ header [ 'Content-Type' ] = 'text/xml' ; // Send the request. $ response = $ this -> oauth -> oauthRequest ( $ path , 'PUT' , $ parameters , $ xml , $ header ) ; return $ response -> body ; }
Method to create a way

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

@return  array   The XML response

@since   1.0
Method to create a way