• No results found

Implementation and Integration into a 3D/4D Geodatabase

4 Infrastructure for the Dissemination of Spatio-Temporal Data

4.3 Implementation and Integration into a 3D/4D Geodatabase

Due to an implementation of Web services for spatio-temporal data, a link to various clients such as generic mobile GIS can be established. During the design of such Web services the processing of requests for spatio-temporal data and spatio-temporal analysis capabilities were clearly separated and divided into two independent Web services. How- ever, both Web services (WFS and WPS) are based on the same foundation as the work- flow and the request handling basically follow the same principles.

First, it must be determined how to address the Web service. The specifications of the WFS and WPS instruct that queries are directed to an appropriate URL in two different ways: using a KVP-technique or with the help of XML documents, cf. Chapter 2.5. Basi- cally, an OGC Web service can be rather associated to the category of SOAP services since requests are particularly specified by the use of XML documents. However, the imple- mentation of a proper SOAP interface is optional and a pure REST interface is currently still under development, cf. Chapter 2.5.1. For this reason, the two common standard methods (KVP and XML) are implemented within this thesis. Therefore, the following modules are required:

 A Web Application Framework (WAF) for the processing of URL requests and the transport of data via the HTTP.

 An XML parser for the processing of XML requests.

 Connection to a 3D/4D geodatabase for the processing of spatial and spatio-tem- poral operations in the backend.

For the specific implementation of the Web services the Restlet32 framework is used as a

WAF. This framework provides an appropriate solution for the processing of the HTTP request types GET and POST and can be implemented directly on top of the API of a 3D/4D geodatabase. Due to a direct access of the API it is possible to maximize the func- tionality of the Web services. There are two types of XML parser to choose from, which differ fundamentally from each other: Document Object Model (DOM) and Simple API for

XML (SAX). In this case a SAX parser is used due to a better memory handling. The 3D/4D

geodatabase in the backend is realized by the geodatabase architecture DB4GeO, cf.

Chapter 2.4.1 and 5.3.

4.3.1 Web Feature Service

The implementation of the WFS for spatio-temporal data is based on a WFS that was implemented for the exchange of 3D data based on d-simplicial complexes [Breunig et al., 2013b]. Therefore, an existing REST-based data access and processing framework for 3D data is used [Breunig et al., 2013a].

The main classes for the development of the WFS are the classes OGCServer and OG- CServices. The class OGCServer starts the actual server on a system. Therefore, a port, e.g. 8182 must be specified. Afterwards the server is accessible via a specific URL, e.g. http://myServer.gik.kit.edu:8182. Requests are accepted at this URL. Therefore, so called resources are assigned to specific paths of the URL. Specific requests are assigned to corresponding resources and are processed further in appropriate clas- ses. Following this approach, the WFS resource class WFSObjectResource was de- veloped for the handling of specific KVP-requests and is registered as follows:

router.attach("/{projectname}/wfs?{query}", WFSObjectResource.class);

32 Restlet framework – an open source framework for the development of RESTful APIs:

111 The class WFSObjectResource is a standalone resource class that is based on the class BaseResource. Here, the actual processing of the WFS request takes place. Ini- tially, the request type (GetCapabilities, DescribeFeatureType or GetFeature) is deter- mined and the parameters of the request are prepared accordingly. Depending on the request type a result is prepared, e.g. for a DescribeFeatureType request an XML docu- ment that contains the information about the 4D object is sent to the client. An overview of the class WFSObjectResource is illustrated in Figure 63.

Figure 63 - UML class diagram of WFSObjectResource.

For the handling of POST requests that are used with XML documents, the resource class is registered as follows:

router.attach("/{projectname}/wfs", WFSObjectResource.class);

In such a case the requests are processed in the class WFSObjectResource. The method accept was explicitly developed for the handling of POST requests. The sub- mitted XML document is processed using a SAX parser that prepares the information ac- cordingly. Subsequently, e.g. for a GetFeature request, the corresponding spatio-tem- poral data is queried directly from the 3D/4D geodatabase and is delivered to the client via HTTP. The client can specify an optional request parameter "output format" to choose between the output formats GOCAD and WebGL.

An overview of the implementation of the WFS for spatio-temporal data based on the Restlet framework is illustrated in Figure 64.

Figure 64 - Implementation of the WFS for spatio-temporal data based on the Restlet framework.

4.3.2 Web Processing Service

The WPS for the provision of spatio-temporal operations and analysis functions is based on first attempts on a WPS for a 3D geodatabase [Breunig et al., 2013b]. The main classes for the development of the WFS are the classes OGCServer and OGCServices, the

113 same as for the WFS. The resource class WPSObjectResource preprocesses all WPS queries and is registered for handling of KVP-based requests as follows:

router.attach("/{projectname}/wps?{query}", WPSObjectResource.class);

The class WPSObjectResource is a standalone resource class that is derived from the class BaseResource. In this class the actual processing of the WPS request takes place. Initially, the request type (GetCapabilities, DescribeProcess or Execute) is determined and the parameters of the request are prepared accordingly. Depending on the request a re- sult object is prepared: e.g. for a DescribeProcess request an XML document is sent to the client that contains the information about the process that was specified in the query. An overview of the class WPSObjectResource is illustrated in Figure 65.

Figure 65 - UML class diagram of WPSObjectResource.

For the handling of POST requests at which XML documents are used for the specification of a query, the appropriate resource class is registered as follows:

router.attach("/{projectname}/wps", WPSObjectResource.class);

The requests are processed within the class WPSObjectResource. The method ac- cept handles such POST requests. The submitted XML document is processed by a SAX parser and the information of the XML document is prepared accordingly. Subsequently, e.g. for an Execute request, the corresponding spatio-temporal data is processed directly

within a 3D/4D geodatabase. Afterwards the result is delivered to the client via HTTP. There are different results depending on the process. For instance, the process averag-

espeed returns a double value.

Spatio-temporal objects that are specified within a request are managed in a 3D/4D geo- database, e.g. DB4GeO. An overview of the implementation of the WPS for spatio-tem- poral data based on the Restlet framework is illustrated in Figure 66.

Figure 66 - Implementation of the WPS for spatio-temporal data based on the Restlet framework.

With the development of the two Web services WFS and WPS an interface between a spatio-temporal database and various client applications such as 3D modelling tools and mobile GIS has been established. It was shown that the adaptation of these two OGC standards is a suitable basis for the dissemination of spatio-temporal data and spatio- temporal operations. An implementation of the data management model for spatio-tem- poral data can be a suitable data source for such Web services, cf. Chapters 5.3 and 6.3.

115