Upload
matthias-hinz
View
7.716
Download
2
Tags:
Embed Size (px)
DESCRIPTION
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
Citation preview
Spatial Statistics on the
Geospatial Web
Matthias Hinz, Daniel Nüst, Benjamin Proß,
Edzer Pebesma
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
AGILE 2013 - Spatial Statistics on the Geospatial Web 3
Run the script as a
web process
Upload script
to server
Enhance
script
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
AGILE 2013 - Spatial Statistics on the Geospatial Web 5
Four Annotation Types
general process description
dynamic inputs
process outputs
resources
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 = …
AGILE 2013 - Spatial Statistics on the Geospatial Web 7
# number for factorization
myFactor <- 10
2) Dynamic Inputs
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;
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
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)”;
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")
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()
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
AGILE 2013 - Spatial Statistics on the Geospatial Web 14
Example: Interpolation
+Kappasys WPS-Client
Quantum GIS
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";
AGILE 2013 - Spatial Statistics on the Geospatial Web 16
AGILE 2013 - Spatial Statistics on the Geospatial Web 17
AGILE 2013 - Spatial Statistics on the Geospatial Web 18
Example: Live WeatheR Plots
live sensor data
analysis on server
image output
AGILE 2013 - Spatial Statistics on the Geospatial Web 19
AGILE 2013 - Spatial Statistics on the Geospatial Web 20
Conclusion
annotation framework
script-based web processing
demo with open source framework
open approach
reproducibility
AGILE 2013 - Spatial Statistics on the Geospatial Web 21
Outlook
security
provenance
rights
further implementations / tools
usability
bidirectional communication
AGILE 2013 - Spatial Statistics on the Geospatial Web 22
Thanks for your Attention!
AGILE 2013 - Spatial Statistics on the Geospatial Web 23
Resources
WPS4R Website:
https://wiki.52north.org/bin/view/Geostatistics/
WPS4R
AGILE 2013 - Spatial Statistics on the Geospatial Web 24
Further Information
AGILE 2013 - Spatial Statistics on the Geospatial Web 25
Server Environment Variables
if(exists(“server”) && server == TRUE){
srv.metadata = get_server_url();}
AGILE 2013 - Spatial Statistics on the Geospatial Web 26
Annotated R script: IDW
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";
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> […]
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";