| GeoClassWebService | ![]() |
| back to main page |
GeoClassWebService
The GeoWebService allow to search for locations by name and for locations within a surrounding area of a given pair of latitude / longitude values. The data provided with this webservice is from NIMA (National Imagery and Mapping Agency). Only the german database is accessible via the webservice.
GeoClassWebService makes use of NuSOAP.
| URL | : | http://www.multimediamotz.biz/GeoClass/GeoClassWebService |
| username | : | geoservice |
| password | : | test |
| findGeoObject($returnType, $name [, $featureClassificationSet [, $placeClassificationSet]]) |
| findCity($returnType, $name [, $placeClassificationSet]) |
| findCloseByCity($returnType, $lat, $long [, $maxRadius [, $maxHits [, $placeClassificationSet]]]) |
All methods have the $returnType parameter in common. It could be derived from the constants of GeoClass.php: GEO_RETURN_SER (which is set to 0) returns a serialized array of GeoObjectDBNima-objects and GEO_RETURN_RDF returns a string which contains a representation of a rdf-file.
This is a simple implementation of the webservice. Check it out by going here:
http://www.multimediamotz.de/GeoClass/webservice-test.php?name=Berlin
<?php /** This is a sample client of the GeoClassWebService */ // You could pass a parameter via GET/POST if (!isset($name)) { $name = 'Herdecke'; } if(!isset($lat)) { $lat = '51.40666'; } if(!isset($long)) { $long = '7.441944'; } if(!isset($mode)) { $mode = "city"; // or "area" } // Inlcusion of NuSOAP, no need of GeoClass if you don't use GeoObjects require_once('nusoap.php'); //include_once('GeoClass.php'); // establishing the client $soapClient = new soapclient('http://www.multimediamotz.biz/GeoClass/GeoClassWebService'); // Setting username and password $soapClient->setCredentials("geoservice", "test"); // This is an example for a basic search for a city with a given name $parametersFindCity = array('returnType' => 1, // use 0 to receive an array of GeoObjects 'name' => $name); // This is a basic example how to find locations within a surrounding area $parametersFindClose = array('returnType' => 1, // use 0 to receive an array of GeoObjects 'lat' => $lat, 'long' => $long, 'maxRadius' => 100, 'maxHits' => 50, 'placeClassificationSet' => "1, 2, 3, 4, 5, 0", 'name' => $name); if ($mode == "city") { $result = $soapClient->call('findGeoObject',$parametersFindCity); } else { $result = $soapClient->call('findCloseByCity',$parametersFindClose); } print $result; ?>
| back to main page |