WPS: Difference between revisions
(cosmetics) |
(Update of various URLs and --wps-process-description XML output) |
||
| Line 5: | Line 5: | ||
== Linking to WPS server == | == Linking to WPS server == | ||
A framework has been developed to make the integration of GRASS GIS | A framework has been developed to make the integration of GRASS GIS in WPS server as easy as possible. The | ||
framework is called '''wps-grass-bridge''' and is available here: | framework is called '''wps-grass-bridge''' and is available here: | ||
* '''wps-grass-bridge''': | * '''wps-grass-bridge''': https://code.google.com/archive/p/wps-grass-bridge/ | ||
This framework support currently PyWPS, ZOO WPS and is used by 52North WPS server. Many GRASS GIS | This framework support currently PyWPS, ZOO WPS and is used by 52North WPS server. Many GRASS GIS modules can be attached out of the box. | ||
modules can be attached out of the box. | |||
There are currently several '''other WPS implementations''' which use GRASS as GIS backbone: | There are currently several '''other WPS implementations''' which use GRASS as GIS backbone: | ||
* '''PyWPS''': | * '''PyWPS''': https://pywps.org/ | ||
** PyWPS and wps-grass-bridge connector: | ** PyWPS and wps-grass-bridge connector: https://code.google.com/archive/p/wps-grass-bridge/wikis/PyWPS_Integration.wiki | ||
** [ | ** [https://pywps.org/gallery/ Gallery] (live examples) | ||
** PyWPS and GRASS | ** PyWPS and GRASS: https://pywps-3.readthedocs.io/special/grass.html | ||
* '''WPS by 52N''': | * '''WPS by 52N''': https://52north.github.io/WPS/ | ||
** Connecting to GRASS out of the box: | ** Connecting to GRASS out of the box: https://github.com/52North/WPS/tree/dev/52n-wps-grass | ||
** Backend: https://mvnrepository.com/artifact/org.n52.wps/52n-wps-grass | |||
** 52N-WPS-GRASS [http://geoprocessing.demo.52north.org:8080/wps/WebProcessingService?REQUEST=GetCapabilities&SERVICE=WPS&VERSION=1.0.0 Demo] | ** 52N-WPS-GRASS [http://geoprocessing.demo.52north.org:8080/wps/WebProcessingService?REQUEST=GetCapabilities&SERVICE=WPS&VERSION=1.0.0 Demo] | ||
* '''ZOO project''' - Open OSW Platform: | * '''ZOO project''' - Open OSW Platform: https://zoo-project.org/ | ||
** [ | ** [https://zoo-project.org/code/services/ ZOO-WPS with GRASS and QGIS] | ||
* R and WPS: [http://gsif.r-forge.r-project.org/WPS.html WPS class] | * R and WPS: [http://gsif.r-forge.r-project.org/WPS.html WPS class] | ||
== Inside GRASS | == Inside GRASS == | ||
In | In GRASS, the WPS process description can be automatically generated with the option '--wps-process-description'. | ||
See [ | See [https://lists.osgeo.org/pipermail/grass-dev/2009-November/047133.html announcement]. | ||
Example: | Example: | ||
| Line 40: | Line 40: | ||
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 | xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 | ||
http://schemas.opengis.net/wps/1.0.0/wpsDescribeProcess_response.xsd" | http://schemas.opengis.net/wps/1.0.0/wpsDescribeProcess_response.xsd" | ||
service="WPS" version="1.0.0" xml:lang="en-US"> | service="WPS" version="1.0.0" xml:lang="en-US"> | ||
<ProcessDescription wps:processVersion="1" storeSupported="true" statusSupported="true"> | |||
<ows:Identifier>r.grow</ows:Identifier> | |||
<ows:Title>Generates a raster map layer with contiguous areas grown by one cell.</ows:Title> | |||
<ows:Abstract>https://grass.osgeo.org/grass-devel/manuals/r.grow.html</ows:Abstract> | |||
<ows:Metadata xlink:title="raster" /> | |||
<ows:Metadata xlink:title="distance" /> | |||
<ows:Metadata xlink:title="proximity" /> | |||
<DataInputs> | |||
<Input minOccurs="1" maxOccurs="1"> | |||
<ows:Identifier>input</ows:Identifier> | |||
<ows:Title>Name of input raster map</ows:Title> | |||
<ComplexData maximumMegabytes="2048"> | |||
<Default> | |||
<Format> | |||
<MimeType>image/tiff</MimeType> | |||
</Format> | |||
</Default> | |||
<Supported> | |||
<Format> | |||
<MimeType>image/tiff</MimeType> | |||
</Format> | |||
<Format> | |||
<MimeType>image/geotiff</MimeType> | |||
</Format> | |||
[...] | [...] | ||
<Format> | |||
<MimeType>application/x-netcdf</MimeType> | |||
</Format> | |||
</Supported> | |||
</ComplexData> | |||
</Input> | |||
<Input minOccurs="0" maxOccurs="1"> | |||
<ows:Identifier>radius</ows:Identifier> | |||
<ows:Title>Radius of buffer in raster cells</ows:Title> | |||
<LiteralData> | |||
<ows:DataType ows:reference="xs:float">float</ows:DataType> | |||
<ows:AnyValue/> | |||
<DefaultValue>1.01</DefaultValue> | |||
</LiteralData> | |||
</Input> | |||
[...] | [...] | ||
<Input minOccurs="0" maxOccurs="1"> | |||
<ows:Identifier>-m</ows:Identifier> | |||
<ows:Title>Radius is in map units rather than cells</ows:Title> | |||
<LiteralData> | |||
<ows:DataType ows:reference="xs:boolean">boolean</ows:DataType> | |||
<ows:AllowedValues> | |||
<ows:Value>true</ows:Value> | |||
<ows:Value>false</ows:Value> | |||
</ows:AllowedValues> | |||
<DefaultValue>false</DefaultValue> | |||
</LiteralData> | |||
</Input> | |||
[...] | [...] | ||
</Input> | |||
</DataInputs> | |||
<ProcessOutputs> | |||
<Output> | |||
<ows:Identifier>output</ows:Identifier> | |||
<ows:Title>Name for output raster map</ows:Title> | |||
<ComplexOutput> | |||
<Default> | |||
<Format> | |||
<MimeType>image/tiff</MimeType> | |||
</Format> | |||
</Default> | |||
<Supported> | |||
<Format> | |||
<MimeType>image/tiff</MimeType> | |||
</Format> | |||
<Format> | |||
<MimeType>image/geotiff</MimeType> | |||
</Format> | |||
[...] | |||
</Format> | |||
<Format> | |||
<MimeType>application/netcdf</MimeType> | |||
</Format> | |||
<Format> | |||
<MimeType>application/x-netcdf</MimeType> | |||
</Format> | |||
</Supported> | |||
</ComplexOutput> | |||
</Output> | |||
</ProcessOutputs> | |||
</ProcessDescription> | |||
</wps:ProcessDescriptions> | </wps:ProcessDescriptions> | ||
</source> | </source> | ||
| Line 118: | Line 132: | ||
== WPS workflow idea == | == WPS workflow idea == | ||
External raster maps can directly be linked into GRASS with {{cmd|r.external | External raster maps can directly be linked into GRASS with {{cmd|r.external}} which saves time and disk space. Additionally, | ||
there is no more need to store results in the internal GRASS format - with {{cmd|r.external.out | there is no more need to store results in the internal GRASS format - with {{cmd|r.external.out}} the resulting maps are directly written to a GDAL supported format. | ||
'''Preparations''' | '''Preparations''' | ||
| Line 149: | Line 163: | ||
== References == | == References == | ||
* List of [ | * List of [https://scholar.google.com/scholar?hl=en&q=%2Bgrass+%2Bgis+%2Bwps&as_sdt=2001&as_ylo=&as_vis=0 GRASS-WPS articles] | ||
* [ | * [https://www.youtube.com/watch?v=zCnax9w1bCs PyWPS GRASS GIS 7 and QGIS with WPS plugin in action] | ||
* [ | * [https://code.google.com/archive/p/wps-grass-bridge/wikis/PyWPS_Integration.wiki PyWPS integration] | ||
Videos: | Videos: | ||
* [ | * [https://www.youtube.com/watch?v=zCnax9w1bCs PyWPS GRASS GIS 7 and QGIS with WPS plugin in action] | ||
* [ | * [https://www.youtube.com/watch?v=jg2pb_Xjq8Y Development of an Open Cloud GIS with GRASS GIS, PyWPS, the wps-grass-bridge and QGIS] | ||
== Historical note: GRASSLinks as a precursor to WPS == | == Historical note: GRASSLinks as a precursor to WPS == | ||
* GRASSLinks was originally developed from 1994-98 by Dr. Susan Huse at the Research Program in Environmental Planning and GIS (REGIS), at the University of California, Berkeley. This is claimed to be the first fully | |||
* GRASSLinks was originally developed from 1994-98 by Dr. Susan Huse at the Research Program in Environmental Planning and GIS (REGIS), at the University of California, Berkeley. This is claimed to be the first fully functional online GIS package offering public domain access to environmental and geographical data. | |||
* [http://uspest.org/glinks35/ OSU IPPC GRASSLinks 3.5beta: A web interface for GRASS GIS version 5.x] | * [http://uspest.org/glinks35/ OSU IPPC GRASSLinks 3.5beta: A web interface for GRASS GIS version 5.x] | ||
Latest revision as of 19:53, 1 December 2025
GRASS based OGC Web Processing Service (WPS) standard implementations
The OGC Web Processing Service (WPS) Web Processing Service interface standard provides rules for standardizing how inputs and outputs (requests and responses) for invoking geospatial processing services as a web service. GRASS GIS can be used as backend in several WPS service frameworks.
Linking to WPS server
A framework has been developed to make the integration of GRASS GIS in WPS server as easy as possible. The framework is called wps-grass-bridge and is available here:
- wps-grass-bridge: https://code.google.com/archive/p/wps-grass-bridge/
This framework support currently PyWPS, ZOO WPS and is used by 52North WPS server. Many GRASS GIS modules can be attached out of the box.
There are currently several other WPS implementations which use GRASS as GIS backbone:
- PyWPS: https://pywps.org/
- PyWPS and wps-grass-bridge connector: https://code.google.com/archive/p/wps-grass-bridge/wikis/PyWPS_Integration.wiki
- Gallery (live examples)
- PyWPS and GRASS: https://pywps-3.readthedocs.io/special/grass.html
- WPS by 52N: https://52north.github.io/WPS/
- Connecting to GRASS out of the box: https://github.com/52North/WPS/tree/dev/52n-wps-grass
- Backend: https://mvnrepository.com/artifact/org.n52.wps/52n-wps-grass
- 52N-WPS-GRASS Demo
- ZOO project - Open OSW Platform: https://zoo-project.org/
- R and WPS: WPS class
Inside GRASS
In GRASS, the WPS process description can be automatically generated with the option '--wps-process-description'. See announcement.
Example:
r.grow --wps-process-description
<?xml version="1.0" encoding="UTF-8"?>
<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"
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0
http://schemas.opengis.net/wps/1.0.0/wpsDescribeProcess_response.xsd"
service="WPS" version="1.0.0" xml:lang="en-US">
<ProcessDescription wps:processVersion="1" storeSupported="true" statusSupported="true">
<ows:Identifier>r.grow</ows:Identifier>
<ows:Title>Generates a raster map layer with contiguous areas grown by one cell.</ows:Title>
<ows:Abstract>https://grass.osgeo.org/grass-devel/manuals/r.grow.html</ows:Abstract>
<ows:Metadata xlink:title="raster" />
<ows:Metadata xlink:title="distance" />
<ows:Metadata xlink:title="proximity" />
<DataInputs>
<Input minOccurs="1" maxOccurs="1">
<ows:Identifier>input</ows:Identifier>
<ows:Title>Name of input raster map</ows:Title>
<ComplexData maximumMegabytes="2048">
<Default>
<Format>
<MimeType>image/tiff</MimeType>
</Format>
</Default>
<Supported>
<Format>
<MimeType>image/tiff</MimeType>
</Format>
<Format>
<MimeType>image/geotiff</MimeType>
</Format>
[...]
<Format>
<MimeType>application/x-netcdf</MimeType>
</Format>
</Supported>
</ComplexData>
</Input>
<Input minOccurs="0" maxOccurs="1">
<ows:Identifier>radius</ows:Identifier>
<ows:Title>Radius of buffer in raster cells</ows:Title>
<LiteralData>
<ows:DataType ows:reference="xs:float">float</ows:DataType>
<ows:AnyValue/>
<DefaultValue>1.01</DefaultValue>
</LiteralData>
</Input>
[...]
<Input minOccurs="0" maxOccurs="1">
<ows:Identifier>-m</ows:Identifier>
<ows:Title>Radius is in map units rather than cells</ows:Title>
<LiteralData>
<ows:DataType ows:reference="xs:boolean">boolean</ows:DataType>
<ows:AllowedValues>
<ows:Value>true</ows:Value>
<ows:Value>false</ows:Value>
</ows:AllowedValues>
<DefaultValue>false</DefaultValue>
</LiteralData>
</Input>
[...]
</Input>
</DataInputs>
<ProcessOutputs>
<Output>
<ows:Identifier>output</ows:Identifier>
<ows:Title>Name for output raster map</ows:Title>
<ComplexOutput>
<Default>
<Format>
<MimeType>image/tiff</MimeType>
</Format>
</Default>
<Supported>
<Format>
<MimeType>image/tiff</MimeType>
</Format>
<Format>
<MimeType>image/geotiff</MimeType>
</Format>
[...]
</Format>
<Format>
<MimeType>application/netcdf</MimeType>
</Format>
<Format>
<MimeType>application/x-netcdf</MimeType>
</Format>
</Supported>
</ComplexOutput>
</Output>
</ProcessOutputs>
</ProcessDescription>
</wps:ProcessDescriptions>
WPS workflow idea
External raster maps can directly be linked into GRASS with r.external which saves time and disk space. Additionally, there is no more need to store results in the internal GRASS format - with r.external.out the resulting maps are directly written to a GDAL supported format.
Preparations
GRASS can be used in an automated way by just defining a set of variables. See here for GRASS and Shell settings and GRASS and Python.
Data flow example
The script content could be looking like this:
# register (rather than import) a GeoTIFF file in GRASS GIS:
r.external input=terra_lst1km20030314.LST_Day.tif output=modis_celsius
# define output directory for files resulting from subsequent calculations:
r.external.out directory=$HOME/gisoutput/ format="GTiff"
# perform calculations (here: extract pixels > 20 deg C)
# store output directly as GeoTIFF file, hence add the .tif extension:
r.mapcalc "warm.tif = if(modis_celsius > 20.0, modis_celsius, null() )"
# cease GDAL output connection and turn back to write standard GRASS raster files:
r.external.out -r
# use the result elsewhere
qgis $HOME/gisoutput/warm.tif
References
Videos:
- PyWPS GRASS GIS 7 and QGIS with WPS plugin in action
- Development of an Open Cloud GIS with GRASS GIS, PyWPS, the wps-grass-bridge and QGIS
Historical note: GRASSLinks as a precursor to WPS
- GRASSLinks was originally developed from 1994-98 by Dr. Susan Huse at the Research Program in Environmental Planning and GIS (REGIS), at the University of California, Berkeley. This is claimed to be the first fully functional online GIS package offering public domain access to environmental and geographical data.
- OSU IPPC GRASSLinks 3.5beta: A web interface for GRASS GIS version 5.x