You are here: Wiki>SensorWeb Web>SensorWebClient>RESTfulTimeseriesWebApp (26 Apr 2013, HenningBredel)Edit Attach

RESTfulTimeseriesWebApp

ALERT! The REST API documentation is subject to be merged with the SensorWebClientRESTInterface page! Please note that the REST API is under development and that the protocol, links, parameters may be changed without notice.

Description

The modularization (server and UI) of the Sensor Web Client makes it possible to re-use only parts of the whole thing. An example is the restful-timeseries-webapp web application which defines a custom JSON protocol for requesting time series data and metadata information. It only re-uses server side components of the client so that no GUI has to be deployed or installed when you have your own {Javascrip,PHP,Whatever}-Client to display time series data.

Build and configure the Web App

Check out the Client code and build the restful-timeseries-webapp from root project via mvn clean install -pl restful-timeseries-webapp.

Configuration

  • set the default width/height parameters in ${restful-timeseries-webapp}/WEB-INF/classes/dispatcher-control.xml or before building: ${restful-timeseries-webapp}/src/main/resources/dispatcher-control.xml
  • See BestPracticeDifferentPropertySetsInMaven for using customized properties laying in your user home directory.

JSON protocol

to request a time series

The protocol is quite simple. Have a look at the following examples how it looks like. The parameters width and height are optional and do make most sense when requesting a diagram rather than raw data.
{
    "begin": "2012-06-22T12:40:37Z",
    "end": "2012-06-23T12:40:37Z",
    "width": 400,
    "height": 150,
    "parameters": [
        {
            "clientId": "0",
            "offering": "ABFLUSS_ROHDATEN",
            "procedure": "Abfluss-Barby_502070",
            "phenomenon": "Abfluss",
            "featureOfInterest": "Barby_502070"
        },
        {
            "clientId": "1",
            "offering": "ABFLUSS_ROHDATEN",
            "procedure": "Abfluss-Eisenhuettenstadt_603000",
            "phenomenon": "Abfluss",
            "featureOfInterest": "Eisenhuettenstadt_603000"
        },
        {
            "clientId": "2",
            "offering": "LUFTTEMPERATUR_ROHDATEN",
            "procedure": "Lufttemperatur-Anderten_31010063",
            "phenomenon": "Lufttemperatur",
            "featureOfInterest": "Anderten_31010063"
        }
    ]
} 

to request metadata

All given filter options are optional to request metadata.

The filter offeringFilter, phenomenonFilter, featureOfInterestFilter, procedureFilter can be defined as arrays with matching strings.

The options offset and size enables a paging mechanism to request the metadata in more than one request.

And the spatialFilter is defined as bounding box as seen in the example below.

{
    "offeringFilter":[],
    "phenomenonFilter":["Abfluss"],
    "featureOfInterestFilter":[],
    "procedureFilter":[],
    "pagingStartIndex":0,
    "pagingInterval":0,
    "spatialFilter":{
        "srs":"4326",
        "lowerLeft":{
            "easting":6,
            "northing":50
        },
        "upperRight":{
            "easting":9,
            "northing":53
        }
    }
}

FAQ

Please refer to the SensorWebClient's FAQ first. Specific questions regarding to the RESTfulTimeseriesWebApp are covered in this section.
Topic revision: r7 - 26 Apr 2013, HenningBredel
Legal Notice | Privacy Statement


This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Wiki? Send feedback