$methodName($urlQuery); } } exit; break; default: } //$_POST['url'] = 'http://demo.opengeo.org/geoserver/wfs'; //$entityBody = file_get_contents('php://input'); $url = V::get('_url', '', $_GET); if ($url) {// @see OpenLayers/examples/proxy.cgi $allowedHosts = array('www.openlayers.org', 'openlayers.org', 'labs.metacarta.com', 'world.freemap.in', 'prototype.openmnnd.org', 'geo.openplans.org', 'sigma.openplans.org', 'demo.opengeo.org', 'www.openstreetmap.org', 'sample.azavea.com', 'v2.suite.opengeo.org', 'v-swe.uni-muenster.de:8080', 'vmap0.tiles.osgeo.org', 'www.openrouteservice.org', 'maps.wien.gv.at'); if (!empty($_POST)) { // qs = os.environ["QUERY_STRING"] // d = cgi.parse_qs(qs) // if d.has_key("url"): // url = d["url"][0] // else: // url = "http://www.openlayers.org" } else { // fs = cgi.FieldStorage() // url = fs.getvalue('url', "http://www.openlayers.org") } $host = explode('/', $url); $host = $host[2]; if (!in_array($host, $allowedHosts)) { header("Status: 502 Bad Gateway"); header("Content-Type: text/plain"); echo "\nThis proxy does not allow you to access that location ({$host})."; exit; } else if (substr($url, 0, 7) == 'http://' || substr($url, 0, 8) == 'https://') { $ch = curl_init(); if (!empty($_POST)) { /* length = int(os.environ["CONTENT_LENGTH"]) headers = {"Content-Type": os.environ["CONTENT_TYPE"]} body = sys.stdin.read(length) r = urllib2.Request(url, body, headers) y = urllib2.urlopen(r) */ } else { curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);// return the transfer as a string //curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_HEADER, 1); $response = curl_exec($ch); // Then, after your curl_exec call: $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); $header = substr($response, 0, $header_size); $body = substr($response, $header_size); curl_close($ch); $contentType = 'text/plain'; $headers = explode("\n", $header); foreach ($headers as $vHeader) { if (substr($vHeader, 0, 13) == 'Content-Type:') { $contentType = trim(substr($vHeader, 14)); } } header("Content-Type: {$contentType}"); echo $body . "\n"; } } else { header("Content-Type: text/plain"); echo "\nIllegal request."; exit; } exit; } ?>

WPS Builder Example

wps, process, advanced
Using WPS formats to interact with WPS

This example shows WPS in action by using the WPSCapabilities, WPSDescribeProcess and WPSExecute formats. See wps.js for the source code. Note: For applications using WPS, the high level approach shown in the wps-client example is recommended instead.

  1. Select a process from the list below the map. The list is populated with the result of a WPS GetCapabilities request, parsed using OpenLayers.Format.WPSCapabilities::read.
  2. Fill out the Input form. Hover over fields to get a description. Required fields are marked with a "*". To use a geometry from the map as input, select the geometry on the map (using the pen symbol on the left of the toolbar) and just click the field. The form is generated from the object returned by OpenLayers.Format.WPSDescribeProcess::read
  3. Click "Execute" and examine the result in the result text area. If the result can be parsed as features, it will be displayed on the map as well. The process data is sent to the server with the serialized XML from OpenLayers.Format.WPSExecute::write, which can use a modified OpenLayers.Format.WPSDescribeProcess result object as input.

content (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($content);echo''; $xml = new SimpleXmlElement($content); echo'
xml (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($xml);echo'
'; $coordinates = $xml->children('gml', TRUE)->featureMember->children('', TRUE)->Hostip->ipLocation->children('gml', TRUE)->pointProperty->Point->coordinates; $longlat = explode(',', $coordinates); $location['longitude'] = $longlat[0]; $location['latitude'] = $longlat[1]; $location['citystate'] = '==>'.$xml->children('gml', TRUE)->featureMember->children('', TRUE)->Hostip->children('gml', TRUE)->name; $location['country'] = '==>'.$xml->children('gml', TRUE)->featureMember->children('', TRUE)->Hostip->countryName; return $location; } else return false; } $ip = '94.158.130.34';// biuro.biall-net.pl $location_info = get_location($ip); echo'
location_info('.$ip.') (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($location_info);echo'
'; /* $the_xml = file_get_contents(''); $feed = new SimpleXMLElement($the_xml); $namespaces = $feed->getNamespaces(true); foreach ($feed->entry as $entry) { $event = $entry->children($namespaces['gd']); echo "

Event = " . $entry->title . "
startTime = " . $event->when->startTime . " and endTime = " . $event->when->endTime . "

\n"; } */ } class WpsServer { public function getCapabilitiesAction() { echo ''; ?> Prototype GeoServer WPS wps geoserver WPS 1.0.0 NONE NONE GeoServer pozdrawiam Area Returns the area of a geometry, in the units of the geometry. Assumes a Cartesian plane, so this process is only recommended for non-geographic CRSes. en-US en-US '; ?> JTS:densify Densify Returns a spatially equivalent geometry with vertices added to ensure line segments are no longer than a given distance. geom geom Input geometry text/xml; subtype=gml/3.1.1 text/xml; subtype=gml/3.1.1 text/xml; subtype=gml/2.1.2 application/wkt application/gml-3.1.1 application/gml-2.1.2 distance distance The maximum segment length in the result, in the units of the geometry xs:double result result text/xml; subtype=gml/3.1.1 text/xml; subtype=gml/3.1.1 text/xml; subtype=gml/2.1.2 application/wkt application/gml-3.1.1 application/gml-2.1.2