getNamespace()); return implode($csvValueSepartor, [ "p5_{$ns['prefix']}:{$ns['name']}", // Name $csvText($acl->getRawLabel()), // Title Api_WfsNs::getNsUri($ns['prefix']), // namespace url $csvText(implode(', ', [ $acl->getID(), $acl->getName(), $acl->getRawLabel() ])), // Keywords $csvText($acl->getRawOpis()), // Abstract 'EPSG:4326', // SRS "8.12328509871721", // LatLongBoundingBox - minx "38.8575126897477", // LatLongBoundingBox - miny "9.838674658246807", // LatLongBoundingBox - maxx "41.31378404137082", // LatLongBoundingBox - maxy ]); }, $aclList)); echo $csvLineSepartor; echo implode($csvLineSepartor, array_map(function ($typeName) use ($csvText, $csvValueSepartor) { list($prefix, $name) = explode(':', $typeName); return implode($csvValueSepartor, [ "p5_{$prefix}:{$name}", // Name $csvText($name), // Title Api_WfsNs::getNsUri($prefix), // namespace url $csvText($name), // Keywords $csvText($name), // Abstract 'EPSG:4326', // SRS "8.12328509871721", // LatLongBoundingBox - minx "38.8575126897477", // LatLongBoundingBox - miny "9.838674658246807", // LatLongBoundingBox - maxx "41.31378404137082", // LatLongBoundingBox - maxy ]); }, Core_AclHelper::getCustomAclList())); exit; } static function sendGetCapabilitiesXml($wpsServerUrl, $serviceTitle, $serviceDescription, $aclList) { throw new Api_WfsException("Not Implemented sendGetCapabilitiesXml for Wps version 1.0.0", 501); header('Content-type: application/xml; charset=utf-8'); $xmlWriter = new Core_XmlWriter(); if (!$xmlWriter) throw new HttpException("Error no XMLWriter", 404); $xmlWriter->openUri('php://output'); $xmlWriter->setIndent(true); $xmlWriter->startDocument('1.0','UTF-8'); $xmlWriter->startElement('wps:Capabilities'); $xmlWriter->writeAttribute('service', "WPS"); $xmlWriter->writeAttribute('version', "2.0.0"); // $xmlWriter->writeAttribute('xml:lang', "en-GB"); $xmlWriter->writeAttribute('xmlns:xlink', "http://www.w3.org/1999/xlink"); $xmlWriter->writeAttribute('xmlns:wps', "http://www.opengis.net/wps/1.0.0"); $xmlWriter->writeAttribute('xmlns:ows', "http://www.opengis.net/ows/1.1"); $xmlWriter->writeAttribute('xmlns:ogc', "http://www.opengis.net/ogc"); $xmlWriter->writeAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance"); // $xmlWriter->writeAttribute('xsi:schemaLocation', "http://www.opengis.net/wps/1.0.0 ../wpsGetCapabilities_response.xsd"); $xmlWriter->writeAttribute('updateSequence', "1"); // $xmlWriter->writeAttribute('xmlns', 'http://www.opengis.net/wfs'); // $xmlWriter->writeAttribute('xmlns:ogc', 'http://www.opengis.net/ogc'); // $xmlWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); foreach (Api_WfsNs::getNsList() as $uri => $prefix) { $xmlWriter->writeAttribute("xmlns:{$prefix}", $uri); } $schemaLocations = []; //$schemaLocations[] = 'http://www.opengis.net/wfs http://webgis.regione.sardegna.it:80/geoserver/schemas/wfs/1.0.0/WFS-capabilities.xsd';// @from http://webgis.regione.sardegna.it/geoserver/ows?service=WFS&request=GetCapabilities if (!empty($schemaLocations)) $xmlWriter->writeAttribute('xsi:schemaLocation', implode(' ', $schemaLocations)); $xmlWriter->h('ows:ServiceIdentification', [ ['ows:Title', $serviceTitle], ['ows:Abstract', $serviceDescription], ['ows:Keywords', [ ['ows:Keyword', "WPS"], ] ], ['ows:ServiceType', "WPS"], ['ows:ServiceTypeVersion', "2.0.0"], ['ows:Fees', "NONE"], ['ows:AccessConstraints', "NONE"], ]); // // Agriculture and Agri-Food Canada // // // Peter Schut // Information System Scientist // // // +1 613 759-1874 // +1 613 759-1937 // // // Room 1135, Neatby Building, 960, Carling Avenue // Ottawa // ON // K1AOC6 // Canada // schutp@agr.gc.ca // // // // // $xmlWriter->h('ows:ServiceProvider', [ // [ 'ows:ProviderName', "" ], // TODO: company name - from config? // [ 'ows:ProviderSite', [ 'xlink:href' => $wpsServerUrl ], null ], // // [ 'ows:ServiceContact', [ // // [ 'ows:IndividualName', "..." ], // // ] ], // ]); // // $xmlWriter->h('ows:OperationsMetadata', [ // [ 'ows:Operation', [ 'name' => "GetCapabilities" ], [ // [ 'ows:DCP', [ // [ 'ows:HTTP', [ // [ 'ows:Get', [ 'xlink:href' => $wpsServerUrl ], null ], // ] ] // ] ] // ] ], // [ 'ows:Operation', [ 'name' => "DescribeProcess" ], [ // [ 'ows:DCP', [ // [ 'ows:HTTP', [ // [ 'ows:Get', [ 'xlink:href' => $wpsServerUrl ], null ], // [ 'ows:Post', [ 'xlink:href' => $wpsServerUrl ], null ], // ] ] // ] ] // ] ], // [ 'ows:Operation', [ 'name' => "Execute" ], [ // [ 'ows:DCP', [ // [ 'ows:HTTP', [ // [ 'ows:Get', [ 'xlink:href' => $wpsServerUrl ], null ], // [ 'ows:Post', [ 'xlink:href' => $wpsServerUrl ], null ], // ] ] // ] ] // ] ], // [ 'ows:Operation', [ 'name' => "GetStatus" ], [ // [ 'ows:DCP', [ // [ 'ows:HTTP', [ // [ 'ows:Get', [ 'xlink:href' => $wpsServerUrl ], null ], // [ 'ows:Post', [ 'xlink:href' => $wpsServerUrl ], null ], // ] ] // ] ] // ] ], // [ 'ows:Operation', [ 'name' => "GetResult" ], [ // [ 'ows:DCP', [ // [ 'ows:HTTP', [ // [ 'ows:Get', [ 'xlink:href' => $wpsServerUrl ], null ], // [ 'ows:Post', [ 'xlink:href' => $wpsServerUrl ], null ], // ] ] // ] ] // ] ], // [ 'ows:Operation', [ 'name' => "Dismiss" ], [ // [ 'ows:DCP', [ // [ 'ows:HTTP', [ // [ 'ows:Get', [ 'xlink:href' => $wpsServerUrl ], null ], // [ 'ows:Post', [ 'xlink:href' => $wpsServerUrl ], null ], // ] ] // ] ] // ] ], // ]); // $xmlWriter->h('wps:ProcessOfferings', [ // TODO:? for version 1.0.0 ? // [ 'wps:Process', [ 'wps:processVersion' => "1" ], [ // [ 'ows:Identifier', "buffer" ], // [ 'ows:Title', "Buffer a polygon feature" ], // [ 'ows:Abstract', "Buffer the polygon coordinates found in one GML stream by a given buffer distance, and output the results in GML." ], // [ 'ows:Metadata', [ 'xlink:title' => "buffer" ], null ], // [ 'ows:Metadata', [ 'xlink:title' => "polygon" ], null ], // ] ] // ]); // $xmlWriter->h('wps:Languages', [ // [ 'wps:Default', [ // [ 'ows:Language', "en-CA" ], // ] ], // [ 'wps:Supported', [ // [ 'ows:Language', "pl-PL" ], // ] ] // ]); $xmlWriter->h('wps:Contents', [ [ 'wps:ProcessSummary', [ 'jobControlOptions' => "sync-execute async-execute dismiss" ], [ [ 'ows:Title', "example 1" ], [ 'ows:Identifier', "{$wpsServerUrl}/task/example1" ], ] ], [ 'wps:ProcessSummary', [ 'jobControlOptions' => "async-execute dismiss", 'processVersion' => "1.4.0" ], [ [ 'ows:Title', "example 2" ], [ 'ows:Identifier', "{$wpsServerUrl}/task/example2" ], ] ], ]); $xmlWriter->h('wps:WSDL', [ 'xlink:href' => "http://foo.bar/wps?WSDL" ], null); $xmlWriter->endElement();// WFS_Capabilities $xmlWriter->endDocument(); exit; } }