GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-d6dec75dd4
parser_wps.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <ctype.h>
5 
6 #include <grass/config.h>
7 #include <grass/gis.h>
8 #include <grass/glocale.h>
9 
10 #if defined(HAVE_LANGINFO_H)
11 #include <langinfo.h>
12 #endif
13 #if defined(__MINGW32__) && defined(USE_NLS)
14 #include <localcharset.h>
15 #endif
16 
17 #include "parser_local_proto.h"
18 
19 /* Defines and prototypes for WPS process_description XML document generation
20  */
21 #define TYPE_OTHER -1
22 #define TYPE_RASTER 0
23 #define TYPE_VECTOR 1
24 #define TYPE_PLAIN_TEXT 2
25 #define TYPE_RANGE 3
26 #define TYPE_LIST 4
27 #define TYPE_STDS \
28  5 /* Space time datasets of type raster, raster3d and vector */
29 #define TYPE_STRDS 6 /* Space time raster datasets */
30 #define TYPE_STVDS 7 /* Space time vector datasets */
31 #define WPS_INPUT 0
32 #define WPS_OUTPUT 1
33 
34 static void wps_print_mimetype_text_plain(void);
35 static void wps_print_mimetype_raster_tiff(void);
36 static void wps_print_mimetype_raster_tiff_other(void);
37 static void wps_print_mimetype_raster_png(void);
38 static void wps_print_mimetype_raster_gif(void);
39 static void wps_print_mimetype_raster_jpeg(void);
40 static void wps_print_mimetype_raster_hfa(void);
41 static void wps_print_mimetype_raster_netCDF(void);
42 static void wps_print_mimetype_raster_netCDF_other(void);
43 static void wps_print_mimetype_vector_gml311(void);
44 static void wps_print_mimetype_vector_gml311_appl(void);
45 static void wps_print_mimetype_vector_gml212(void);
46 static void wps_print_mimetype_vector_gml212_appl(void);
47 static void wps_print_mimetype_vector_kml22(void);
48 static void wps_print_mimetype_vector_dgn(void);
49 static void wps_print_mimetype_vector_shape(void);
50 static void wps_print_mimetype_vector_zipped_shape(void);
51 
52 #if 0 /* unused */
53 static void wps_print_mimetype_raster_grass_binary(void);
54 static void wps_print_mimetype_raster_grass_ascii(void);
55 static void wps_print_mimetype_vector_grass_ascii(void);
56 static void wps_print_mimetype_vector_grass_binary(void);
57 #endif
58 
59 static void wps_print_mimetype_space_time_datasets(void);
60 static void wps_print_mimetype_space_time_raster_datasets(void);
61 static void wps_print_mimetype_space_time_vector_datasets(void);
62 static void wps_print_mimetype_space_time_vector_datasets_tar(void);
63 static void wps_print_mimetype_space_time_raster_datasets_tar(void);
64 static void wps_print_mimetype_space_time_vector_datasets_tar_gz(void);
65 static void wps_print_mimetype_space_time_raster_datasets_tar_gz(void);
66 static void wps_print_mimetype_space_time_vector_datasets_tar_bz2(void);
67 static void wps_print_mimetype_space_time_raster_datasets_tar_bz2(void);
68 
69 static void wps_print_process_descriptions_begin(void);
70 static void wps_print_process_descriptions_end(void);
71 static void wps_print_process_description_begin(int, int, const char *,
72  const char *, const char *,
73  const char **, int);
74 static void wps_print_process_description_end(void);
75 static void wps_print_data_inputs_begin(void);
76 static void wps_print_data_inputs_end(void);
77 static void wps_print_process_outputs_begin(void);
78 static void wps_print_process_outputs_end(void);
79 static void wps_print_bounding_box_data(void);
80 static void wps_print_ident_title_abstract(const char *, const char *,
81  const char *);
82 static void wps_print_complex_input(int, int, const char *, const char *,
83  const char *, int, int);
84 static void wps_print_complex_output(const char *, const char *, const char *,
85  int);
86 static void wps_print_comlpex_input_output(int, int, int, const char *,
87  const char *, const char *, int,
88  int);
89 static void wps_print_literal_input_output(int, int, int, const char *,
90  const char *, const char *,
91  const char *, int, const char **,
92  int, const char *, int);
93 
94 static void print_escaped_for_xml(FILE *fp, const char *str)
95 {
96  for (; *str; str++) {
97  switch (*str) {
98  case '&':
99  fputs("&amp;", fp);
100  break;
101  case '<':
102  fputs("&lt;", fp);
103  break;
104  case '>':
105  fputs("&gt;", fp);
106  break;
107  default:
108  fputc(*str, fp);
109  }
110  }
111 }
112 
113 /*!
114  * \brief Print the WPS 1.0.0 process description XML document to stdout
115  *
116  * A module started with the parameter "--wps-process-description"
117  * will write a process description XML document to stdout and exit.
118  *
119  * Currently only raster and vector modules are supported, but the
120  * generation works with any module (more or less meaningful).
121  * Most of the input options are caught:
122  * * single and multiple raster and vector maps
123  * * single and multiple string, float and integer data with default
124  * values and value options (range is missing)
125  * Flags are supported as boolean values.
126  *
127  * The mime types for vector maps are GML, KML, dgn, shape and zipped shape.
128  *
129  * The mime types for raster maps are tiff, geotiff, hfa, netcdf, gif, jpeg and
130  * png.
131  *
132  * Mime types for space time datasets are tar archives with gz, bzip or without
133  * compression
134  *
135  * The mime types are reflecting the capabilities of grass and gdal and may be
136  * extended.
137  *
138  * BoundignBox support is currently not available for inputs and outputs.
139  * Literal data output (string, float or integer) is currently not supported.
140  *
141  * In case no output parameter was set (new raster of vector map) the stdout
142  * output is noticed as output parameter of mime type text/plain.
143  *
144  * Multiple vector or raster map outputs marked as one option are not supported
145  * (wps 1.0.0 specification does not allow multiple outputs with only one
146  * identifier). Multiple outputs must be wrapped via a python script or created
147  * as group.
148  *
149  * In future the following mimetypes may be supported
150  * mime type: application/grass-vector-ascii -> a text file generated with
151  * v.out.asci Example.: urn:file:///path/name mime type:
152  * application/grass-vector-binary -> the binary vectors must be addressed with
153  * a non standard urn: Example: urn:grass:vector:location/mapset/name
154  * */
155 
157 {
158  struct Option *opt;
159  struct Flag *flag;
160  char *type;
161  char *s, *top;
162  const char *value = NULL;
163  int i;
164  const char *encoding;
165 
166  /* int new_prompt = 0; */
167  int store = 1;
168  int status = 1;
169  const char *identifier = NULL;
170  const char *title = NULL;
171  const char *abstract = NULL;
172  const char **keywords = NULL;
173  int data_type, is_input, is_output;
174  int num_raster_inputs = 0, num_raster_outputs = 0;
175  int num_strds_inputs = 0, num_strds_outputs = 0;
176  int min = 0, max = 0;
177  int num_keywords = 0;
178  int found_output = 0;
179  int is_tuple; /* Checks the key_descr for comma separated values */
180  int num_tuples; /* Counts the "," in key_descr */
181 
182  /* new_prompt = G__uses_new_gisprompt(); */
183 
184  /* gettext converts strings to encoding returned by nl_langinfo(CODESET) */
185 
186 #if defined(HAVE_LANGINFO_H)
187  encoding = nl_langinfo(CODESET);
188  if (!encoding || strlen(encoding) == 0) {
189  encoding = "UTF-8";
190  }
191 #elif defined(__MINGW32__) && defined(USE_NLS)
192  encoding = locale_charset();
193  if (!encoding || strlen(encoding) == 0) {
194  encoding = "UTF-8";
195  }
196 #else
197  encoding = "UTF-8";
198 #endif
199 
200  if (!st->pgm_name)
201  st->pgm_name = G_program_name();
202  if (!st->pgm_name)
203  st->pgm_name = "??";
204 
205  /* the identifier of the process is the module name */
206  identifier = st->pgm_name;
207 
208  if (st->module_info.description) {
209  title = st->module_info.description;
210  abstract = st->module_info.description;
211  }
212 
213  if (st->module_info.keywords) {
214  keywords = st->module_info.keywords;
215  num_keywords = st->n_keys;
216  }
217 
218  wps_print_process_descriptions_begin();
219  /* store and status are supported as default. The WPS server should change
220  * this if necessary */
221  wps_print_process_description_begin(store, status, identifier, title,
222  abstract, keywords, num_keywords);
223  wps_print_data_inputs_begin();
224 
225  /* Print the bounding box element with all the coordinate reference systems,
226  * which are supported by grass */
227  /* Currently Disabled! A list of all proj4 supported EPSG coordinate
228  * reference systems must be implemented */
229  if (1 == 0)
230  wps_print_bounding_box_data();
231 
232  /* We parse only the inputs at the beginning */
233  if (st->n_opts) {
234  opt = &st->first_option;
235  while (opt != NULL) {
236 
237  identifier = NULL;
238  title = NULL;
239  abstract = NULL;
240  keywords = NULL;
241  num_keywords = 0;
242  value = NULL;
243  is_input = 1;
244  is_output = 0;
245  is_tuple = 0;
246  num_tuples = 0;
247  data_type = TYPE_OTHER;
248 
249  /* Check the gisprompt */
250  if (opt->gisprompt) {
251  const char *atts[] = {"age", "element", "prompt", NULL};
252  top = G_calloc(strlen(opt->gisprompt) + 1, 1);
253  strcpy(top, opt->gisprompt);
254  s = strtok(top, ",");
255  for (i = 0; s != NULL && atts[i] != NULL; i++) {
256 
257  char *token = G_store(s);
258 
259  /* we print only input parameter, sort out the output
260  * parameter */
261  if (strcmp(token, "new") == 0) {
262  is_input = 0;
263  is_output = 1;
264  }
265  if (strcmp(token, "raster") == 0) {
266  data_type = TYPE_RASTER;
267  /* Count the raster inputs and outputs for default
268  * option creation */
269  if (is_input == 1)
270  num_raster_inputs++;
271  if (is_output == 1)
272  num_raster_outputs++;
273  }
274  if (strcmp(token, "vector") == 0) {
275  data_type = TYPE_VECTOR;
276  }
277  /* Modules may have different types of space time datasets
278  * as inputs */
279  if (strcmp(token, "stds") == 0) {
280  data_type = TYPE_STDS;
281  }
282  if (strcmp(token, "strds") == 0) {
283  data_type = TYPE_STRDS;
284  if (is_input == 1)
285  num_strds_inputs++;
286  if (is_output == 1)
287  num_strds_outputs++;
288  }
289  if (strcmp(token, "stvds") == 0) {
290  data_type = TYPE_STVDS;
291  }
292  if (strcmp(token, "file") == 0) {
293  data_type = TYPE_PLAIN_TEXT;
294  }
295  s = strtok(NULL, ",");
296  G_free(token);
297  }
298  G_free(top);
299  }
300 
301  /* Check the key description */
302  if (opt->key_desc) {
303  top = G_calloc(strlen(opt->key_desc) + 1, 1);
304  strcpy(top, opt->key_desc);
305  s = strtok(top, ",");
306  /* Count comma's */
307  for (i = 0; s != NULL; i++) {
308  num_tuples++;
309  s = strtok(NULL, ",");
310  }
311  if (num_tuples > 1)
312  is_tuple = 1;
313 
314  G_free(top);
315  }
316  /* We have an input option */
317  if (is_input == 1) {
318  switch (opt->type) {
319  case TYPE_INTEGER:
320  type = "integer";
321  break;
322  case TYPE_DOUBLE:
323  type = "float";
324  break;
325  case TYPE_STRING:
326  type = "string";
327  break;
328  default:
329  type = "string";
330  break;
331  }
332 
333  identifier = opt->key;
334 
335  if (opt->required == YES) {
336  if (is_tuple)
337  min = num_tuples;
338  else
339  min = 1;
340  }
341  else {
342  min = 0;
343  }
344 
345  if (opt->multiple == YES) {
346  max = 1024;
347  }
348  else {
349  if (is_tuple)
350  max = num_tuples;
351  else
352  max = 1;
353  }
354 
355  if (opt->label) {
356  title = opt->label;
357  }
358  if (opt->description) {
359  if (!opt->label)
360  title = opt->description;
361  else
362  abstract = opt->description;
363  }
364  if (opt->def) {
365  value = opt->def;
366  }
367  if (opt->options) {
368  /* TODO:
369  * add something like
370  * <range min="xxx" max="xxx"/>
371  * to <values> */
372  i = 0;
373  while (opt->opts[i]) {
374  i++;
375  }
376  keywords = opt->opts;
377  num_keywords = i;
378  }
379  if (data_type == TYPE_RASTER || data_type == TYPE_VECTOR ||
380  data_type == TYPE_STRDS || data_type == TYPE_STVDS ||
381  data_type == TYPE_STDS || data_type == TYPE_PLAIN_TEXT) {
382  /* 2048 is the maximum size of the map in mega bytes */
383  wps_print_complex_input(min, max, identifier, title,
384  abstract, 2048, data_type);
385  }
386  else {
387  /* The keyword array is missused for options, type means the
388  * type of the value (integer, float ... ) */
389  wps_print_literal_input_output(
390  WPS_INPUT, min, max, identifier, title, abstract, type,
391  0, keywords, num_keywords, value, TYPE_OTHER);
392  }
393  }
394  opt = opt->next_opt;
395  }
396  }
397 
398  /* Flags are always input options and can be false or true (boolean) */
399  if (st->n_flags) {
400  flag = &st->first_flag;
401  while (flag != NULL) {
402 
403  /* The identifier is the flag "-x" */
404  char *ident = (char *)G_calloc(3, sizeof(char));
405 
406  ident[0] = '-';
407  ident[1] = flag->key;
408  ident[2] = '\0';
409  title = NULL;
410  abstract = NULL;
411 
412  if (flag->description) {
413  title = flag->description;
414  abstract = flag->description;
415  }
416  const char *val[] = {"true", "false"};
417  wps_print_literal_input_output(WPS_INPUT, 0, 1, ident, title, NULL,
418  "boolean", 0, val, 2, "false",
419  TYPE_OTHER);
420  flag = flag->next_flag;
421  }
422  }
423 
424  /* We have two default options, which define the resolution of the created
425  * mapset */
426  if (num_raster_inputs > 0 || num_raster_outputs > 0 ||
427  num_strds_inputs > 0 || num_strds_outputs > 0) {
428  wps_print_literal_input_output(
429  WPS_INPUT, 0, 1, "grass_resolution_ns",
430  "Resolution of the mapset in north-south direction in meters or "
431  "degrees",
432  "This parameter defines the north-south resolution of the mapset "
433  "in meter or degrees, which should be used to process the input "
434  "and output raster data. To enable this setting, you need to "
435  "specify north-south and east-west resolution.",
436  "float", 1, NULL, 0, NULL, TYPE_OTHER);
437  wps_print_literal_input_output(
438  WPS_INPUT, 0, 1, "grass_resolution_ew",
439  "Resolution of the mapset in east-west direction in meters or "
440  "degrees",
441  "This parameter defines the east-west resolution of the mapset in "
442  "meters or degrees, which should be used to process the input and "
443  "output raster data. To enable this setting, you need to specify "
444  "north-south and east-west resolution.",
445  "float", 1, NULL, 0, NULL, TYPE_OTHER);
446  }
447  /* In case multi band raster maps should be imported, the band number must
448  * be provided */
449  if (num_raster_inputs > 0)
450  wps_print_literal_input_output(
451  WPS_INPUT, 0, 1, "grass_band_number",
452  "Band to select for processing (default is all bands)",
453  "This parameter defines band number of the input raster files "
454  "which should be processed. As default all bands are processed and "
455  "used as single and multiple inputs for raster modules.",
456  "integer", 0, NULL, 0, NULL, TYPE_OTHER);
457 
458  /* End of inputs */
459  wps_print_data_inputs_end();
460  /* Start of the outputs */
461  wps_print_process_outputs_begin();
462 
463  found_output = 0;
464 
465  /*parse the output. only raster maps, vector maps, space time raster and
466  * vector datasets plus stdout are supported */
467  if (st->n_opts) {
468  opt = &st->first_option;
469  while (opt != NULL) {
470 
471  identifier = NULL;
472  title = NULL;
473  abstract = NULL;
474  value = NULL;
475  is_output = 0;
476  data_type = TYPE_OTHER;
477 
478  if (opt->gisprompt) {
479  const char *atts[] = {"age", "element", "prompt", NULL};
480  top = G_calloc(strlen(opt->gisprompt) + 1, 1);
481  strcpy(top, opt->gisprompt);
482  s = strtok(top, ",");
483  for (i = 0; s != NULL && atts[i] != NULL; i++) {
484 
485  char *token = G_store(s);
486 
487  /* we print only the output parameter */
488  if (strcmp(token, "new") == 0)
489  is_output = 1;
490  if (strcmp(token, "raster") == 0) {
491  data_type = TYPE_RASTER;
492  }
493  if (strcmp(token, "vector") == 0) {
494  data_type = TYPE_VECTOR;
495  }
496  if (strcmp(token, "stds") == 0) {
497  data_type = TYPE_STDS;
498  }
499  if (strcmp(token, "strds") == 0) {
500  data_type = TYPE_STRDS;
501  }
502  if (strcmp(token, "stvds") == 0) {
503  data_type = TYPE_STVDS;
504  }
505  if (strcmp(token, "file") == 0) {
506  data_type = TYPE_PLAIN_TEXT;
507  }
508  s = strtok(NULL, ",");
509  G_free(token);
510  }
511  G_free(top);
512  }
513  /* Only single module output is supported!! */
514  if (is_output == 1) {
515  if (opt->multiple == YES)
516  G_warning(
517  _("Multiple outputs are not supported by WPS 1.0.0"));
518  identifier = opt->key;
519 
520  if (opt->label) {
521  title = opt->label;
522  }
523  if (opt->description) {
524  if (!opt->label)
525  title = opt->description;
526  else
527  abstract = opt->description;
528  }
529 
530  if (data_type == TYPE_RASTER || data_type == TYPE_VECTOR ||
531  data_type == TYPE_STRDS || data_type == TYPE_STVDS ||
532  data_type == TYPE_STDS || data_type == TYPE_PLAIN_TEXT) {
533  wps_print_complex_output(identifier, title, abstract,
534  data_type);
535  found_output = 1;
536  }
537  }
538  opt = opt->next_opt;
539  }
540  /* we assume the computatuon output on stdout, if no raster/vector
541  * output was found */
542  if (found_output == 0)
543  wps_print_complex_output(
544  "stdout", "Module output on stdout",
545  "The output of the module written to stdout", TYPE_PLAIN_TEXT);
546  }
547 
548  wps_print_process_outputs_end();
549  wps_print_process_description_end();
550  wps_print_process_descriptions_end();
551 }
552 
553 /**************************************************************************
554  *
555  * The remaining routines are all local (static) routines used to support
556  * the the creation of the WPS process_description document.
557  *
558  **************************************************************************/
559 
560 static void wps_print_process_descriptions_begin(void)
561 {
562  fprintf(stdout, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
563  fprintf(stdout, "<wps:ProcessDescriptions "
564  "xmlns:wps=\"http://www.opengis.net/wps/1.0.0\"\n");
565  fprintf(stdout, "xmlns:ows=\"http://www.opengis.net/ows/1.1\"\n");
566  fprintf(stdout, "xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n");
567  fprintf(stdout,
568  "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n");
569  fprintf(stdout, "xsi:schemaLocation=\"http://www.opengis.net/wps/1.0.0\n "
570  "http://schemas.opengis.net/wps/1.0.0/"
571  "wpsDescribeProcess_response.xsd\"\n service=\"WPS\" "
572  "version=\"1.0.0\" xml:lang=\"en-US\"> \n");
573 }
574 
575 /* ************************************************************************** */
576 
577 static void wps_print_process_descriptions_end(void)
578 {
579  fprintf(stdout, "</wps:ProcessDescriptions>\n");
580 }
581 
582 /* ************************************************************************** */
583 
584 static void wps_print_process_description_begin(
585  int store, int status, const char *identifier, const char *title,
586  const char *abstract, const char **keywords, int num_keywords)
587 {
588  int i;
589 
590  fprintf(stdout,
591  "\t<ProcessDescription wps:processVersion=\"1\" "
592  "storeSupported=\"%s\" statusSupported=\"%s\">\n",
593  (store ? "true" : "false"), (status ? "true" : "false"));
594  if (identifier) {
595  fprintf(stdout, "\t\t<ows:Identifier>");
596  print_escaped_for_xml(stdout, identifier);
597  fprintf(stdout, "</ows:Identifier>\n");
598  }
599  else {
600  G_fatal_error("Identifier not defined");
601  }
602 
603  if (title) {
604  fprintf(stdout, "\t\t<ows:Title>");
605  print_escaped_for_xml(stdout, title);
606  fprintf(stdout, "</ows:Title>\n");
607  }
608  else {
609  G_warning("Title not defined!");
610  fprintf(stdout, "\t\t<ows:Title>");
611  print_escaped_for_xml(stdout, "No title available");
612  fprintf(stdout, "</ows:Title>\n");
613  }
614 
615  if (abstract) {
616  fprintf(stdout, "\t\t<ows:Abstract>");
617  fprintf(stdout, "https://grass.osgeo.org/grass-devel/manuals/%s.html",
618  identifier);
619  fprintf(stdout, "</ows:Abstract>\n");
620  }
621 
622  for (i = 0; i < num_keywords; i++) {
623  fprintf(stdout, "\t\t<ows:Metadata xlink:title=\"");
624  print_escaped_for_xml(stdout, keywords[i]);
625  fprintf(stdout, "\" />\n");
626  }
627 }
628 
629 /* ************************************************************************** */
630 
631 static void wps_print_process_description_end(void)
632 {
633  fprintf(stdout, "\t</ProcessDescription>\n");
634 }
635 
636 /* ************************************************************************** */
637 
638 static void wps_print_data_inputs_begin(void)
639 {
640  fprintf(stdout, "\t\t<DataInputs>\n");
641 }
642 
643 /* ************************************************************************** */
644 
645 static void wps_print_data_inputs_end(void)
646 {
647  fprintf(stdout, "\t\t</DataInputs>\n");
648 }
649 
650 /* ************************************************************************** */
651 
652 static void wps_print_process_outputs_begin(void)
653 {
654  fprintf(stdout, "\t\t<ProcessOutputs>\n");
655 }
656 
657 /* ************************************************************************** */
658 
659 static void wps_print_process_outputs_end(void)
660 {
661  fprintf(stdout, "\t\t</ProcessOutputs>\n");
662 }
663 
664 /* ************************************************************************** */
665 
666 static void wps_print_complex_input(int min, int max, const char *identifier,
667  const char *title, const char *abstract,
668  int megs, int type)
669 {
670  wps_print_comlpex_input_output(WPS_INPUT, min, max, identifier, title,
671  abstract, megs, type);
672 }
673 
674 /* ************************************************************************** */
675 
676 static void wps_print_complex_output(const char *identifier, const char *title,
677  const char *abstract, int type)
678 {
679  wps_print_comlpex_input_output(WPS_OUTPUT, 0, 0, identifier, title,
680  abstract, 0, type);
681 }
682 
683 /* ************************************************************************** */
684 
685 static void wps_print_comlpex_input_output(int inout_type, int min, int max,
686  const char *identifier,
687  const char *title,
688  const char *abstract, int megs,
689  int type)
690 {
691  if (inout_type == WPS_INPUT)
692  fprintf(stdout, "\t\t\t<Input minOccurs=\"%i\" maxOccurs=\"%i\">\n",
693  min, max);
694  else if (inout_type == WPS_OUTPUT)
695  fprintf(stdout, "\t\t\t<Output>\n");
696 
697  wps_print_ident_title_abstract(identifier, title, abstract);
698 
699  if (inout_type == WPS_INPUT)
700  fprintf(stdout, "\t\t\t\t<ComplexData maximumMegabytes=\"%i\">\n",
701  megs);
702  else if (inout_type == WPS_OUTPUT)
703  fprintf(stdout, "\t\t\t\t<ComplexOutput>\n");
704 
705  fprintf(stdout, "\t\t\t\t\t<Default>\n");
706  if (type == TYPE_RASTER) {
707  wps_print_mimetype_raster_tiff();
708  }
709  else if (type == TYPE_VECTOR) {
710  wps_print_mimetype_vector_gml311();
711  }
712  else if (type == TYPE_STDS) {
713  /* A space time raster dataset is the default an any modules with
714  * multiple dataset options */
715  wps_print_mimetype_space_time_raster_datasets_tar_gz();
716  }
717  else if (type == TYPE_STRDS) {
718  wps_print_mimetype_space_time_raster_datasets_tar_gz();
719  }
720  else if (type == TYPE_STVDS) {
721  wps_print_mimetype_space_time_vector_datasets_tar_gz();
722  }
723  else if (type == TYPE_PLAIN_TEXT) {
724  wps_print_mimetype_text_plain();
725  }
726  fprintf(stdout, "\t\t\t\t\t</Default>\n");
727  fprintf(stdout, "\t\t\t\t\t<Supported>\n");
728  if (type == TYPE_RASTER) {
729  /*The supported types for input and output are different */
730  if (inout_type == WPS_INPUT) {
731  wps_print_mimetype_raster_tiff();
732  wps_print_mimetype_raster_tiff_other();
733  wps_print_mimetype_raster_png();
734  wps_print_mimetype_raster_gif();
735  wps_print_mimetype_raster_jpeg();
736  wps_print_mimetype_raster_hfa();
737  wps_print_mimetype_raster_netCDF();
738  wps_print_mimetype_raster_netCDF_other();
739  }
740  else {
741  wps_print_mimetype_raster_tiff();
742  wps_print_mimetype_raster_tiff_other();
743  wps_print_mimetype_raster_hfa();
744  wps_print_mimetype_raster_netCDF();
745  wps_print_mimetype_raster_netCDF_other();
746  }
747  }
748  else if (type == TYPE_VECTOR) {
749  if (inout_type == WPS_INPUT) {
750  wps_print_mimetype_vector_gml311();
751  wps_print_mimetype_vector_gml311_appl();
752  wps_print_mimetype_vector_gml212();
753  wps_print_mimetype_vector_gml212_appl();
754  wps_print_mimetype_vector_kml22();
755  wps_print_mimetype_vector_dgn();
756  wps_print_mimetype_vector_shape();
757  wps_print_mimetype_vector_zipped_shape();
758  }
759  else {
760  wps_print_mimetype_vector_gml311();
761  wps_print_mimetype_vector_gml311_appl();
762  wps_print_mimetype_vector_gml212();
763  wps_print_mimetype_vector_gml212_appl();
764  wps_print_mimetype_vector_kml22();
765  }
766  }
767  else if (type == TYPE_STDS) {
768  wps_print_mimetype_space_time_datasets();
769  }
770  else if (type == TYPE_STRDS) {
771  wps_print_mimetype_space_time_raster_datasets();
772  }
773  else if (type == TYPE_STVDS) {
774  wps_print_mimetype_space_time_vector_datasets();
775  }
776  else if (type == TYPE_PLAIN_TEXT) {
777  wps_print_mimetype_text_plain();
778  }
779  fprintf(stdout, "\t\t\t\t\t</Supported>\n");
780 
781  if (inout_type == WPS_INPUT)
782  fprintf(stdout, "\t\t\t\t</ComplexData>\n");
783  else if (inout_type == WPS_OUTPUT)
784  fprintf(stdout, "\t\t\t\t</ComplexOutput>\n");
785 
786  if (inout_type == WPS_INPUT)
787  fprintf(stdout, "\t\t\t</Input>\n");
788  else if (inout_type == WPS_OUTPUT)
789  fprintf(stdout, "\t\t\t</Output>\n");
790 }
791 
792 /* ************************************************************************** */
793 
794 static void wps_print_ident_title_abstract(const char *identifier,
795  const char *title,
796  const char *abstract)
797 {
798  if (identifier) {
799  fprintf(stdout, "\t\t\t\t<ows:Identifier>");
800  print_escaped_for_xml(stdout, identifier);
801  fprintf(stdout, "</ows:Identifier>\n");
802  }
803  else {
804  G_fatal_error("Identifier not defined");
805  }
806 
807  if (title) {
808  fprintf(stdout, "\t\t\t\t<ows:Title>");
809  print_escaped_for_xml(stdout, title);
810  fprintf(stdout, "</ows:Title>\n");
811  }
812  else {
813  G_warning("Title not defined!");
814  fprintf(stdout, "\t\t\t\t<ows:Title>");
815  print_escaped_for_xml(stdout, "No title available");
816  fprintf(stdout, "</ows:Title>\n");
817  }
818 
819  if (abstract) {
820  fprintf(stdout, "\t\t\t\t<ows:Abstract>");
821  print_escaped_for_xml(stdout, abstract);
822  fprintf(stdout, "</ows:Abstract>\n");
823  }
824 }
825 
826 /* ************************************************************************** */
827 
828 static void wps_print_literal_input_output(
829  int inout_type, int min, int max, const char *identifier, const char *title,
830  const char *abstract, const char *datatype, int unitofmesure,
831  const char **choices, int num_choices, const char *default_value, int type)
832 {
833  int i;
834  char range[2][24];
835  char *str;
836 
837  if (inout_type == WPS_INPUT)
838  fprintf(stdout, "\t\t\t<Input minOccurs=\"%i\" maxOccurs=\"%i\">\n",
839  min, max);
840  else if (inout_type == WPS_OUTPUT)
841  fprintf(stdout, "\t\t\t<Output>\n");
842 
843  wps_print_ident_title_abstract(identifier, title, abstract);
844 
845  fprintf(stdout, "\t\t\t\t<LiteralData>\n");
846 
847  if (datatype)
848  fprintf(stdout,
849  "\t\t\t\t\t<ows:DataType "
850  "ows:reference=\"xs:%s\">%s</ows:DataType>\n",
851  datatype, datatype);
852 
853  if (unitofmesure) {
854  fprintf(stdout, "\t\t\t\t\t<UOMs>\n");
855  fprintf(stdout, "\t\t\t\t\t\t<Default>\n");
856  fprintf(stdout, "\t\t\t\t\t\t\t<ows:UOM>meters</ows:UOM>\n");
857  fprintf(stdout, "\t\t\t\t\t\t</Default>\n");
858  fprintf(stdout, "\t\t\t\t\t\t<Supported>\n");
859  fprintf(stdout, "\t\t\t\t\t\t\t<ows:UOM>meters</ows:UOM>\n");
860  fprintf(stdout, "\t\t\t\t\t\t\t<ows:UOM>degrees</ows:UOM>\n");
861  fprintf(stdout, "\t\t\t\t\t\t</Supported>\n");
862  fprintf(stdout, "\t\t\t\t\t</UOMs>\n");
863  }
864  if (num_choices == 0 || choices == NULL)
865  fprintf(stdout, "\t\t\t\t\t<ows:AnyValue/>\n");
866  else {
867  /* Check for range values */
868  if (strcmp(datatype, "integer") == 0 ||
869  strcmp(datatype, "float") == 0) {
870  str = strtok((char *)choices[0], "-");
871  if (str != NULL) {
872  snprintf(range[0], 24, "%s", str);
873  str = strtok(NULL, "-");
874  if (str != NULL) {
875  snprintf(range[1], 24, "%s", str);
876  type = TYPE_RANGE;
877  }
878  }
879  }
880 
881  fprintf(stdout, "\t\t\t\t\t<ows:AllowedValues>\n");
882  if (type == TYPE_RANGE) {
883  fprintf(stdout,
884  "\t\t\t\t\t\t<ows:Range ows:rangeClosure=\"closed\">\n");
885  fprintf(stdout,
886  "\t\t\t\t\t\t\t<ows:MinimumValue>%s</ows:MinimumValue>\n",
887  range[0]);
888  fprintf(stdout,
889  "\t\t\t\t\t\t\t<ows:MaximumValue>%s</ows:MaximumValue>\n",
890  range[1]);
891  fprintf(stdout, "\t\t\t\t\t\t</ows:Range>\n");
892  }
893  else {
894  for (i = 0; i < num_choices; i++) {
895  fprintf(stdout, "\t\t\t\t\t\t<ows:Value>");
896  print_escaped_for_xml(stdout, choices[i]);
897  fprintf(stdout, "</ows:Value>\n");
898  }
899  }
900  fprintf(stdout, "\t\t\t\t\t</ows:AllowedValues>\n");
901  }
902 
903  if (default_value) {
904  fprintf(stdout, "\t\t\t\t\t<DefaultValue>");
905  print_escaped_for_xml(stdout, default_value);
906  fprintf(stdout, "</DefaultValue>\n");
907  }
908  fprintf(stdout, "\t\t\t\t</LiteralData>\n");
909 
910  if (inout_type == WPS_INPUT)
911  fprintf(stdout, "\t\t\t</Input>\n");
912  else if (inout_type == WPS_OUTPUT)
913  fprintf(stdout, "\t\t\t</Output>\n");
914 }
915 
916 /* ************************************************************************** */
917 
918 static void wps_print_mimetype_text_plain(void)
919 {
920  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
921  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>text/plain</MimeType>\n");
922  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
923 }
924 
925 /* ************************************************************************** */
926 
927 static void wps_print_mimetype_raster_tiff(void)
928 {
929  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
930  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>image/tiff</MimeType>\n");
931  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
932 }
933 
934 /* ************************************************************************** */
935 
936 static void wps_print_mimetype_raster_png(void)
937 {
938  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
939  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>image/png</MimeType>\n");
940  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
941 }
942 
943 #if 0 /* unused */
944 /* *** Native GRASS raster format urn:grass:raster:location/mapset/raster *** */
945 static void wps_print_mimetype_raster_grass_binary(void)
946 {
947  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
948  fprintf(stdout,
949  "\t\t\t\t\t\t\t<MimeType>application/grass-raster-binary</MimeType>\n");
950  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
951 }
952 
953 /* *** GRASS raster maps exported via r.out.ascii ************************** */
954 static void wps_print_mimetype_raster_grass_ascii(void)
955 {
956  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
957  fprintf(stdout,
958  "\t\t\t\t\t\t\t<MimeType>application/grass-raster-ascii</MimeType>\n");
959  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
960 }
961 #endif
962 /* ************************************************************************** */
963 
964 static void wps_print_mimetype_vector_gml311_appl(void)
965 {
966  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
967  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>application/xml</MimeType>\n");
968  fprintf(stdout, "\t\t\t\t\t\t\t<Encoding>UTF-8</Encoding>\n");
969  fprintf(stdout, "\t\t\t\t\t\t\t<Schema>http://schemas.opengis.net/gml/"
970  "3.1.1/base/gml.xsd</Schema>\n");
971  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
972 }
973 
974 /* ************************************************************************** */
975 
976 static void wps_print_mimetype_vector_gml212_appl(void)
977 {
978  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
979  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>application/xml</MimeType>\n");
980  fprintf(stdout, "\t\t\t\t\t\t\t<Encoding>UTF-8</Encoding>\n");
981  fprintf(stdout, "\t\t\t\t\t\t\t<Schema>http://schemas.opengis.net/gml/"
982  "2.1.2/feature.xsd</Schema>\n");
983  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
984 }
985 
986 /* ************************************************************************** */
987 
988 static void wps_print_mimetype_vector_gml311(void)
989 {
990  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
991  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>text/xml</MimeType>\n");
992  fprintf(stdout, "\t\t\t\t\t\t\t<Encoding>UTF-8</Encoding>\n");
993  fprintf(stdout, "\t\t\t\t\t\t\t<Schema>http://schemas.opengis.net/gml/"
994  "3.1.1/base/gml.xsd</Schema>\n");
995  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
996 }
997 
998 /* ************************************************************************** */
999 
1000 static void wps_print_mimetype_vector_gml212(void)
1001 {
1002  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1003  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>text/xml</MimeType>\n");
1004  fprintf(stdout, "\t\t\t\t\t\t\t<Encoding>UTF-8</Encoding>\n");
1005  fprintf(stdout, "\t\t\t\t\t\t\t<Schema>http://schemas.opengis.net/gml/"
1006  "2.1.2/feature.xsd</Schema>\n");
1007  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1008 }
1009 
1010 #if 0 /* unused */
1011 /* *** GRASS vector format exported via v.out.ascii ************************** */
1012 
1013 static void wps_print_mimetype_vector_grass_ascii(void)
1014 {
1015  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1016  fprintf(stdout,
1017  "\t\t\t\t\t\t\t<MimeType>application/grass-vector-ascii</MimeType>\n");
1018  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1019 }
1020 
1021 /* *** Native GRASS vector format urn:grass:vector:location/mapset/vector *** */
1022 
1023 static void wps_print_mimetype_vector_grass_binary(void)
1024 {
1025  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1026  fprintf(stdout,
1027  "\t\t\t\t\t\t\t<MimeType>application/grass-vector-binary</MimeType>\n");
1028  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1029 }
1030 #endif
1031 /* *** Space time dataset format using tar, tar.gz and tar.bz2 methods for
1032  * packaging */
1033 
1034 static void wps_print_mimetype_space_time_datasets(void)
1035 {
1036  wps_print_mimetype_space_time_raster_datasets();
1037  wps_print_mimetype_space_time_vector_datasets();
1038 }
1039 
1040 /* *** Space time raster dataset format using tar, tar.gz and tar.bz2 methods
1041  * for packaging */
1042 
1043 static void wps_print_mimetype_space_time_raster_datasets(void)
1044 {
1045  wps_print_mimetype_space_time_raster_datasets_tar();
1046  wps_print_mimetype_space_time_raster_datasets_tar_gz();
1047  wps_print_mimetype_space_time_raster_datasets_tar_bz2();
1048 }
1049 
1050 static void wps_print_mimetype_space_time_raster_datasets_tar(void)
1051 {
1052  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1053  fprintf(
1054  stdout,
1055  "\t\t\t\t\t\t\t<MimeType>application/x-grass-strds-tar</MimeType>\n");
1056  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1057 }
1058 
1059 static void wps_print_mimetype_space_time_raster_datasets_tar_gz(void)
1060 {
1061  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1062  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>application/x-grass-strds-tar-gz</"
1063  "MimeType>\n");
1064  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1065 }
1066 
1067 static void wps_print_mimetype_space_time_raster_datasets_tar_bz2(void)
1068 {
1069  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1070  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>application/"
1071  "x-grass-strds-tar-bzip</MimeType>\n");
1072  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1073 }
1074 
1075 /* *** Space time vector dataset format using tar, tar.gz and tar.bz2 methods
1076  * for packaging */
1077 
1078 static void wps_print_mimetype_space_time_vector_datasets(void)
1079 {
1080  wps_print_mimetype_space_time_vector_datasets_tar();
1081  wps_print_mimetype_space_time_vector_datasets_tar_gz();
1082  wps_print_mimetype_space_time_vector_datasets_tar_bz2();
1083 }
1084 
1085 static void wps_print_mimetype_space_time_vector_datasets_tar(void)
1086 {
1087  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1088  fprintf(
1089  stdout,
1090  "\t\t\t\t\t\t\t<MimeType>application/x-grass-stvds-tar</MimeType>\n");
1091  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1092 }
1093 
1094 static void wps_print_mimetype_space_time_vector_datasets_tar_gz(void)
1095 {
1096  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1097  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>application/x-grass-stvds-tar-gz</"
1098  "MimeType>\n");
1099  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1100 }
1101 
1102 static void wps_print_mimetype_space_time_vector_datasets_tar_bz2(void)
1103 {
1104  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1105  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>application/"
1106  "x-grass-stvds-tar-bzip</MimeType>\n");
1107  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1108 }
1109 
1110 /* ************************************************************************** */
1111 static void wps_print_mimetype_raster_gif(void)
1112 {
1113  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1114  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>image/gif</MimeType>\n");
1115  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1116 }
1117 
1118 /* ************************************************************************** */
1119 static void wps_print_mimetype_raster_jpeg(void)
1120 {
1121  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1122  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>image/jpeg</MimeType>\n");
1123  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1124 }
1125 
1126 /* ************************************************************************** */
1127 static void wps_print_mimetype_raster_hfa(void)
1128 {
1129  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1130  fprintf(stdout,
1131  "\t\t\t\t\t\t\t<MimeType>application/x-erdas-hfa</MimeType>\n");
1132  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1133 }
1134 
1135 /* ************************************************************************** */
1136 
1137 static void wps_print_mimetype_raster_tiff_other(void)
1138 {
1139  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1140  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>image/geotiff</MimeType>\n");
1141  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1142 
1143  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1144  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>application/geotiff</MimeType>\n");
1145  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1146 
1147  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1148  fprintf(stdout,
1149  "\t\t\t\t\t\t\t<MimeType>application/x-geotiff</MimeType>\n");
1150  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1151 }
1152 
1153 /* ************************************************************************** */
1154 static void wps_print_mimetype_raster_netCDF(void)
1155 {
1156  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1157  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>application/netcdf</MimeType>\n");
1158  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1159 }
1160 
1161 /* ************************************************************************** */
1162 static void wps_print_mimetype_raster_netCDF_other(void)
1163 {
1164  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1165  fprintf(stdout,
1166  "\t\t\t\t\t\t\t<MimeType>application/x-netcdf</MimeType>\n");
1167  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1168 }
1169 
1170 /* ************************************************************************** */
1171 static void wps_print_mimetype_vector_kml22(void)
1172 {
1173  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1174  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>text/xml</MimeType>\n");
1175  fprintf(stdout, "\t\t\t\t\t\t\t<Encoding>UTF-8</Encoding>\n");
1176  fprintf(stdout, "\t\t\t\t\t\t\t<Schema>http://schemas.opengis.net/kml/"
1177  "2.2.0/ogckml22.xsd</Schema>\n");
1178  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1179 }
1180 
1181 /* ************************************************************************** */
1182 static void wps_print_mimetype_vector_dgn(void)
1183 {
1184  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1185  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>application/dgn</MimeType>\n");
1186  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1187 }
1188 
1189 /* ************************************************************************** */
1190 static void wps_print_mimetype_vector_shape(void)
1191 {
1192  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1193  fprintf(stdout, "\t\t\t\t\t\t\t<MimeType>application/shp</MimeType>\n");
1194  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1195 }
1196 
1197 /* ************************************************************************** */
1198 static void wps_print_mimetype_vector_zipped_shape(void)
1199 {
1200  fprintf(stdout, "\t\t\t\t\t\t<Format>\n");
1201  fprintf(stdout,
1202  "\t\t\t\t\t\t\t<MimeType>application/x-zipped-shp</MimeType>\n");
1203  fprintf(stdout, "\t\t\t\t\t\t</Format>\n");
1204 }
1205 
1206 /* Bounding box data input. Do not use! Under construction. A list of coordinate
1207  * reference systems must be created. */
1208 
1209 static void wps_print_bounding_box_data(void)
1210 {
1211  int i;
1212 
1213  fprintf(stdout, "\t\t\t<Input minOccurs=\"0\" maxOccurs=\"1\">\n");
1214  wps_print_ident_title_abstract(
1215  "BoundingBox", "Bounding box to process data",
1216  "The bounding box is uesed to create the reference coordinate system "
1217  "in grass, as well as the lower left and upper right corner of the "
1218  "processing area.");
1219  fprintf(stdout, "\t\t\t\t<BoundingBoxData>\n");
1220  /* A meaningful default boundingbox should be chosen */
1221  fprintf(stdout, "\t\t\t\t\t<Default>\n");
1222  fprintf(stdout,
1223  "\t\t\t\t\t\t<CRS>urn:ogc:def:crs,crs:EPSG:6.3:32760</CRS>\n");
1224  fprintf(stdout, "\t\t\t\t\t</Default>\n");
1225  /* A list of all proj4 supported EPSG coordinate systems should be created
1226  */
1227  fprintf(stdout, "\t\t\t\t\t<Supported>\n");
1228  for (i = 0; i < 1; i++)
1229  fprintf(stdout,
1230  "\t\t\t\t\t\t<CRS>urn:ogc:def:crs,crs:EPSG:6.3:32760</CRS>\n");
1231  fprintf(stdout, "\t\t\t\t\t</Supported>\n");
1232  fprintf(stdout, "\t\t\t\t</BoundingBoxData>\n");
1233  fprintf(stdout, "\t\t\t</Input>\n");
1234 }
#define NULL
Definition: ccmath.h:32
void G_free(void *)
Free allocated memory.
Definition: gis/alloc.c:150
#define G_calloc(m, n)
Definition: defs/gis.h:95
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
const char * G_program_name(void)
Return module name.
Definition: progrm_nme.c:28
char * G_store(const char *)
Copy string to allocated memory.
Definition: strings.c:87
#define min(x, y)
Definition: draw2.c:29
#define max(x, y)
Definition: draw2.c:30
#define TYPE_STRING
Definition: gis.h:186
#define YES
Definition: gis.h:187
#define TYPE_INTEGER
Definition: gis.h:184
#define TYPE_DOUBLE
Definition: gis.h:185
#define _(str)
Definition: glocale.h:10
struct state * st
Definition: parser.c:104
#define TYPE_RANGE
Definition: parser_wps.c:25
#define TYPE_STDS
Definition: parser_wps.c:27
#define TYPE_STRDS
Definition: parser_wps.c:29
#define TYPE_STVDS
Definition: parser_wps.c:30
#define WPS_INPUT
Definition: parser_wps.c:31
#define TYPE_VECTOR
Definition: parser_wps.c:23
#define TYPE_RASTER
Definition: parser_wps.c:22
void G__wps_print_process_description(void)
Print the WPS 1.0.0 process description XML document to stdout.
Definition: parser_wps.c:156
#define TYPE_PLAIN_TEXT
Definition: parser_wps.c:24
#define TYPE_OTHER
Definition: parser_wps.c:21
#define WPS_OUTPUT
Definition: parser_wps.c:32
#define strcpy
Definition: parson.c:62
Structure that stores flag info.
Definition: gis.h:588
struct Flag * next_flag
Definition: gis.h:597
const char * description
Definition: gis.h:594
char key
Definition: gis.h:589
Structure that stores option information.
Definition: gis.h:557
const char * key
Definition: gis.h:558
struct Option * next_opt
Definition: gis.h:574
const char * key_desc
Definition: gis.h:564
const char ** opts
Definition: gis.h:563
const char * gisprompt
Definition: gis.h:575
const char * label
Definition: gis.h:565
int type
Definition: gis.h:559
const char * def
Definition: gis.h:572
const char * description
Definition: gis.h:566
int required
Definition: gis.h:560
const char * options
Definition: gis.h:562
int multiple
Definition: gis.h:561