superedit-OPEN_LAYERS_WPS.php 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158
  1. <?php
  2. /**
  3. * http://openlayers.org/dev/examples/wps.html
  4. * http://geoinformatyka.com.pl/usluga-wfs-jak-to-dziala/
  5. *
  6. * TODO: brak ModifyFeature - html btn: olControlModifyFeatureItemInactive
  7. */
  8. function OPEN_LAYERS_WPS() {
  9. $task = V::get('task', '', $_GET);
  10. switch ($task) {
  11. case 'proxy': {
  12. $url = V::get('url', '', $_GET);
  13. // 1. http%3A%2F%2Fbiuro.biall-net.pl%2Fwps%3FSERVICE%3DWPS%26REQUEST%3DGetCapabilities
  14. // 2. http%3A%2F%2Fbiuro.biall-net.pl%2Fwps%3FSERVICE%3DWPS%26REQUEST%3DDescribeProcess%26VERSION%3D1.0.0%26IDENTIFIER%3Dpozdrawiam
  15. header('Content-Type: application/xml; charset=utf-8');
  16. $urlParts = parse_url($url);
  17. $urlQuery = array();
  18. $urlQueryTmp = V::get('query', '', $urlParts);
  19. $urlQueryTmp = explode('&', $urlQueryTmp);
  20. foreach ($urlQueryTmp as $vQuery) {
  21. $parts = explode('=', $vQuery, 2);
  22. $urlQuery[$parts[0]] = $parts[1];
  23. }
  24. if ('WPS' == V::get('SERVICE', '', $urlQuery)) {
  25. $req = V::get('REQUEST', '', $urlQuery);
  26. $wps = new WpsServer();
  27. $methodName = "{$req}Action";
  28. if (method_exists($wps, $methodName)) {
  29. $wps->$methodName($urlQuery);
  30. }
  31. }
  32. else {
  33. $wps = new WpsServer();
  34. $wps->parseXMLRequest();
  35. }
  36. exit;
  37. break;
  38. }
  39. case 'import_from_postgis': {
  40. $gis_zas_id = 13102;
  41. $pgDB = DB::getDB($gis_zas_id);
  42. $db = DB::getDB();
  43. // POSTGIS_to_MYSQL_Tables('BUILDINGS','geoportal_gml_punkty_adr_gml_id','MK_Budynki','geoportal_gml_punkty_adr_gml_id');
  44. // function POSTGIS_to_MYSQL_Tables($local_table_mysql,$local_key,$remote_table_postgis,$remote_key){
  45. // global $db,$gdb;
  46. $local_table_mysql = 'BUILDINGS';
  47. $local_key = 'geoportal_gml_punkty_adr_gml_id';
  48. $remote_table_postgis = 'MK_Budynki';
  49. $remote_key = 'geoportal_gml_punkty_adr_gml_id';
  50. // BUG: ST_AsEWKT @see http://postgis.org/docs/ST_AsEWKT.html
  51. $pgSql = <<<SQL
  52. select "{$remote_key}"
  53. -- , ST_AsEWKT(the_geom) as the_geom -- The WKT spec does not include the SRID. To get the OGC WKT format use ST_AsText
  54. , ST_AsText(the_geom) as the_geom
  55. from "{$remote_table_postgis}"
  56. where "{$remote_key}"!=''
  57. and "{$remote_key}" is not null
  58. and the_geom != ''
  59. and the_geom is not null
  60. SQL;
  61. $pgRes = $pgDB->query($pgSql);
  62. echo '<pre>';
  63. echo "Start...\n";
  64. while ($r = $pgDB->fetch($pgRes)) {
  65. $r->{$remote_key} = trim($r->{$remote_key});
  66. $sql = "update `{$local_table_mysql}` set `the_geom`=GeomFromText('{$r->the_geom}')
  67. where `{$local_key}`='{$r->$remote_key}'
  68. and `{$local_key}`!=''
  69. and `{$local_key}` is not null
  70. and (`the_geom`='' or `the_geom` is null)
  71. ";
  72. //echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;">sql (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($sql);echo'</pre>';
  73. echo "Fethed remote_key: {$remote_key}={$r->$remote_key}| ";
  74. $testRow = null;
  75. $testSql = "select t.`ID`, t.`{$local_key}`, AsWKT(t.`the_geom`) as the_geom from `{$local_table_mysql}` as t where t.`{$local_key}`='{$r->$remote_key}' ";
  76. //echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;">testSql (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($testSql);echo'</pre>';
  77. $testRes = $db->query($testSql);
  78. if ($testRow = $db->fetch($testRes)) {
  79. echo " mysql row exists in table `{$local_table_mysql}` (ID={$testRow->ID}) ";
  80. echo " | the_geom is ";
  81. echo (!empty($testRow->the_geom))? " set " : " not set ";
  82. } else {
  83. echo " mysql row not exists in table `{$local_table_mysql}`! ";
  84. }
  85. //echo'<pre style="max-height:200px;overflow:auto;border:1px solid green;text-align:left;"> (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($testRow);echo'</pre>';
  86. $res = $db->query($sql);
  87. if (!$res) {
  88. echo "| ERROR: problem with query!";
  89. echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;display:none"> (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($sql);echo'</pre>';
  90. }
  91. else {
  92. echo "| done ";
  93. }
  94. echo "\n";
  95. }
  96. echo '</pre>';
  97. break;
  98. }
  99. default:
  100. }
  101. //$_POST['url'] = 'http://demo.opengeo.org/geoserver/wfs';
  102. //$entityBody = file_get_contents('php://input');
  103. $url = V::get('_url', '', $_GET);
  104. if ($url) {// @see OpenLayers/examples/proxy.cgi
  105. $allowedHosts = array('www.openlayers.org', 'openlayers.org',
  106. 'labs.metacarta.com', 'world.freemap.in',
  107. 'prototype.openmnnd.org', 'geo.openplans.org',
  108. 'sigma.openplans.org', 'demo.opengeo.org',
  109. 'www.openstreetmap.org', 'sample.azavea.com',
  110. 'v2.suite.opengeo.org', 'v-swe.uni-muenster.de:8080',
  111. 'vmap0.tiles.osgeo.org', 'www.openrouteservice.org',
  112. 'maps.wien.gv.at');
  113. if (!empty($_POST)) {
  114. // qs = os.environ["QUERY_STRING"]
  115. // d = cgi.parse_qs(qs)
  116. // if d.has_key("url"):
  117. // url = d["url"][0]
  118. // else:
  119. // url = "http://www.openlayers.org"
  120. }
  121. else {
  122. // fs = cgi.FieldStorage()
  123. // url = fs.getvalue('url', "http://www.openlayers.org")
  124. }
  125. $host = explode('/', $url);
  126. $host = $host[2];
  127. if (!in_array($host, $allowedHosts)) {
  128. header("Status: 502 Bad Gateway");
  129. header("Content-Type: text/plain");
  130. echo "\nThis proxy does not allow you to access that location ({$host}).";
  131. exit;
  132. }
  133. else if (substr($url, 0, 7) == 'http://' || substr($url, 0, 8) == 'https://') {
  134. $ch = curl_init();
  135. if (!empty($_POST)) {
  136. /*
  137. length = int(os.environ["CONTENT_LENGTH"])
  138. headers = {"Content-Type": os.environ["CONTENT_TYPE"]}
  139. body = sys.stdin.read(length)
  140. r = urllib2.Request(url, body, headers)
  141. y = urllib2.urlopen(r)
  142. */
  143. }
  144. else {
  145. curl_setopt($ch, CURLOPT_URL, $url);
  146. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);// return the transfer as a string
  147. //curl_setopt($ch, CURLOPT_VERBOSE, 1);
  148. curl_setopt($ch, CURLOPT_HEADER, 1);
  149. $response = curl_exec($ch);
  150. // Then, after your curl_exec call:
  151. $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
  152. $header = substr($response, 0, $header_size);
  153. $body = substr($response, $header_size);
  154. curl_close($ch);
  155. $contentType = 'text/plain';
  156. $headers = explode("\n", $header);
  157. foreach ($headers as $vHeader) {
  158. if (substr($vHeader, 0, 13) == 'Content-Type:') {
  159. $contentType = trim(substr($vHeader, 14));
  160. }
  161. }
  162. header("Content-Type: {$contentType}");
  163. echo $body . "\n";
  164. }
  165. }
  166. else {
  167. header("Content-Type: text/plain");
  168. echo "\nIllegal request.";
  169. exit;
  170. }
  171. exit;
  172. }
  173. ?>
  174. <link rel="stylesheet" href="stuff/open-layers/theme/default/style.css" type="text/css">
  175. <link rel="stylesheet" href="stuff/open-layers/style.css" type="text/css">
  176. <style type="text/css">
  177. .olControlEditingToolbar .olControlModifyFeatureItemInactive {
  178. background-image: url(stuff/open-layers/theme/default/img/draw_point_off.png);
  179. }
  180. .olControlEditingToolbar .olControlModifyFeatureItemActive {
  181. background-image: url(stuff/open-layers/theme/default/img/draw_point_on.png);
  182. }
  183. .olControlRefresh {
  184. background-image: url(stuff/open-layers/theme/default/img/save_features_off.png);
  185. }
  186. .olControlZoomToPoly {
  187. background-image: url(stuff/open-layers/theme/default/img/ruler.png);
  188. }
  189. .olControlLayerSwitcher .layersDiv {
  190. border-radius: 10px 0 0 10px;
  191. opacity: 0.75;
  192. filter: alpha(opacity=75);
  193. }
  194. textarea {
  195. display: block;
  196. width: 100%;
  197. height: 3em;
  198. }
  199. label {
  200. display: block;
  201. }
  202. .notsupported {
  203. color: red;
  204. }
  205. button {
  206. display: block;
  207. margin-top: 10px;
  208. }
  209. </style>
  210. <div id="TreeTableMap"></div>
  211. <script src="stuff/open-layers/OpenLayers.js"></script>
  212. <!-- <script src="stuff/open-layers/wps.js"></script> -->
  213. <script>
  214. (function ( $ ) {
  215. var TableAjaxMap = function() {
  216. var priv = {}; //private api
  217. var publ = {}; //public api
  218. priv.options = {};
  219. var defaults = {
  220. wpsUrl: '',
  221. wfsUrl: '',
  222. domProcessId: '',
  223. urlInit: true, // try to load services on init
  224. preloadData: null,
  225. menuid: '',
  226. debug: false
  227. };
  228. var _nodeMapId;
  229. var _nodeMap;
  230. var _nodeProcesses;
  231. var _nodeAbstract;
  232. var _nodeInput;
  233. var _nodeOutput;
  234. var _capabilities;
  235. var _process;
  236. var _layer;
  237. /*
  238. initialize the plugin.
  239. */
  240. priv.init = function() {
  241. console.log('test jQuery plugin init...', priv);
  242. // create dom:
  243. /*
  244. <div id="map" class="smallmap"></div>
  245. <div>
  246. <select id="processes"><option>Select a process</option></select>
  247. <p id="abstract"></p>
  248. <div id="input"></div>
  249. <div id="output"></div>
  250. </div>
  251. */
  252. _nodeMapId = 'Map-' + Math.random(1).toString().substr(2);
  253. _nodeMap = $('<div id="' + _nodeMapId + '" class="smallmap"></div>');
  254. _nodeProcesses = $('<select></select>');
  255. _nodeProcesses.append('<option>Wybierz funkcję</option>');
  256. _nodeAbstract = $('<p></p>');
  257. _nodeInput = $('<div></div>');
  258. _nodeOutput = $('<div></div>');
  259. var div = $('<div></div>');
  260. div.append(_nodeProcesses);
  261. div.append(_nodeAbstract);
  262. div.append(_nodeInput);
  263. div.append(_nodeOutput);
  264. $(priv.options.id).append(_nodeMap);
  265. $(priv.options.id).append(div);
  266. _nodeProcesses.on('change', function() {
  267. console.log("onchange this:", this, this.selectedIndex, this.options);
  268. var selection = this.options[this.selectedIndex].value;
  269. if (this.selectedIndex > 0) {
  270. OpenLayers.Request.GET({
  271. url: priv.options.wpsUrl,
  272. params: {
  273. "SERVICE": "WPS",
  274. "REQUEST": "DescribeProcess",
  275. "VERSION": _capabilities.version,
  276. "IDENTIFIER": selection
  277. },
  278. success: function(response) {
  279. _process = new OpenLayers.Format.WPSDescribeProcess().read(
  280. response.responseText
  281. ).processDescriptions[selection];
  282. console.log("Process:", _process);
  283. priv.buildForm();
  284. }
  285. });
  286. }
  287. });
  288. priv.getCapabilities();
  289. var style = new OpenLayers.Style();
  290. var rule = new OpenLayers.Rule({
  291. symbolizer: {strokeWidth: 4}
  292. });
  293. style.addRules([rule]);
  294. _layer = new OpenLayers.Layer.Vector("Warstwa rysowania", {
  295. strategies: [new OpenLayers.Strategy.BBOX(), new OpenLayers.Strategy.Cluster( {distance: 15, threshold: 2})],
  296. projection: new OpenLayers.Projection("EPSG:4326"),
  297. styleMap: new OpenLayers.StyleMap(style),
  298. protocol: new OpenLayers.Protocol.WFS({
  299. version: "1.1.0",
  300. srsName: "EPSG:4326",
  301. url: priv.options.wfsUrl,
  302. featureNS : "http://opengeo.org",
  303. featureType: "restricted",
  304. geometryName: "the_geom",
  305. schema: "http://demo.opengeo.org/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=og:restricted"
  306. })
  307. });
  308. var toolbar = new OpenLayers.Control.EditingToolbar(_layer);
  309. toolbar.addControls([new OpenLayers.Control.ModifyFeature(_layer, {
  310. title: "Wybierz",
  311. mode: OpenLayers.Control.ModifyFeature.DRAG | OpenLayers.Control.ModifyFeature.RESHAPE
  312. })]);
  313. var btnZoomToPoly = new OpenLayers.Control.Button({
  314. displayClass: "olControlZoomToPoly",
  315. title: "Zbliz",
  316. trigger:
  317. function() {
  318. var multiPolygon = OpenLayers.Geometry.fromWKT(
  319. "MULTIPOLYGON(((2072016.74395199 7234076.79293037,2072016.74395199 7234115.01144451,2072131.3994944 7234115.01144451,2072131.3994944 7234076.79293037,2072016.74395199 7234076.79293037)))"
  320. ).getBounds();
  321. map.zoomToExtent(multiPolygon);
  322. }
  323. });
  324. toolbar.addControls([btnZoomToPoly]);
  325. var btnRefresh = new OpenLayers.Control.Button({
  326. displayClass: "olControlRefresh",
  327. title: "Odswiez",
  328. trigger:
  329. function() {
  330. _layer.refresh({force:true});
  331. }
  332. });
  333. toolbar.addControls([btnRefresh]);
  334. var deleteFeatureControl = new OpenLayers.Control.SelectFeature(_layer, OpenLayers.Handler.Path, {
  335. clickout: false,
  336. toggle: false,
  337. displayClass: "olControlDelete",
  338. title: "Usun"
  339. });
  340. deleteFeatureControl.events.register("featurehighlighted", this, function(e) {
  341. if (confirm('Czy na pewno chcesz usunąć ten obiekt?')) {
  342. _layer.removeFeatures([e.feature]);
  343. deleteFeatureControl.deactivate();
  344. } else {
  345. deleteFeatureControl.unselect(e.feature);
  346. }
  347. });
  348. toolbar.addControls([deleteFeatureControl]);
  349. var extent = new OpenLayers.Bounds(
  350. 2035059.4410645328, 7200979.560689885, 2113330.958028555, 7279251.0776539035
  351. );
  352. var gphy = new OpenLayers.Layer.OSM("Mapa", null, {
  353. resolutions: [156543.03390625, 78271.516953125, 39135.7584765625,
  354. 19567.87923828125, 9783.939619140625, 4891.9698095703125,
  355. 2445.9849047851562, 1222.9924523925781, 611.4962261962891,
  356. 305.74811309814453, 152.87405654907226, 76.43702827453613,
  357. 38.218514137268066, 19.109257068634033, 9.554628534317017,
  358. 4.777314267158508, 2.388657133579254, 1.194328566789627,
  359. 0.5971642833948135, 0.25, 0.1, 0.05],
  360. serverResolutions: [156543.03390625, 78271.516953125, 39135.7584765625,
  361. 19567.87923828125, 9783.939619140625,
  362. 4891.9698095703125, 2445.9849047851562,
  363. 1222.9924523925781, 611.4962261962891,
  364. 305.74811309814453, 152.87405654907226,
  365. 76.43702827453613, 38.218514137268066,
  366. 19.109257068634033, 9.554628534317017,
  367. 4.777314267158508, 2.388657133579254,
  368. 1.194328566789627, 0.5971642833948135],
  369. transitionEffect: 'resize'
  370. });
  371. var map = new OpenLayers.Map(_nodeMapId, {
  372. projection: new OpenLayers.Projection("EPSG:4326"),
  373. displayProjection: new OpenLayers.Projection("EPSG:4326"),
  374. restrictedExtent: extent,
  375. controls: [
  376. toolbar,
  377. new OpenLayers.Control.ZoomPanel(),
  378. new OpenLayers.Control.PanPanel(),
  379. new OpenLayers.Control.LayerSwitcher(),
  380. new OpenLayers.Control.ScaleLine(),
  381. new OpenLayers.Control.KeyboardDefaults()
  382. // new OpenLayers.Control.MousePosition()
  383. ], layers: [gphy]
  384. });
  385. map.addLayer(_layer);
  386. map.events.register("zoomend", this, function(e) {
  387. var zoom = map.getZoom();
  388. console.log("Zoom = " + zoom);
  389. console.log(_layer.strategies[1]);
  390. if (zoom > 15 && _layer.strategies[1].active) {
  391. _layer.strategies[1].deactivate();
  392. _layer.refresh({force:true});
  393. } else if (zoom <= 15 && !_layer.strategies[1].active) {
  394. _layer.strategies[1].activate();
  395. _layer.refresh({force:true});
  396. }
  397. // map.addLayer(_layer);
  398. //} else if (zoom == 11){
  399. // var myLayer = map.getLayersByName('Warstwa rysowania');
  400. // myLayer[0].destroy();
  401. // _layer.destroy();
  402. // map.removeLayer(_layer, false);
  403. // console.log("costam: "+ map.getLayer());
  404. // map.addLayer(_layer);
  405. // _layer.setVisibility(false);
  406. // map.addLayer(_layer);
  407. // map.removeLayer(_layer, false);
  408. // map.refresh();
  409. });
  410. map.zoomToMaxExtent();
  411. };
  412. // using OpenLayers.Format.WPSCapabilities to read the capabilities
  413. priv.getCapabilities = function() {
  414. OpenLayers.Request.GET({
  415. url: priv.options.wpsUrl,
  416. params: {
  417. "SERVICE": "WPS",
  418. "REQUEST": "GetCapabilities"
  419. },
  420. success: function(response){
  421. _capabilities = new OpenLayers.Format.WPSCapabilities().read(
  422. response.responseText
  423. );
  424. var dropdown = _nodeProcesses;
  425. var offerings = _capabilities.processOfferings, option;
  426. // populate the dropdown
  427. for (var p in offerings) {
  428. option = document.createElement("option");
  429. option.innerHTML = offerings[p].identifier;
  430. option.value = p;
  431. dropdown.append(option);
  432. }
  433. }
  434. });
  435. };
  436. priv.buildForm = function() {
  437. _nodeAbstract.html(_process["abstract"]);
  438. _nodeInput.html("<h3>Input:</h3>");
  439. _nodeOutput.html('');
  440. var inputs = _process.dataInputs, supported = true,
  441. sld = "text/xml; subtype=sld/1.0.0",
  442. input;
  443. for (var i = 0, ii = inputs.length; i < ii; ++i) {
  444. input = inputs[i];
  445. if (input.complexData) {
  446. var formats = input.complexData.supported.formats;
  447. if (formats["application/wkt"]) {
  448. priv.addWKTInput(input);
  449. } else if (formats["text/xml; subtype=wfs-collection/1.0"]) {
  450. priv.addWFSCollectionInput(input);
  451. } else if (formats["image/tiff"]) {
  452. //priv.addRasterInput(input);
  453. } else if (formats[sld]) {
  454. priv.addXMLInput(input, sld);
  455. } else {
  456. supported = false;
  457. }
  458. } else if (input.boundingBoxData) {
  459. priv.addBoundingBoxInput(input);
  460. } else if (input.literalData) {
  461. priv.addLiteralInput(input);
  462. } else {
  463. supported = false;
  464. }
  465. if (input.minOccurs > 0) {
  466. _nodeInput.append(document.createTextNode("* "));
  467. }
  468. }
  469. if (supported) {
  470. var executeButton = document.createElement("button");
  471. executeButton.innerHTML = "Execute";
  472. _nodeInput.append(executeButton);
  473. executeButton.onclick = priv.execute;
  474. } else {
  475. _nodeInput.html('<span class="notsupported">' +
  476. "Sorry, the WPS builder does not support the selected process." +
  477. "</span>");
  478. }
  479. };
  480. // helper function to dynamically create a textarea for geometry (WKT) data
  481. // input
  482. priv.addWKTInput = function(input, previousSibling) {
  483. var name = input.identifier;
  484. var container = _nodeInput.get(0);
  485. var label = document.createElement("label");
  486. label["for"] = name;
  487. label.title = input["abstract"];
  488. label.innerHTML = name + " (select feature, then click field):";
  489. previousSibling && previousSibling.nextSibling ?
  490. container.insertBefore(label, previousSibling.nextSibling) :
  491. container.appendChild(label);
  492. var field = document.createElement("textarea");
  493. field.onclick = function () {
  494. if (_layer.selectedFeatures.length) {
  495. this.innerHTML = new OpenLayers.Format.WKT().write(
  496. _layer.selectedFeatures[0]
  497. );
  498. console.log('_layer.selectedFeatures[0]: ', _layer.selectedFeatures[0]);
  499. }
  500. priv.createCopy(input, this, priv.addWKTInput);
  501. };
  502. field.onblur = function() {
  503. input.data = field.value ? {
  504. complexData: {
  505. mimeType: "application/wkt",
  506. value: this.value
  507. }
  508. } : undefined;
  509. };
  510. field.title = input["abstract"];
  511. field.id = name;
  512. previousSibling && previousSibling.nextSibling ?
  513. container.insertBefore(field, previousSibling.nextSibling.nextSibling) :
  514. container.appendChild(field);
  515. };
  516. // helper function for xml input
  517. priv.addXMLInput = function(input, type) {
  518. var name = input.identifier;
  519. var field = document.createElement("input");
  520. field.title = input["abstract"];
  521. field.value = name + " (" + type + ")";
  522. field.onblur = function() {
  523. input.data = field.value ? {
  524. complexData: {
  525. mimeType: type,
  526. value: this.value
  527. }
  528. } : undefined;
  529. };
  530. _nodeInput.append(field);
  531. };
  532. // helper function to dynamically create a WFS collection reference input
  533. priv.addWFSCollectionInput = function(input) {
  534. var name = input.identifier;
  535. var field = document.createElement("input");
  536. field.title = input["abstract"];
  537. field.value = name + " (layer on demo server)";
  538. priv.addValueHandlers(field, function() {
  539. input.reference = field.value ? {
  540. mimeType: "text/xml; subtype=wfs-collection/1.0",
  541. href: "http://geoserver/wfs",
  542. method: "POST",
  543. body: {
  544. wfs: {
  545. version: "1.0.0",
  546. outputFormat: "GML2",
  547. featureType: field.value
  548. }
  549. }
  550. } : undefined;
  551. });
  552. _nodeInput.append(field);
  553. };
  554. // helper function to dynamically create a raster (GeoTIFF) url input
  555. priv.addRasterInput = function(input) {
  556. var name = input.identifier;
  557. var field = document.createElement("input");
  558. field.title = input["abstract"];
  559. var url = window.location.href.split("?")[0];
  560. field.value = url.substr(0, url.lastIndexOf("/")+1) + "data/tazdem.tiff";// TODO: file path to options
  561. document.getElementById("input").appendChild(field);
  562. (field.onblur = function() {
  563. input.reference = {
  564. mimeType: "image/tiff",
  565. href: field.value,
  566. method: "GET"
  567. };
  568. })();
  569. };
  570. // helper function to dynamically create a bounding box input
  571. priv.addBoundingBoxInput = function(input) {
  572. var name = input.identifier;
  573. var field = document.createElement("input");
  574. field.title = input["abstract"];
  575. field.value = "left,bottom,right,top (EPSG:4326)";
  576. _nodeInput.append(field);
  577. priv.addValueHandlers(field, function() {
  578. input.boundingBoxData = {
  579. projection: "EPSG:4326",
  580. bounds: OpenLayers.Bounds.fromString(field.value)
  581. };
  582. });
  583. };
  584. // helper function to create a literal input textfield or dropdown
  585. priv.addLiteralInput = function(input, previousSibling) {
  586. var name = input.identifier;
  587. var container = _nodeInput.get(0);
  588. var anyValue = input.literalData.anyValue;
  589. // anyValue means textfield, otherwise we create a dropdown
  590. var field = document.createElement(anyValue ? "input" : "select");
  591. field.id = name;
  592. field.title = input["abstract"];
  593. previousSibling && previousSibling.nextSibling ?
  594. container.insertBefore(field, previousSibling.nextSibling) :
  595. container.appendChild(field);
  596. if (anyValue) {
  597. var dataType = input.literalData.dataType;
  598. field.value = name + (dataType ? " (" + dataType + ")" : "");
  599. priv.addValueHandlers(field, function() {
  600. input.data = field.value ? {
  601. literalData: {
  602. value: field.value
  603. }
  604. } : undefined;
  605. priv.createCopy(input, field, priv.addLiteralInput);
  606. });
  607. } else {
  608. var option;
  609. option = document.createElement("option");
  610. option.innerHTML = name;
  611. field.appendChild(option);
  612. for (var v in input.literalData.allowedValues) {
  613. option = document.createElement("option");
  614. option.value = v;
  615. option.innerHTML = v;
  616. field.appendChild(option);
  617. }
  618. field.onchange = function() {
  619. priv.createCopy(input, field, priv.addLiteralInput);
  620. input.data = this.selectedIndex ? {
  621. literalData: {
  622. value: this.options[this.selectedIndex].value
  623. }
  624. } : undefined;
  625. };
  626. }
  627. };
  628. // if maxOccurs is > 1, this will add a copy of the field
  629. priv.createCopy = function(input, field, fn) {
  630. if (input.maxOccurs && input.maxOccurs > 1 && !field.userSelected) {
  631. // add another copy of the field - we don't check maxOccurs
  632. field.userSelected = true;
  633. var newInput = OpenLayers.Util.extend({}, input);
  634. // we recognize copies by the occurrence property
  635. newInput.occurrence = (input.occurrence || 0) + 1;
  636. _process.dataInputs.push(newInput);
  637. fn(newInput, field);
  638. }
  639. };
  640. // helper function for adding events to form fields
  641. priv.addValueHandlers = function(field, onblur) {
  642. field.onclick = function() {
  643. if (!this.initialValue) {
  644. this.initialValue = this.value;
  645. this.value = "";
  646. }
  647. };
  648. field.onblur = function() {
  649. if (!this.value) {
  650. this.value = this.initialValue;
  651. delete this.initialValue;
  652. }
  653. onblur.apply(this, arguments);
  654. };
  655. };
  656. // execute the process
  657. priv.execute = function() {
  658. var output = _process.processOutputs[0];
  659. var input;
  660. // remove occurrences that the user has not filled out
  661. for (var i = _process.dataInputs.length - 1; i >= 0; --i) {
  662. input = _process.dataInputs[i];
  663. if ((input.minOccurs === 0 || input.occurrence) && !input.data && !input.reference) {
  664. OpenLayers.Util.removeItem(_process.dataInputs, input);
  665. }
  666. }
  667. _process.responseForm = {
  668. rawDataOutput: {
  669. identifier: output.identifier
  670. }
  671. };
  672. if (output.complexOutput && output.complexOutput.supported.formats["application/wkt"]) {
  673. _process.responseForm.rawDataOutput.mimeType = "application/wkt";
  674. }
  675. OpenLayers.Request.POST({
  676. url: priv.options.wpsUrl,
  677. data: new OpenLayers.Format.WPSExecute().write(_process),
  678. success: priv.showOutput
  679. });
  680. }
  681. // add the process's output to the page
  682. priv.showOutput = function(response) {
  683. var result = _nodeOutput.get(0);
  684. result.innerHTML = "<h3>Output:</h3>";
  685. var features;
  686. var contentType = response.getResponseHeader("Content-Type");
  687. if (contentType == "application/wkt") {
  688. features = new OpenLayers.Format.WKT().read(response.responseText);
  689. } else if (contentType == "text/xml; subtype=wfs-collection/1.0") {
  690. features = new OpenLayers.Format.WFST.v1_0_0().read(response.responseText);
  691. }
  692. if (features && (features instanceof OpenLayers.Feature.Vector || features.length)) {
  693. _layer.addFeatures(features);
  694. result.innerHTML += "The result should also be visible on the map.";
  695. }
  696. result.innerHTML += "<textarea>" + response.responseText + "</textarea>";
  697. }
  698. publ.init = function(options) {
  699. if (priv.options.debug) console.log('TableAjaxMap initialization...');
  700. //merge supplied options with defaults
  701. $.extend(priv.options, defaults, options);
  702. priv.init();
  703. return publ;
  704. };
  705. return publ;
  706. };
  707. $.fn.TableAjaxMap = function(options) {
  708. options = options || {};
  709. return this.each(function() {
  710. options.id = this;
  711. $(this).data('TableAjaxMap', new TableAjaxMap().init(options));
  712. });
  713. return this;
  714. };
  715. }(jQuery));
  716. </script>
  717. <script>
  718. OpenLayers.ProxyHost = "index.php?FUNCTION_INIT=<?php echo __FUNCTION__; ?>&HEADER_NOT_INIT=YES&task=proxy&url=";
  719. jQuery('#TreeTableMap').TableAjaxMap({
  720. wpsUrl: 'http://biuro.biall-net.pl/wps',
  721. wfsUrl: 'http://biuro.biall-net.pl/wps'
  722. });
  723. </script>
  724. <?php
  725. }
  726. class WpsActionBase {
  727. public $title = '';
  728. public $description = '';
  729. public $dataInputs = array();
  730. public function execute($args) {
  731. var_dump($args);
  732. }
  733. }
  734. class WpsActionPrzypiszDoRekordu extends WpsActionBase {
  735. public function __construct() {
  736. $this->title = 'Przypisz';
  737. $this->description = 'Przypisuje położenie do wybranego rekordu w tabeli.';
  738. $this->dataInputs['geom'] = new stdClass();
  739. $this->dataInputs['geom']->title = 'geom';
  740. $this->dataInputs['geom']->description = 'Input geometry';
  741. $this->dataInputs['geom']->type = 'geom';// CoomplexData
  742. $this->dataInputs['idTable'] = new stdClass();
  743. $this->dataInputs['idTable']->title = 'geom';
  744. $this->dataInputs['idTable']->description = 'Table ID';
  745. $this->dataInputs['idTable']->type = 'integer';// LiteralData: xs:integer
  746. $this->dataInputs['idRecord'] = new stdClass();
  747. $this->dataInputs['idRecord']->title = 'idRecord';
  748. $this->dataInputs['idRecord']->description = 'Record ID';
  749. $this->dataInputs['idRecord']->type = 'integer';// LiteralData: xs:integer
  750. }
  751. }
  752. class WfsAction {
  753. /**
  754. * example: MULTIPOLYGON(((2072016.74395199 7234076.79293037,2072016.74395199 7234115.01144451,2072131.3994944 7234115.01144451,2072131.3994944 7234076.79293037,2072016.74395199 7234076.79293037)))
  755. */
  756. public function generateGmlFromWKT($wkt) {
  757. $gml = '';
  758. $wktParts = explode('(', $wkt, 2);
  759. ob_start();
  760. switch ($wktParts[0]) {
  761. case 'MULTIPOLYGON':
  762. case 'POLYGON': {
  763. $points = trim($wktParts[1], '() ');
  764. $points = str_replace(',', "\n", $points);
  765. ?>
  766. <gml:boundedBy>
  767. <gml:Envelope srsDimension="2" srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
  768. <gml:lowerCorner>-180 -90</gml:lowerCorner>
  769. <gml:upperCorner>180 90</gml:upperCorner>
  770. </gml:Envelope>
  771. </gml:boundedBy>
  772. <og:the_geom>
  773. <gml:MultiSurface srsDimension="2" srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
  774. <gml:surfaceMember>
  775. <gml:Polygon srsDimension="2">
  776. <gml:exterior>
  777. <gml:LinearRing srsDimension="2">
  778. <gml:posList>
  779. <?php echo $points; ?>
  780. </gml:posList>
  781. </gml:LinearRing>
  782. </gml:exterior>
  783. </gml:Polygon>
  784. </gml:surfaceMember>
  785. </gml:MultiSurface>
  786. </og:the_geom>
  787. <?php
  788. }
  789. break;
  790. default:
  791. }
  792. $gml = ob_get_contents();
  793. ob_clean();
  794. return $gml;
  795. }
  796. public function execute($args) {
  797. /*
  798. * Mapa odczytywanie punktów: http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/
  799. *
  800. * CI50:
  801. 18.613243103027344 54.33614429135817
  802. 18.613243103027344 54.33634445792519
  803. 18.614273071289062 54.33634445792519
  804. 18.614273071289062 54.33614429135817
  805. */
  806. $tblId = 16;// `BUILDINGS`
  807. $buildingsGml = array();
  808. $db = DB::getDB();
  809. $sql = "select b.`ID`, AsWKT(b.`the_geom`) as the_geom
  810. from `BUILDINGS` as b
  811. where b.`the_geom` is not null and b.`the_geom`!=''
  812. limit 10;
  813. ";
  814. $res = $db->query($sql);
  815. while ($r = $db->fetch($res)) {
  816. $buildingsGml[$r->ID] = $this->generateGmlFromWKT($r->the_geom);
  817. }
  818. /**
  819. * <og:recordId><?php echo $kId; ?></og:recordId>
  820. * <og:tblId><?php echo $tblId; ?></og:tblId>
  821. *
  822. * goes to js: @see priv.addWKTInput _layer.selectedFeatures[0]
  823. *
  824. * attributes: Object
  825. recordId: "1130"
  826. tblId: "16"
  827. */
  828. echo '<?xml version="1.0" encoding="UTF-8"?>';
  829. ?>
  830. <wfs:FeatureCollection xmlns:nasa="http://nasa.gov" xmlns:topp="http://www.openplans.org/topp" xmlns:usgs="http://www.usgs.gov/" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wfs="http://www.opengis.net/wfs" xmlns:ows="http://www.opengis.net/ows" xmlns:ne="http://naturalearthdata.com" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml" xmlns:osm="http://openstreemap.org" xmlns:nurc="http://www.nurc.nato.int" xmlns:og="http://opengeo.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" numberOfFeatures="4" timeStamp="2014-07-16T13:22:43.307Z" xsi:schemaLocation="http://opengeo.org http://demo.opengeo.org:80/geoserver/wfs?service=WFS&amp;version=1.1.0&amp;request=DescribeFeatureType&amp;typeName=og%3Arestricted http://www.opengis.net/wfs http://demo.opengeo.org:80/geoserver/schemas/wfs/1.1.0/wfs.xsd">
  831. <gml:boundedBy>
  832. <gml:Envelope srsDimension="2" srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
  833. <gml:lowerCorner>-180 -90</gml:lowerCorner>
  834. <gml:upperCorner>180 90</gml:upperCorner>
  835. </gml:Envelope>
  836. </gml:boundedBy>
  837. <gml:featureMembers>
  838. <?php foreach ($buildingsGml as $kId => $vGml) : ?>
  839. <og:restricted gml:id="restricted.<?php echo $kId; ?>">
  840. <?php echo $vGml; ?>
  841. <og:recordId><?php echo $kId; ?></og:recordId>
  842. <og:tblId><?php echo $tblId; ?></og:tblId>
  843. </og:restricted>
  844. <?php endforeach; ?>
  845. </gml:featureMembers>
  846. </wfs:FeatureCollection>
  847. <?php
  848. }
  849. }
  850. class WpsServer {
  851. private $_fun;// config for identifiers
  852. public function __construct() {
  853. $this->_fun['przypiszDoRekordu'] = new WpsActionPrzypiszDoRekordu();
  854. $this->_wfsAction = new WfsAction();
  855. }
  856. public function parseXMLRequest() {
  857. $data = array();
  858. $reqContent = file_get_contents('php://input');
  859. $xml = new SimpleXMLElement($reqContent);
  860. if ('GetFeature' == $xml->getName()) {
  861. // TODO: parse xml and set query params
  862. $this->_wfsAction->execute($data);
  863. }
  864. else if (isset($xml->children('ows', TRUE)->Identifier)) {
  865. $identifier = (string)$xml->children('ows', TRUE)->Identifier;
  866. if (array_key_exists($identifier, $this->_fun)) {
  867. foreach ($xml->children('wps', TRUE)->DataInputs->children('wps', TRUE) as $input) {
  868. $inputIdentifier = (string)$input->children('ows', TRUE)->Identifier;
  869. if (array_key_exists($inputIdentifier, $this->_fun[$identifier]->dataInputs)) {
  870. $inputType = (string)$this->_fun[$identifier]->dataInputs[$inputIdentifier]->type;
  871. switch ($inputType) {
  872. case 'integer':
  873. $data[$inputIdentifier] = (string)$input->children('wps', TRUE)->Data->LiteralData;
  874. break;
  875. case 'geom':
  876. $data[$inputIdentifier] = (string)$input->children('wps', TRUE)->Data->ComplexData;
  877. break;
  878. default:
  879. }
  880. } else {
  881. // brak zdefiniowanego inputa
  882. }
  883. }
  884. $this->_fun['przypiszDoRekordu']->execute($data);
  885. } else {
  886. echo "TODO: brak zdefiniowanej funkcji '{$identifier}'";
  887. var_dump($identifier);
  888. }
  889. }
  890. else {
  891. echo "TODO: '" . $xml->getName() . "' ...";
  892. }
  893. }
  894. public function getCapabilitiesAction() {
  895. echo '<?xml version="1.0" encoding="UTF-8"?>';
  896. ?>
  897. <wps:Capabilities xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="en" service="WPS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">
  898. <ows:ServiceIdentification>
  899. <ows:Title>Prototype GeoServer WPS</ows:Title>
  900. <ows:Abstract />
  901. <ows:Keywords>
  902. <ows:Keyword>wps</ows:Keyword>
  903. <ows:Keyword>geoserver</ows:Keyword>
  904. </ows:Keywords>
  905. <ows:ServiceType>WPS</ows:ServiceType>
  906. <ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
  907. <ows:Fees>NONE</ows:Fees>
  908. <ows:AccessConstraints>NONE</ows:AccessConstraints>
  909. </ows:ServiceIdentification>
  910. <ows:ServiceProvider>
  911. <ows:ProviderName>GeoServer</ows:ProviderName>
  912. <ows:ProviderSite />
  913. <ows:ServiceContact />
  914. </ows:ServiceProvider>
  915. <ows:OperationsMetadata>
  916. <ows:Operation name="GetCapabilities">
  917. <ows:DCP>
  918. <ows:HTTP>
  919. <ows:Get xlink:href="http://demo.opengeo.org:80/geoserver/wps" />
  920. <ows:Post xlink:href="http://demo.opengeo.org:80/geoserver/wps" />
  921. </ows:HTTP>
  922. </ows:DCP>
  923. </ows:Operation>
  924. <ows:Operation name="DescribeProcess">
  925. <ows:DCP>
  926. <ows:HTTP>
  927. <ows:Get xlink:href="http://demo.opengeo.org:80/geoserver/wps" />
  928. <ows:Post xlink:href="http://demo.opengeo.org:80/geoserver/wps" />
  929. </ows:HTTP>
  930. </ows:DCP>
  931. </ows:Operation>
  932. <ows:Operation name="Execute">
  933. <ows:DCP>
  934. <ows:HTTP>
  935. <ows:Get xlink:href="http://demo.opengeo.org:80/geoserver/wps" />
  936. <ows:Post xlink:href="http://demo.opengeo.org:80/geoserver/wps" />
  937. </ows:HTTP>
  938. </ows:DCP>
  939. </ows:Operation>
  940. </ows:OperationsMetadata>
  941. <wps:ProcessOfferings>
  942. <?php foreach($this->_fun as $kFun => $vFun) : ?>
  943. <wps:Process wps:processVersion="1.0.0">
  944. <ows:Identifier><?php echo $kFun; ?></ows:Identifier>
  945. <ows:Title><?php echo $vFun->title; ?></ows:Title>
  946. <ows:Abstract><?php echo $vFun->description; ?></ows:Abstract>
  947. </wps:Process>
  948. <?php endforeach; ?>
  949. </wps:ProcessOfferings>
  950. <wps:Languages>
  951. <wps:Default>
  952. <ows:Language>en-US</ows:Language>
  953. </wps:Default>
  954. <wps:Supported>
  955. <ows:Language>en-US</ows:Language>
  956. </wps:Supported>
  957. </wps:Languages>
  958. </wps:Capabilities>
  959. <?php
  960. }
  961. public function describeProcessAction($args) {
  962. // TODO: xml z opiesem procese $args['IDENTIFIER']
  963. /**
  964. * should work like JTS:densify - geom field (map object) and integer field (record ID)
  965. * http://openlayers.org/dev/examples/proxy.cgi?url=http%3A%2F%2Fdemo.opengeo.org%2Fgeoserver%2Fwps%3FSERVICE%3DWPS%26REQUEST%3DDescribeProcess%26VERSION%3D1.0.0%26IDENTIFIER%3DJTS%253Adensify
  966. * http://demo.opengeo.org/geoserver/wps?SERVICE=WPS&REQUEST=DescribeProcess&VERSION=1.0.0&IDENTIFIER=JTS%3Adensify
  967. */
  968. echo '<?xml version="1.0" encoding="UTF-8"?>';
  969. if (array_key_exists($args['IDENTIFIER'], $this->_fun)) {
  970. $identifier = $this->_fun[$args['IDENTIFIER']];
  971. ?>
  972. <wps:ProcessDescriptions xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="en" service="WPS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">
  973. <ProcessDescription wps:processVersion="1.0.0" statusSupported="true" storeSupported="true">
  974. <ows:Identifier><?php echo $args['IDENTIFIER']; ?></ows:Identifier>
  975. <ows:Title><?php echo $identifier->title; ?></ows:Title>
  976. <ows:Abstract><?php echo $identifier->description; ?></ows:Abstract>
  977. <DataInputs>
  978. <?php foreach ($identifier->dataInputs as $kInput => $vInput) : ?>
  979. <Input maxOccurs="1" minOccurs="1">
  980. <ows:Identifier><?php echo $kInput; ?></ows:Identifier>
  981. <ows:Title><?php echo $vInput->title; ?></ows:Title>
  982. <ows:Abstract><?php echo $vInput->description; ?></ows:Abstract>
  983. <?php if ($vInput->type == 'geom') : ?>
  984. <ComplexData>
  985. <Default>
  986. <Format>
  987. <MimeType>text/xml; subtype=gml/3.1.1</MimeType>
  988. </Format>
  989. </Default>
  990. <Supported>
  991. <Format>
  992. <MimeType>text/xml; subtype=gml/3.1.1</MimeType>
  993. </Format>
  994. <Format>
  995. <MimeType>text/xml; subtype=gml/2.1.2</MimeType>
  996. </Format>
  997. <Format>
  998. <MimeType>application/wkt</MimeType>
  999. </Format>
  1000. <Format>
  1001. <MimeType>application/gml-3.1.1</MimeType>
  1002. </Format>
  1003. <Format>
  1004. <MimeType>application/gml-2.1.2</MimeType>
  1005. </Format>
  1006. </Supported>
  1007. </ComplexData>
  1008. <?php elseif ($vInput->type == 'integer') : ?>
  1009. <LiteralData>
  1010. <ows:DataType>xs:integer</ows:DataType>
  1011. <ows:AnyValue />
  1012. </LiteralData>
  1013. <?php else : ?>
  1014. <?php endif; ?>
  1015. </Input>
  1016. <?php endforeach; ?>
  1017. </DataInputs>
  1018. <ProcessOutputs>
  1019. <Output>
  1020. <ows:Identifier>result</ows:Identifier>
  1021. <ows:Title>result</ows:Title>
  1022. <ComplexOutput>
  1023. <Default>
  1024. <Format>
  1025. <MimeType>text/xml; subtype=gml/3.1.1</MimeType>
  1026. </Format>
  1027. </Default>
  1028. <Supported>
  1029. <Format>
  1030. <MimeType>text/xml; subtype=gml/3.1.1</MimeType>
  1031. </Format>
  1032. <Format>
  1033. <MimeType>text/xml; subtype=gml/2.1.2</MimeType>
  1034. </Format>
  1035. <Format>
  1036. <MimeType>application/wkt</MimeType>
  1037. </Format>
  1038. <Format>
  1039. <MimeType>application/gml-3.1.1</MimeType>
  1040. </Format>
  1041. <Format>
  1042. <MimeType>application/gml-2.1.2</MimeType>
  1043. </Format>
  1044. </Supported>
  1045. </ComplexOutput>
  1046. </Output>
  1047. </ProcessOutputs>
  1048. </ProcessDescription>
  1049. </wps:ProcessDescriptions>
  1050. <?php
  1051. } else {
  1052. echo 'TODO: brak funkcji';
  1053. }
  1054. }
  1055. }