Hello,
i while ago i discussed with markus how to support a better
integration of grass in WPS server.
He suggested that it would be the best to add WPS XML process
description generation directly into grass.
So here we are. 
I have added the generation of WPS process description XML documents
to lib/gis/parser.c in grass7 .
If a module is started with the parameter "--wps-process-description"
the process description XML document is
written to stdout and the module will exit.
Currently only raster and vector modules are supported, but the
generation works with any module (more or less meaningful).
Most of the input options are catched:
* single and multiple raster and vector maps
* single and multiple string, float and integer data with default
values and value options (range is missing)
Flags are supported as boolean values.
The mime types for vector maps are GML 3.1 and grass ascii and binary vectors.
mime type: application/grass-vector-ascii -> a text file generated
with v.out.asci
Example.: urn:file:///path/name
mime type: application/grass-vector-binary -> the binary vectors must
be addressed with a non standard urn:
Example: urn:grass:vector:location/mapset/name
The mime types for raster maps are tiff and png as well as grass ascii
and binary raster maps, following the same scheme as the vector maps
The mime types are reflecting the capabilities of gdal and may be extended.
The support for specific grass formats is just a crazy idea of mine. o_O
Only single maps are supported as output or plain text on stdout.
BoundignBox support is currently not available for inputs and outputs.
Literal data output (string, float or integer) is currently not supported.
A lot of work must still be done to verify the correct generation of
WPS process descriptions,
so please do not use them right now for WPS server input. 
I am afraid that to fully support the WPS XML process description
generation, which is IMO very important for grass, the option, flag
and module structures
which are used to describe the input and output parameter for each
module, must be reviewed and may be extended.
Any hints, criticism and suggestions are welcome.
Best regards
Soeren
Soeren Gebbert wrote:
I have added the generation of WPS process description XML documents
to lib/gis/parser.c in grass7 .
We should probably split parser.c into multiple files. At ~84KiB, it's
easily the largest file in lib/gis.
Each of the "description" options (--help, --interface-description,
--html-description, --wps-process-description, --script) should
probably be in a separate file.
Any hints, criticism and suggestions are welcome.
A couple of minor points regarding e.g.:
static void wps_print_ProcessDescription()
1. Functions should use ANSI C prototypes, which means using "void"
for the argument list if the function takes no arguments.
2. We don't use CamelCase.
IOW:
static void wps_print_process_description(void)
--
Glynn Clements <glynn@gclements.plus.com>
Hi,
2009/11/26 Glynn Clements <glynn@gclements.plus.com>:
Soeren Gebbert wrote:
I have added the generation of WPS process description XML documents
to lib/gis/parser.c in grass7 .
We should probably split parser.c into multiple files. At ~84KiB, it's
easily the largest file in lib/gis.
Each of the "description" options (--help, --interface-description,
--html-description, --wps-process-description, --script) should
probably be in a separate file.
Done.
I have split parser.c in the following files:
-rw-r--r-- 1 soeren users 30041 parser.c
-rw-r--r-- 1 soeren users 5695 parser_help.c
-rw-r--r-- 1 soeren users 6180 parser_html.c
-rw-r--r-- 1 soeren users 7237 parser_interface.c
-rw-r--r-- 1 soeren users 1591 parser_local_proto.h
-rw-r--r-- 1 soeren users 3549 parser_script.c
-rw-r--r-- 1 soeren users 10912 parser_standard_options.c
-rw-r--r-- 1 soeren users 22265 parser_wps.c
Code review is very welcome, i am always confused about the usage of
external variable.
Any hints, criticism and suggestions are welcome.
A couple of minor points regarding e.g.:
Thanks.
static void wps\_print\_ProcessDescription\(\)
1. Functions should use ANSI C prototypes, which means using "void"
for the argument list if the function takes no arguments.
Sorry! done.
2. We don't use CamelCase.
IOW:
static void wps\_print\_process\_description\(void\)
Done. (i thought naming parts of the functions exactly like the XML tags is more
important than the code convention ...)
Best regards
Soeren
ps:
I have attached the source files, because i am unable to contact the
grass svn server.
(attachments)
parser.c (29.3 KB)
parser_help.c (5.56 KB)
parser_html.c (6.04 KB)
parser_interface.c (7.07 KB)
parser_local_proto.h (1.63 KB)
parser_script.c (3.47 KB)
parser_standard_options.c (10.7 KB)
parser_wps.c (21.7 KB)