The Geospatial Web provides data as well as processing functionality using web interfaces. Typical examples of such processes are models and predictions for spatial data, known as spatial statistics. Such analyses are written by domain experts in scripting languages and rarely exposed as web services. We present a concept of script annotations for automatic deployment in server runtime environments and demonstrate it with an implementation based on the open standards and open source components OGC Web Processing Service and R.
Short paper:
http://www.agile-online.org/Conference_Paper/CDs/agile_2013/Short_Papers/SP_S3.1_Hinz.pdf
Designing IA for AI - Information Architecture Conference 2024
Spatial Statistics on the Geospatial Web
1. Spatial Statistics on the
Geospatial Web
Matthias Hinz, Daniel Nüst, Benjamin Proß,
Edzer Pebesma
2. AGILE 2013 - Spatial Statistics on the Geospatial Web 2
Web Service (mediation layer)
Domain
Scientists
Scripting Environment
(software / languages)
Web Developer /
Admin
Heterogeneous
Audience
…
browser clients
community platforms
GIS-applications
services
Process Sharing
mobile devices
Geospatial Web
3. AGILE 2013 - Spatial Statistics on the Geospatial Web 3
Run the script as a
web process
Upload script
to server
Enhance
script
4. AGILE 2013 - Spatial Statistics on the Geospatial Web 4
The Annotation Concept
metadata
technical instructions
has name + parameter list
as code comments
locally and on a server
5. AGILE 2013 - Spatial Statistics on the Geospatial Web 5
Four Annotation Types
general process description
dynamic inputs
process outputs
resources
6. AGILE 2013 - Spatial Statistics on the Geospatial Web 6
1) General Process Description
# des: id = my42process, title= “my script”,
# abstract = “analyze 42 things”,
# author= “me”;
# myRuntime.des: id = …
7. AGILE 2013 - Spatial Statistics on the Geospatial Web 7
# number for factorization
myFactor <- 10
2) Dynamic Inputs
8. AGILE 2013 - Spatial Statistics on the Geospatial Web 8
2) Dynamic Inputs
# number for factorization
myFactor <- 10
# in: id = myFactor, type = integer,
# title = “numerical factor”,
# abstract = “the number to be used
# for factorization”,
# value = 1,
# minOccurs = 0, maxOccurs = 1;
9. AGILE 2013 - Spatial Statistics on the Geospatial Web 9
# number for factorization
# off;
myFactor <- 10
# on;
# in: id = myFactor, type = integer,
# title = “numerical factor”,
# abstract = “the number to be used
# for factorization”,
# value = 1,
# minOccurs = 0, maxOccurs = 1;
2) Dynamic Inputs
10. AGILE 2013 - Spatial Statistics on the Geospatial Web 10
3) Process Outputs
# number for factorization
myResult <- myAlgorithm(1, 2, myDataSet)
# out: id = myResult, type = string,
# title = “factorized output”,
# abstract = “output number as text in
# scientific notation (a x 10^b)”;
11. AGILE 2013 - Spatial Statistics on the Geospatial Web 11
4) Resources
# res: file1.data, file2.zip, file3.txt,
...;
# load auxiliary data
data1 <- foo("file2.zip")
data2 <- bar(“fixed_path/file3.txt")
12. AGILE 2013 - Spatial Statistics on the Geospatial Web 12
Ignore flags
# off;
script.part.to = be_ignored_on_server()
# on;
script.part.to = run_on_the_server()
13. AGILE 2013 - Spatial Statistics on the Geospatial Web 13
Application Example: WPS4R
Rserve
WPS Client
HTTP
GET /
POST
TCP /
IP
Web Admin Console
- Upload R scripts
- Manage processes
- Config parameters
WPS4R
XML
Requests /
Responses
R
HTTP
GET /
POST
User Administrator
Apache Tomcat Server
Processing
Service
14. AGILE 2013 - Spatial Statistics on the Geospatial Web 14
Example: Interpolation
+Kappasys WPS-Client
Quantum GIS
15. AGILE 2013 - Spatial Statistics on the Geospatial Web 15
WPS Process Description
[…] <ProcessDescription statusSupported="true"
storeSupported="true" wps:processVersion="1.0.0">
<ows:Identifier>org.n52.wps.server.r.Idw</ows:Identifier>
<ows:Title>Inverse distance weighted
interpolation</ows:Title>
<ows:Abstract>A simple interpolation carried out by R,
uses packages gstat, sp and rgdal</ows:Abstract>
<ows:Metadata xlin:title="R Script used for this process"
xlin:href="http://localhost:8080/wps/R/scripts/Idw.R"/>
<ows:Metadata xlin:title="Resource Directory URL"
xlin:href="http://localhost:8080/wps/R/resources" />
<ows:Metadata xlin:title="R Session Info"
xlin:href="http://localhost:8080/wps/R/sessioninfo.jsp"/>
<DataInputs> […]
# wps.des: id = idw,
# title = "Inverse distance weighted interpolation",
# abstract = "A simple interpolation carried out
# by R, uses packages gstat, sp and rgdal",
# author = "Matthias Hinz";
16. AGILE 2013 - Spatial Statistics on the Geospatial Web 16
17. AGILE 2013 - Spatial Statistics on the Geospatial Web 17
18. AGILE 2013 - Spatial Statistics on the Geospatial Web 18
Example: Live WeatheR Plots
live sensor data
analysis on server
image output
19. AGILE 2013 - Spatial Statistics on the Geospatial Web 19
20. AGILE 2013 - Spatial Statistics on the Geospatial Web 20
Conclusion
annotation framework
script-based web processing
demo with open source framework
open approach
reproducibility
21. AGILE 2013 - Spatial Statistics on the Geospatial Web 21
Outlook
security
provenance
rights
further implementations / tools
usability
bidirectional communication
22. AGILE 2013 - Spatial Statistics on the Geospatial Web 22
Thanks for your Attention!
23. AGILE 2013 - Spatial Statistics on the Geospatial Web 23
Resources
WPS4R Website:
https://wiki.52north.org/bin/view/Geostatistics/
WPS4R
24. AGILE 2013 - Spatial Statistics on the Geospatial Web 24
Further Information
25. AGILE 2013 - Spatial Statistics on the Geospatial Web 25
Server Environment Variables
if(exists(“server”) && server == TRUE){
srv.metadata = get_server_url();}
26. AGILE 2013 - Spatial Statistics on the Geospatial Web 26
Annotated R script: IDW
27. AGILE 2013 - Spatial Statistics on the Geospatial Web 27
WPS Process Description
[…]
<Input minOccurs="1" maxOccurs="1">
<ows:Identifier>attributename</ows:Identifier>
<ows:Title>Attribute name</ows:Title>
<ows:Abstract>Name of the attribute to be
interpolated, musst match the
observations</ows:Abstract>
<LiteralData>
<ows:DataType ows:reference="xs:string" />
<ows:AnyValue />
</LiteralData>
</Input>
[…]
# wps.in: attributename, string, "Attribute name",
# "Name of the attribute to be interpolated,
# must match the observations";
28. AGILE 2013 - Spatial Statistics on the Geospatial Web 28
WPS Process Description
[…]
<DataInputs>
<Input minOccurs="1" maxOccurs="1">
<ows:Identifier>points</ows:Identifier>
<ows:Title>Observations</ows:Title>
<ows:Abstract>The point observations and
measurements
to be interpolated</ows:Abstract>
<ComplexData>
<Default>
<Format>
<MimeType>application/x-zipped-
shp</MimeType>
</Format>
</Default>
<Supported>
<Format>
<MimeType>text/xml;subtype=gml/3.0.0</MimeType>
<Encoding>UTF-8</Encoding>
<Schema>http://schemas.opengis.net/gml/3.
0.0/base/feature.xsd</Schema>
</Format>
<Format> […]
29. AGILE 2013 - Spatial Statistics on the Geospatial Web 29
WPS Process Description
[…]<Output>
<ows:Identifier>result</ows:Identifier>
<ows:Title>Interpolated predictions</ows:Title>
<ows:Abstract>A raster file that contains
predictions for the observed area</ows:Abstract>
<ComplexOutput>
<Default>
<Format>
<MimeType>image/geotiff</MimeType>
</Format>
</Default>
<Supported>
<Format>
<MimeType>application/image-ascii-
grass</MimeType>
<Encoding>base64</Encoding>
</Format> […]
# wps.out: result, image/geotiff,
# "Interpolated predictions",
# "A raster file that contains predictions
# for the observed area";