Permalink
Browse files

change to OpenStreetMap, from Openstreetmap.

  • Loading branch information...
1 parent 1bd78c8 commit 76f805142cc0ff3d4049c6287a99224b4ed38f31 @kenguest committed Feb 5, 2012
Showing with 777 additions and 636 deletions.
  1. +36 −36 Services/{Openstreetmap.php → OpenStreetMap.php}
  2. +40 −40 Services/{Openstreetmap → OpenStreetMap}/API/V06.php
  3. +20 −20 Services/{Openstreetmap → OpenStreetMap}/Changeset.php
  4. +4 −4 Services/{Openstreetmap → OpenStreetMap}/Changesets.php
  5. +31 −31 Services/{Openstreetmap → OpenStreetMap}/Config.php
  6. +20 −20 Services/{Openstreetmap → OpenStreetMap}/Criterion.php
  7. +7 −7 Services/{Openstreetmap → OpenStreetMap}/Exception.php
  8. +7 −7 Services/{Openstreetmap → OpenStreetMap}/InvalidArgumentException.php
  9. +17 −17 Services/{Openstreetmap → OpenStreetMap}/Node.php
  10. +4 −4 Services/{Openstreetmap → OpenStreetMap}/Nodes.php
  11. +17 −17 Services/{Openstreetmap → OpenStreetMap}/Object.php
  12. +16 −16 Services/{Openstreetmap → OpenStreetMap}/Objects.php
  13. +5 −5 Services/{Openstreetmap → OpenStreetMap}/Relation.php
  14. +4 −4 Services/{Openstreetmap → OpenStreetMap}/Relations.php
  15. +7 −7 Services/{Openstreetmap → OpenStreetMap}/RuntimeException.php
  16. +34 −34 Services/{Openstreetmap → OpenStreetMap}/Transport.php
  17. +5 −5 Services/{Openstreetmap → OpenStreetMap}/User.php
  18. +12 −12 Services/{Openstreetmap → OpenStreetMap}/Way.php
  19. +4 −4 Services/{Openstreetmap → OpenStreetMap}/Ways.php
  20. BIN Services_OpenStreetMap-0.0.1.tgz
  21. +3 −3 examples/example1_cahir.php
  22. +3 −3 examples/example1_savetolocalfile.php
  23. +3 −3 examples/example2_loadandparselocaldata.php
  24. +3 −3 examples/example3_genericdemo.php
  25. +4 −4 examples/example4_getchangeset.php
  26. +4 −4 examples/example5_history.php
  27. +3 −3 examples/example6_closedway.php
  28. +6 −6 examples/example7_searchchangeset.php
  29. +3 −3 package.php
  30. +274 −133 package.xml
  31. +5 −5 tests/AllTests.php
  32. +33 −33 tests/ChangesetTest.php
  33. +32 −32 tests/ConfigTest.php
  34. +29 −29 tests/CriterionTest.php
  35. +29 −29 tests/NodeTest.php
  36. +24 −24 tests/OSMTest.php
  37. +6 −6 tests/RelationTest.php
  38. +7 −7 tests/UserTest.php
  39. +16 −16 tests/WayTest.php
@@ -1,41 +1,41 @@
<?php
/**
- * Provide a method of interfacing with Openstreetmap servers.
+ * Provide a method of interfacing with OpenStreetMap servers.
*
* PHP Version 5
*
* @category Services
- * @package Services_Openstreetmap
+ * @package Services_OpenStreetMap
* @author Ken Guest <kguest@php.net>
* @license BSD http://www.opensource.org/licenses/bsd-license.php
* @version Release: @package_version@
- * @link http://pear.php.net/package/Services_Openstreetmap
+ * @link http://pear.php.net/package/Services_OpenStreetMap
* @link http://wiki.openstreetmap.org/wiki/Api06
*/
require_once 'HTTP/Request2.php';
-
-spl_autoload_register(array('Services_Openstreetmap', 'autoload'));
+spl_autoload_register(array('Services_OpenStreetMap', 'autoload'));
+#spl_autoload_register(array('Services_OpenStreetMap', 'autoload'));
/**
- * Services_Openstreetmap - interface with Openstreetmap
+ * Services_OpenStreetMap - interface with OpenStreetMap
*
* @category Services
- * @package Services_Openstreetmap
+ * @package Services_OpenStreetMap
* @author Ken Guest <kguest@php.net>
* @copyright 2010 Ken Guest
* @license BSD http://www.opensource.org/licenses/bsd-license.php
* @version Release: 0.0.1
- * @link http://pear.php.net/package/Services_Openstreetmap
+ * @link http://pear.php.net/package/Services_OpenStreetMap
*/
-class Services_Openstreetmap
+class Services_OpenStreetMap
{
/**
* Default config settings
*
- * @var Services_Openstreetmap_Config
- * @see Services_Openstreetmap::getConfig
- * @see Services_Openstreetmap::setConfig
+ * @var Services_OpenStreetMap_Config
+ * @see Services_OpenStreetMap::getConfig
+ * @see Services_OpenStreetMap::setConfig
*/
protected $config = null;
@@ -70,7 +70,7 @@ public static function autoload($class)
*
* @param array $config Defaults to empty array if none provided
*
- * @return Services_Openstreetmap
+ * @return Services_OpenStreetMap
*/
public function __construct($config = array())
{
@@ -82,7 +82,7 @@ public function __construct($config = array())
$this->getConfig()->setValue($config);
}
$version = $this->getConfig()->getValue('api_version');
- $api = "Services_Openstreetmap_API_V" . str_replace('.', '', $version);
+ $api = "Services_OpenStreetMap_API_V" . str_replace('.', '', $version);
$this->api = new $api;
$this->api->setTransport($this->getTransport());
$this->api->setConfig($this->getConfig());
@@ -93,7 +93,7 @@ public function __construct($config = array())
* method.
*
* <code>
- * $osm = new Services_Openstreetmap();
+ * $osm = new Services_OpenStreetMap();
* $osm->get($osm->bboxToMinMax($minLat, $minLon, $maxLat, $maxLon));
* file_put_contents("area_covered.osm", $osm->getXML());
* </code>
@@ -114,7 +114,7 @@ public function bboxToMinMax($minLat, $minLon, $maxLat, $maxLon)
* Get XML describing area prescribed by the given co-ordinates.
*
* <code>
- * $osm = new Services_Openstreetmap();
+ * $osm = new Services_OpenStreetMap();
* $osm->get(-8.3564758, 52.821022799999994, -7.7330017, 53.0428644);
* file_put_contents("area_covered.osm", $osm->getXML());
* </code>
@@ -148,7 +148,7 @@ public function get($minLon, $minLat, $maxLon, $maxLat)
* @param string $place name
*
* @return array Associated array of lat/lon values.
- * @throws Services_Openstreetmap_Exception If the place can not be found.
+ * @throws Services_OpenStreetMap_Exception If the place can not be found.
*/
public function getCoordsOfPlace($place)
{
@@ -158,7 +158,7 @@ public function getCoordsOfPlace($place)
$xml = simplexml_load_string($response->getBody());
$obj = $xml->xpath('//place');
if (empty($obj)) {
- throw new Services_Openstreetmap_Exception(
+ throw new Services_OpenStreetMap_Exception(
'Could not get coords for ' . $place
);
}
@@ -218,10 +218,10 @@ public function getXml()
/**
* search based on given criteria.
*
- * returns an array of objects such as Services_Openstreetmap_Node etc.
+ * returns an array of objects such as Services_OpenStreetMap_Node etc.
*
* <code>
- * $osm = new Services_Openstreetmap();
+ * $osm = new Services_OpenStreetMap();
*
* $osm->loadXML("./osm.osm");
* $results = $osm->search(array("amenity" => "pharmacy"));
@@ -288,7 +288,7 @@ public function search(array $criteria)
*/
private function _searchNode(SimpleXMLElement $node, $key, $value, $type)
{
- $class = 'Services_Openstreetmap_' . ucfirst(strtolower($type));
+ $class = 'Services_OpenStreetMap_' . ucfirst(strtolower($type));
$results = array();
foreach ($node->tag as $tag) {
if ($tag['k'] == $key) {
@@ -329,7 +329,7 @@ public function getTimeout()
*
* <code>
* $config = array('user' => 'fred@example.net', 'password' => 'wilma4eva');
- * $osm = new Services_Openstreetmap($config);
+ * $osm = new Services_OpenStreetMap($config);
* $min = $osm->getMinVersion();
* </code>
*
@@ -345,7 +345,7 @@ public function getMinVersion()
*
* <code>
* $config = array('user' => 'fred@example.net', 'password' => 'wilma4eva');
- * $osm = new Services_Openstreetmap($config);
+ * $osm = new Services_OpenStreetMap($config);
* $max = $osm->getMaxVersion();
* </code>
*
@@ -360,7 +360,7 @@ public function getMaxVersion()
* Max size of area that can be downloaded in one request.
*
* <code>
- * $osm = new Services_Openstreetmap();
+ * $osm = new Services_OpenStreetMap();
* $area_allowed = $osm->getMaxArea();
* </code>
*
@@ -375,7 +375,7 @@ public function getMaxArea()
* Maximum number of tracepoints per page.
*
* <code>
- * $osm = new Services_Openstreetmap();
+ * $osm = new Services_OpenStreetMap();
* $tracepoints = $osm->getTracepointsPerPage();
* </code>
*
@@ -392,7 +392,7 @@ public function getTracepointsPerPage()
* Anymore than that and the way must be split.
*
* <code>
- * $osm = new Services_Openstreetmap();
+ * $osm = new Services_OpenStreetMap();
* $max = $osm->getMaxNodes();
* </code>
*
@@ -407,7 +407,7 @@ public function getMaxNodes()
* Number of elements allowed per changeset
*
* <code>
- * $osm = new Services_Openstreetmap();
+ * $osm = new Services_OpenStreetMap();
* $max = $osm->getMaxElements();
* </code>
*
@@ -421,11 +421,11 @@ public function getMaxElements()
/**
* Set Config object
*
- * @param Services_Openstreetmap_Config $config Config settings.
+ * @param Services_OpenStreetMap_Config $config Config settings.
*
- * @return Services_Openstreetmap_API_V06
+ * @return Services_OpenStreetMap_API_V06
*/
- public function setConfig(Services_Openstreetmap_Config $config)
+ public function setConfig(Services_OpenStreetMap_Config $config)
{
$this->config = $config;
return $this;
@@ -434,12 +434,12 @@ public function setConfig(Services_Openstreetmap_Config $config)
/**
* Get current Config object
*
- * @return Services_Openstreetmap_Config
+ * @return Services_OpenStreetMap_Config
*/
public function getConfig()
{
if (is_null($this->config)) {
- $config = new Services_Openstreetmap_Config();
+ $config = new Services_OpenStreetMap_Config();
$this->config = $config;
}
return $this->config;
@@ -450,12 +450,12 @@ public function getConfig()
*
* If one is not defined, create it.
*
- * @return Services_Openstreetmap_Transport
+ * @return Services_OpenStreetMap_Transport
*/
public function getTransport()
{
if (is_null($this->transport)) {
- $transport = new Services_Openstreetmap_Transport();
+ $transport = new Services_OpenStreetMap_Transport();
$transport->setConfig($this->getConfig());
$this->transport = $transport;
@@ -472,15 +472,15 @@ public function getTransport()
* @param array $arguments Arguments to be used when calling method.
*
* @return void
- * @throws Services_Openstreetmap_Exception If the method is not supported
+ * @throws Services_OpenStreetMap_Exception If the method is not supported
* by the API instance.
*/
public function __call($name, $arguments)
{
if (method_exists($this->api, $name)) {
return call_user_func_array(array($this->api, $name), $arguments);
} else {
- throw new Services_Openstreetmap_Exception(
+ throw new Services_OpenStreetMap_Exception(
sprintf(
'Method %s does not exist.',
$name
Oops, something went wrong.

0 comments on commit 76f8051

Please sign in to comment.