Wednesday, March 28, 2007

FAQ About OGC Compatible Map Services - Development

- Integration with WFSs and other WMSs
- Implementing as Web Services
- Capability-Based WMS Federations
- Performance issues with archived data access and rendering

13. Why did you implement GIS services in Web Services principles? What is the gain of extending OGC GIS as Web Services?
Web Services give us a means of interoperability between different software applications, running on a variety of platforms. A Web Services support interoperable machine-to-machine interaction over a network.
Distribution: It will be easier to distribute geospatial data and applications across platforms, operating systems, computer languages, etc.
Integration: It will be easier for application developers to integrate geospatial functionality and data into their custom applications.
Infrastructure: The GIS industry could take advantage of the huge amount of infrastructure that is being built to enable the Web Services architecture – including development tools, application servers, messaging protocols, security infrastructure, workflow definitions, etc.Easy to extend: Web Services have lots of specifications. By using any configuration of these specifications we will make our implementation more secure, more robust and fault tolerant as Web Service specs improve themselves.

14. OGC introduces capability concept to describe services. What are the differences between WSDL and capability?
WSDL is Web Service Description Language. Web Service is software that makes services available on a network using technologies such as HTTP, XML and SOAP. Web Service enables loosely coupling of services and interoperability. WSDL describes Web Services’ service functionality in operations and messages. WSDL enables access to functions through describing data encodings, location and communication protocols WSDL enables client to invoke the service’s operations through generating of stubs and skeletonsSO, Web Services are service based, in contrast capability is service+data related. Below figure shows the WSDL structure roughly with fundamental tag elements.

In order to get better view of the figure, please click on it.

See the capability structure represented with its main tag elements in FAQ for Users section Q12.

15. OGC introduces capability concept to describe services. What is the difference between metadata and capability?
Metadata is data describing data. Data might be paper, article, image, sound, spatial, temporal etc. To give an example, suppose data is article, so metadata might be consists of “author”, “title”, “subject”, “source type”, “format” and possibly more. Metadata enables describing and sharing information between different data sources and applications.
SO, metadata is data based, in contrast capability is service+data related.
Here is a sample metadata describing a resource created by merging Dublin Core in RDF.

In order to get better view of the figure, please click on it.

16. How is the data stored, will it be in GML, what database is mostly used?
The Web Feature Service starts processing user requests by extracting the database query from the request (encoded as a GML Filter – see below figure) and uses this to construct a corresponding MySQL query. The results of the database querying process are used to create a GML FeatureCollection which usually contains multiple features.Sample query “getFeature” encoded in XML (WMS sends to WFS to get feature data):

In order to get better view of the figure, please click on it.

17. How does WMS get the data from WFS and in what format?
WMS uses basic WFS services. These are getCapabilities, describeFeatureType, and getFeature. Invocation is done through client stubs created at the WMS side according to WFS’s WSDL file before run-time. Before invocation WMS also sends a getCapabilities requests to WFS to learn which feature types WFS provides and what operations are supported on each feature type. When WMS receives any getMap or getFeatureInfo request, it creates a getFeature (see the figure in previous question -16-) request and sends it to WFS. As a response WFS sends back the set of result features meeting the search criteria to WMS as a GML encoded in XML. In case of using streaming WMS, the result feature set is returned in streaming through NaradaBrokering messaging middleware in the form of byte arrays. In case of using pure Web Service version the result set is returned as XML document in the built-in format
. We prefer to use streaming data approach by using NaradaBrokering.

18. Can you give a sample “getCapabilities” request for Web Map Server?
WMS receives getCapabilities request in below format and returns its capabilities listed in Q12.

19. Can you give a sample “getMap” request for Web Map Servers?
WMS received getMap request and returns a map in a form defined in the tag “format” which is under the tag “image”.

20. Can you give a sample “getFeatureInfo” request for Web Map Servers?
WMS receives getFeatureInfo request and returns content of the feature data falling in close neighborhood (small bbox) of the clicked point on the map. Return type is mostly html or text.

21. Why do you prefer using streaming data approach through NaradaBrokering ?
In case of sending the result GML set in the form of string causes some problems when the GML is larger than some amount of size. Since the WFS returns the resulting XML document as an , this has to be constructed in memory and the size will depend on several parameters such as the system configuration and memory allocated to the Java Virtual Machine etc. Consequently there will be a limit on the size of the returned XML documents. For these reasons we have investigated alternative ways for data transport and researched use of topic based publish-subscribe messaging systems for streaming the data. Our research on NaradaBrokering shows that it can be used to stream large amount of data between nodes without significant overhead. Additional capabilities such as reliable messaging and support for different transport protocols already inherent in NaradaBrokering show that it is a powerful yet easy to integrate messaging infrastructure. For these reasons we have developed a novel Web Map Service and Web Feature Service that integrate Open Geospatial Consortium specifications with Web Service-SOAP calls and NaradaBrokering messaging system.

22. How does data streaming from WFS to WMS work to display a scientific data?
The clients make the requests with standard SOAP messages but for retrieving the results a NaradaBrokering subscriber class is used. Through first request to web service getFeature, WMS gets the topic (publish-subscribe for a specific data), IP and port on which WFS is streaming requested data. Second request is done by NaradaBrokering Subscriber. Even whole data is not received by WMS; WMS can draw the map image with the returned science data. This depends on the WMS’s implementation.

23. In order to get further information about the feature data displayed on the map, I selected “i” map tool and clicked on the feature data on the map and saw the content data displayed in a pop-up window. How does it work?
This is done through invoking “GetFeatureInfo” interface of WMS. GML is consists of content and presentation parts. WMS’s “GetFeatureInfo” interface enables displaying of content part of the data falling in a small area. This small area is around the point that user defines by clicking on the map and formulated by WMS Client as bbox and embedded in getFetatureInfo query. Area calculation in bbox changes depending on the zoom level. If you can’t get any result you should change your resolution level by zoom-in or out. When WMS get GetFeatureInfo, it creates getFeature request and sends it to WFS. Upon receiving returned GML, it extracts the content part (all but geometry elements) and converts it to HTML by using deployed XSLT and XSLT machine. It then returns HTML file to the client. The returned HTML document’s format is defined in XSLT.

24. How do you convert feature data into HTML?
When WMS get GetFeatureInfo, it creates getFeature request and sends it to WFS. Upon receiving returned GML, WMS extracts the content part (all but geometry elements) and converts it into HTML by using deployed XSLT and XSLT machine. It then returns HTML file to the client. The returned HTML document’s format is defined in XSLT.

25. How do you transfer and display large amount of scientific data (such as 60MB) in XML format?
In order to increase the performance we use innovative techniques. Regarding the transfer of large data sets see my explanation in Q21 and Q22. Regarding the parsing and rendering the returned GML, we use Pull Parsing technique (see Q26).

26. Why do you use pull parsing? What are the advantages over DOM and SAX parsing techniques?
In case of using pull parsing, the parser only parses what is asked for by the application rather than passing all events up to the client application. The pull approach of this parsing model results in a very small memory footprint (no document state maintenance required – compared to DOM), and very fast processing (fewer unnecessary event callbacks - compared to SAX).
Pull parsing does not provide any support for validation. This is the main reason that it is much faster than its competitors. If you are sure that data is completely valid, or if validation errors are not catastrophic to your system, or you can trust validation on the server, then using XML Pull Parsing gives the highest performance results.
Since we know that returned data is GML and know all possible tag names of the possible geometry elements, it is very advantageous using pull parsing.
XML Pull Parsing Web Site:
Please see the below article where XPP2 document model is compared with other leading Java based XML parsing implementations.

27. How do you convert GML to SVG?
We convert GML to SVG by using XSLT.

28. How does WMS send the map images to the requester (WMS Client)?
There two ways one is a common pure OGC approach through HTTP and other is through SOAP messages using client stubs for the getMap interface.
In case of using HTTP, result is sent to client through java’s servlet classes. For example result is written to client port by using HttpServletResponse’s object. Client does not need to write any client stub or anything. He just put the URL on the web browser in a correct format defined in OGC specifications, and gets the map on the browser.In case of using SOAP, WMS returns maps in image MIME types such as image/jpeg, before returning WMS converts maps into javax.activation.DataHandler object and attaches it to SOAP message. Client needs to create stubs before runtime in order to invoke Web Service interface of “getMap” by using online WSDL file of the WMS.

29. How do you create map images from the GML data after getting it from WFS? And, how do you overlay vector data from WFS over another layers coming from other WMSs?
There are twp possible options to create a map from the WMS point of view. One is creating SVG first from the GML through XSLT and converting SVG to any image type by using java libraries. Another is extracting geometry elements by using Pull parsing technique and drawing and displaying the map by java Image object. From our experience and performance tests we figured out that second approach has higher performance results then the first approach.
Web Map and Feature Services cooperate to create map images. XML-represented geographical features obtained from Web Feature Services are converted by Web Map servers into images using matrix-pixel (raster data), or points, lines and polygons (vector data). The basic operations related to mappings include discovering the physical address of the data providers, transferring the data from data servers and rendering it to create a map.The figure below helps to explain a few more questions here (Ex. Q17, Q28 and Q30). Information Service (IS) in the figure is not completed exactly. Currently, we read the addresses of WFS and other Map services providing requested data from the WMS capability file. In the future, we plan to use any Information Service completing the architecture illustrated below.

In order to get better view of the figure, please click on it.

30. How does WMS provide services through two different protocol in your implementation, one is over HTTP and other as Web Services?
The difference of these two is at the interface level. I have written a request handler for both protocols. Request handlers get the request (in case of Web Services, they are structured XML format – getMap, getFeature or getCapabilities) and parse and extract all the parameters. After having request name and related parameters, remaining jobs are all handled through the same classes and handlers.

Monday, March 26, 2007

FAQ About OGC Compatible GIS Systems - Definitions

Key Terms and Definitions :

1. What is GIS?

Geographical Information Systems (GIS) introduce methods and environments to visualize, manipulate, and analyze geospatial data. The nature of the geographical applications requires seamless integration and sharing of spatial data from a variety of providers. Interoperability of the services across organizations and providers is the main goal for GIS.

2. What is OGC?

The Open Geospatial Consortium (OGC) defines a number of standards (both for data models and for online services) that have been widely adopted in the Geographical Information System (GIS) community. OGC is a non-profit, international standards organization that is leading the development of standards for geographic data related operations and services. OGC has variety of contributors from different areas such as private industry and academia to create open and extensible software application programming interfaces for GIS.
The most important OGC specifications are WMS, WFS, WCS and GML.

3. What are the main OGC services in order to create the simplest GIS?
In simplest case, you should have a database (MySQL, Oracle or any other), Web Feature Server providing data from this database and Web Map Server to create map images by rendering data coming from WFS or/and any other WMS. See the below figure for the simplest representation of an OGC compatible GIS systems.

4. Is there any relation between ISO (International Standard Organization) and OGC?
OGC has a close relationship with ISO/TC 211 (Geographic Information/Geomatics). The OGC abstract specification is being progressively replaced by volumes from the ISO 19100 series under development by this committee. Further, the OGC standards Web Map Service and Simple Features are ISO standards. GML will soon be approved as an ISO standard.

5. What is WMS?
Web Map Service produces maps from geographic data. A map is not the data itself. Maps create information from raw geographic data. Maps are generally rendered in pictorial formats such as jpeg, GIF, png. WMS also produce maps from vector-based graphical elements in Scalable Vector Graphics (SVG).
WMS provides three operations protocols (GetCapabilities, GetMap, and GetFeatureInfo) in support of the creation and display of registered and superimposed map like views of information that come simultaneously from multiple sources that are both remote and heterogeneous.
Basically there are two types of WMS defined in the specifications. These are basic WMS and SLD-enabled WMS. For the basic WMS, there are three operations defined. These are getCapabilities, getMap, GetFeatureInfo.
WMS publishes its ability and data holdings in its capabilities document. This document is encoded in XML. WMS classifies its geographic data holdings in the “Layers” and gives information about the styles available for these Layers. Each layer can have sub layers and the sub layers can have different styling defined for them.
A Web Map Service is usually not invoked directly. More often, it is invoked by a client application that provides the user with interactive controls. This client application may or may not be web-based

6. What is WFS?
Web Feature Service (WFS) is an intermediary server sitting in front of the archived data kept in the Databases or files systems and, provides data manipulation operations.
Clients interact with a Web Feature Service by submitting database queries encoded in Open Geospatial Consortium Filter Encoding Implementation and in compliance with the Open Geospatial Consortium’s Common Query Language.
As a minimal requirement a basic Web Feature Service should be able to provide requested geographical information as Geographic Markup Language feature collections. However, more advanced versions also support “create, update, delete and lock operations”. Three operations must be supported by a basic Web Feature Service: GetCapabilities, DescribeFeatureType and GetFeature.

7. What is GML?
GML is an XML encoding for the transport and storage of geographic information, including both the spatial (attributes) and non-spatial (geometric) properties of geographic features. GML defines a data encoding in XML that allows geographic data and its attributes to be moved between disparate systems with ease XML encoding of geospatial information. It is human-readable and separates contents from presentation. Presentation is basically represented under the “geometry” tag elements.
If some one wants to define a GML schema for a feature, he should import the Geometry schema (geometry.xsd) the Feature Schema (feature.xsd) and the XLinks schema (xlinks.xsd) as base schemas.
WMS requests feature data from the WFS in the form of GML. WFS store and serve the geospatial data encoded in GML.

8. What is feature?
A feature is an abstraction of a real world phenomenon; it is a geographic feature if it is associated with location relatives to the earth such as faults, rivers, roads, lakes. All the feature instances should be created according to the schema files and encoded in GML.

9. What are the vector and raster data?
Vector data deals with discrete phenomena, each of which is conceived of as a feature. The spatial characteristics of a discrete real world phenomenon are represented by a set of one or more geometric primitives (points, curves, surfaces, or solids). Other characteristics of the phenomenon are recorded as feature attributes. Usually, a single feature is associated with a single set of attribute values.
Raster data deals with real world phenomena that vary continuously over space. It contains a set of values, each associated with one of the elements in a regular array of points or cells. It is usually associated with a method for interpolating values at spatial positions between the points or within the cells.

10. What is coverage data?
OGC uses the term “coverage” to refer to any data representation that assigns values directly to spatial position. Coverage is a feature that associates positions within a bounded space (its spatiotemporal domain) to feature attribute values (its range). Examples include a raster image, a polygon overlay, or a digital elevation matrix. The spatio-temporal domain of coverage is a set of geometric objects described in terms of direct positions. Commonly used spatio-temporal domains include point sets, grids, collections of closed rectangles, and other collections of geometric objects.

11. What is spatial and geo-spatial data?
Spatial data are a kind of data that pertains to the space occupied by objects. Example spatial data from the real world are cities, rivers, roads, states, crop coverage, mountain ranges etc. In the implementation these are represented by points, lines, rectangles, surfaces, volumes and etc. Spatial data have some common characteristics. These type of data are geometric data and in high dimensions. These data can be either discrete (vector) or continuous (raster). GIS applications are applied on these types of data.
Geospatial data are spatial data associated with a location relative to the Earth.

12. What is the term “capability” in OGC used for?
Each GIS service defined in OGC has a capability file encoded in XML. There is no common format for the capability valid across all the OGC defined services. All the OGC services has getCapability service interface in order to return capabilities metadata. Capabilities function as “service” metadata, providing information about what the service offers. Clients to the services determine whether they can work with that server based on its capabilities.

Thursday, March 22, 2007

Status Report for 03/21/2007

Here is the link to the document explaining my research issues :
Note: All the updates I had mentioned in my previous post are done.

ABSTRACT: We have been working on creating Geo-Science grids and integrating them with Web based map and data rendering services such as WMS and Sci-Plotting. Integrating them with Geo-Science grids revealed that data rendering takes a lot of time due to querying, transforming, rendering and displaying spatial data. One can overcome these problems by caching and load balancing. However, current load balancing approaches are not suitable for rendering of variable sized and un-evenly distributed spatial data. We therefore propose a framework of "load balancing with caching" overcoming performance and scalability problems in rendering of distributed spatial data in order to make our map and plotting services feasible to use in Geo-Science grids.


Thursday, March 08, 2007

Status Report for 03/07/2007

Here is the draft document explaining "dynamic load balancing with caching for spatial data rendering".

The document includes the updates based on the feedbacks listed in my previous post.

Abstract of the document:
We have been working on creating Geo-Science grids, integrating them with Web based map and data rendering services such as WMS and Sci-Plotting services. Integrating these services with Geo-Science grids applications revealed that data rendering takes a lot of time due to querying, transforming, rendering and displaying spatial data. One can overcome these problems by caching and load balancing. However, current load balancing approaches are not suitable for rendering of variable sized and un-evenly distributed spatial data. We therefore propose a framework of load balancing with caching to overcome performance and scalability problems in rendering of distributed spatial data.

I will be working on it more (especially for Section 3).