Spatial Databases: Lecture 6 DT211-4 DT228-4 Semester 2 2010 Pat Browne Web Mapping http://www.archaeology.ie/smrmapviewer/mapviewer.aspx http://www.openapp.ie/geospatial/demonstration/ Firefox http://spatial.dcenr.gov.ie/imf/imf.jsp?site=GeoUrban
W3C and location • Location and geographical properties of resources has always been something of a dilemma for the World Wide Web, which has served so well to unlink the global identity of a resource from its physical location on the globe. One of the Web's greatest values is its capacity for enabling the growth of communities which are not constrained by distance and geography. Nonetheless, physical location is at least an essential property if not a part of the identity of any real entity. When appropriate, the Local Web of resources identified by location and geography is an essential aspect of Web discovery and communication. • Joshua Lieberman, Geospatial Incubator Group Chair, 2007/10/3, http://www.w3.org/2005/Incubator/geo/
Custom Applications Spatial Databases must integrate with other applications and data. HTML Viewer Java Viewer GIS Desktop Applications (Internet) Wireless Mobile Devices Network Map Renderer Server Side Applications Spatial DB
Outline • Question: What need to be done to allow geographic data to be available on the Web? • Answer: A lot! • The a typical Open Geo-Stack: • PostGIS for persistence: We need some structured way to hold spatial & non-spatial data. • Geoserver for server side map specific function WMS,WFS. • OpenLayers for client side programming to handle user interaction. • A web service (WS) is a software system designed to support interoperable machine-to-machine interaction over a network (W3C). A WS is any service that is available over the Internet, uses a standardized XML messaging system, and isn't tied to any one operating system or programming language.
Web Services • Web services are software services identified by a URI that are described, discovered, and accessed using Web protocols. Web Services consume and produce XML. (smart data and meta-data). Web services provide the potential to increase interoperability, application integration, which make transacting business easier. • WS technology has established a common, vendor-neutral platform for integrating distributed computing applications. • As WS proliferate, they become similar to Web pages in that they are more difficult to discover. Semantic Web technologies will be necessary to solve the Web service discovery problem.
Typical interaction between WS components Web Services Description Language (WSDL) is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint. Universal Description, Discovery and Integration (UDDI) is a platform-independent, XML-based registry for businesses worldwide to list themselves on the Internet.
Web Services and the Semantic Web • The Semantic Web will enable Web Services to interact with other Web services. Advanced Web service applications involving comparison, composition, or orchestration of Web services will require Semantic Web technologies for such interactions to be automated. • Web services are based on a platform-neutral processing model for XML. The step after that is to make both the data and the processing model smarter. In other words, continue along the “smart-data continuum.” In the near term, this will move along five axes: logical assertions, classification, formal class models, rules, and trust.
Web Services Description language • WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint. Related concrete endpoints are combined into abstract endpoints (services). WSDL is extensible to allow description of endpoints and their messages regardless of what message formats or network protocols are used to communicate, however, the only bindings described in this document(http://www.w3.org/TR/wsdl)describe how to use WSDL in conjunction with SOAP 1.1, HTTP GET/POST, and MIME.
Web Services Description language • As communications protocols and message formats are standardized in the web community, it becomes increasingly possible and important to be able to describe the communications in some structured way. WSDL addresses this need by defining an XML grammar for describing network services as collections of communication endpoints capable of exchanging messages. WSDL service definitions provide documentation for distributed systems and serve as a recipe for automating the details involved in applications communication.
Web Services Description language 1.1 • A WSDL document defines services as collections of network endpoints, or ports. In WSDL, the abstract definition of endpoints and messages is separated from their concrete network deployment or data format bindings. This allows the reuse of abstract definitions: messages, which are abstract descriptions of the data being exchanged, and port types which are abstract collections of operations. The concrete protocol and data format specifications for a particular port type constitutes a reusable binding. A port is defined by associating a network address with a reusable binding, and a collection of ports define a service. Hence, a WSDL document uses the following elements in the definition of network services:
Web Services Description language • A WSDL document uses the following elements in the definition of network services: • Types– a container for data type definitions using some type system (such as XSD). • Message– an abstract, typed definition of the data being communicated. • Operation– an abstract description of an action supported by the service. • Port Type–an abstract set of operations supported by one or more endpoints. • Binding– a concrete protocol and data format specification for a particular port type. • Port– a single endpoint defined as a combination of a binding and a network address. • Service– a collection of related endpoints.
Universal Description, Discovery, and Integration (UDDI) • The UDDI project encourages the inter operability and adoption of Web services. UDDI provides a standards-based set of specifications for service description and discovery, as well as a set of Internet-based implementations. UDDI continues to rapidly evolve and to gain industry support. The specification has developed quickly because it is backed with rapid implementation, which proves the concepts and provides a rich experience base for further refinement of the specification.
Universal Description, Discovery, and Integration (UDDI) • UDDI addresses a number of business problems. First, it helps broaden and simplify business-to-business (B2B) interaction. For the manufacturer who needs to create many relationships with different customers, each with its own set of standards and protocols, UDDI supports a highly flexible description of services using virtually any interface. For the flower shop in Australia that wants to get plugged in to every marketplace in the world but does not know how, UDDI provides a way to do this. The specifications allow the efficient and simple discovery of their business and the services they offer by publishing them in the registry.
Universal Description, Discovery, and Integration (UDDI) Technical models, or tModels.
Universal Description, Discovery, and Integration (UDDI) Technical models, or tModels.
Universal Description, Discovery, and Integration (UDDI) • UDDI can: • Make it possible to discover the right service from the millions currently online • Define how to enable transactions once the preferred service is discovered • Allow user-driven choice of service • Describes services programmatically in a single, open, and secure environment • Reach new user and increasing access to current users
Web services for mapping • The principle OGC web services are; • WMS; standardizes the display of map images. WMS can register and overlay maps from multiple remote sources. • WFS-T: standardizes the retrieval and update of features. • WPS: can describe calculations or processes (inputs and outputs, triggers, execution) as a Web Service. The processes can be supplied by a GIS (e.g. GRASS or special API) • WCS: standardizes access to spatially extended coverages, usually encoded in a binary format and offered by a server (typically remotely sensed data).
Web services for mapping • Web services have reached a level of sophistication that facilitates the delivery and use of spatial information. Web services for mapping enable sharing information. • Web services for mapping allow consumers and providers of information to integrate diverse data sets.
Web services for mapping • To access remote data we need specific knowledge about that data source: server address, data layers available, meta-data, required and available data format. • Once the system knows the details, application can request exactly maps and other information • We will GeoServer as our map server. • Another popular open source map server is simply called MapServer (http://mapserver.org/)
Web services for mapping • The course web site list many examples of data sharing. Many of the links show how government departments share data with the public and other departments. Which means data users don't need to store their data locally. In many cases centralizing data storage can lead to cost savings and avoid redundancy. Web services for mapping can facilitate integration, centralization and sharing.
OGC Web Map Service (WMS) • The OpenGIS® Web Map Service Interface Standard (WMS) provides a simple HTTP interface for requesting geo-registered map images from one or more distributed geospatial databases. A WMS request defines the geographic layer(s) and area of interest to be processed. The response to the request is one or more geo-registered map images (returned as JPEG, PNG, etc) that can be displayed in a browser application. The interface also supports the ability to specify whether the returned images should be transparent which allows layers from multiple servers can be combined.
OGS’s features • Feature associated with a location relative to the Earth. The starting point for modeling of geographic information. A feature is an abstraction of a real world phenomenon. A geographic feature is a feature associated with a location relative to the Earth. A digital representation of the real world can be thought of as a set of features. • Geographic features occur at two levels: feature instances and feature types. At the instance level, a geographic feature is represented as a discrete phenomenon that is associated with its geographic and temporal coordinates. These individual feature instances are grouped into classes with common characteristics - feature types.
OGC WFS • The OGS Web Feature Service Interface Standard (WFS) defines an interface for specifying requests for retrieving geographic features across the Web using platform-independent calls. The WFS standard defines interfaces and operations for data access and manipulation on a set of geographic features, including: • Get or Query features based on spatial and non-spatial constraints • Create a new feature instance • Get a description of the properties of features • Delete a feature instance (WFS-T) • Update a feature instance (WFS-T) • Lock a feature instance (WFS-T) • By default, the specified feature encoding for input and output is the Geography Markup Language (GML) which in turn is written in XML.
OGC WFS • Via the WFS interfaces, a web user or service can combine, use and manage features from different sources by invoking the following WFS operations on geographic features and elements: • Create a new feature instance • Delete a feature instance • Update a feature instance • Lock a feature instance • Get or query features based on spatial and non-spatial constraints
OGC WFS Web Services Description Language is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. WFS follows the web services model
OGC WFS Basic sequence of events
Web services for mapping • Data can be shared in a number of ways. A complete copy can be given to the remote user allowing them to use the data for any purpose. Alternatively, a more limited form of access can be granted. For example, users of Google Map do not get the actual spatial data although they are granted a high degree of usage through the Google Map API. OGC WMS (see later) provide to bitmap image rather than the vector map itself, whereas WFS provides vectors.
Web services for mapping • Some spatial data, such as hurricane locations, is constantly changing (streamed). It does not make sense to download such data. It would be better to integrate the weather layer in your map that accesses a web service in realtime. • Web services can make very large data sets available to users, reducing the need for continual data storage upgrades.
Requesting a Map GeoServer can request map data from a remote web server
GeoServer’s architecture MapInfo Interchange Format (MIF) is a map and database exporting file format of MapInfo software product. ArcSDE technology manages spatial data in a relational database management system (RDBMS) and enables it to be accessed by ArcGIS clients. It is the technology that provides the framework to support long transactions, which facilitates the versioned editing environment in multiuser geodatabases. The JTS Topology Suite is an API of 2D spatial predicates and functions.
GeoServer • GeoServer can access and provide data using a web services framework. • The Open Geospatial Consortium (OGC) has developed specifications for web services for mapping. The OGC aim to increase interoperability between applications by creating common interchange languages through common standards. GeoServer implements OGC’s web mapping services.
GeoServer & OGC specifications • Web Map Service (WMS) Share and request vector and raster map data in plain image format • Web Feature Service (WFS) Share and request vector map data and attributes in GML format • Web Feature Service –Transactional (WFS-T ) is a WFS that supports transactions - add, delete, or update features. • Web Coverage Service (WCS) Share image/raster data with original data value • Web Map Context (WMC) Save and load views of a WMS application as XML • Styled Layer Descriptors (SLD) Request particular symbolization and styling from a WMS • Geography Markup Language (GML) XML-based format for spatial and tabular data interchange • Filter: Encoding XML-based format for defining queries on spatial data
GeoServer & OGC specifications • GeoServer 1.6.0 and above supports WFS 1.1 • WFS 1.1 supports on the fly re-projection of data, which means data can be returned in a SRS other than the native one. We can check the WFS version as follows: • http://localhost:8080/geoserver/wfs?request=GetCapabilities&service=WFS&version=1.0.0 • Here is the XML for the reference system • <SRS>EPSG:4326</SRS>
Using Servlets with GeoServer • Geoserver uses Jetty as a servlet container. • Jetty is an open-source embeddable web server and servlet container, written in Java. • http://www.mortbay.org/jetty/ • Jetty can handle Java servlets and JavaServerPages (JSP) technologies and traditional static web pages. • There is a Jetty Servlet tutorial at: • http://www.seas.upenn.edu/~cis550/jetty.html
Using Servlets with GeoServer • Each GeoServer service is provided by a specific Servlet that intercepts the client requests and builds up the response in accordance to the GeoServer configuration. • Geoserver can be deployed as a standard WAR package inside Java Servlet containers.
Managing a Geographic Database From Mobile Devices Through OGC Web Services
The OGS’s Spatial Web Universal Description, Discovery and Integration (UDDI) is a platform-independent, XML-based registry for businesses worldwide to list themselves on the Internet.
Web Feature Service • A WFS must implement the following operations: • GetCapabilities - queries the WFS service to determine available options. • DescribeFeatureType - retrieves the XML schema to allow the WFS client to parse the result sets. • GetFeature - performs the actual query - parameters such as bounding box and any other filters should be passed in, as appropriate, and the WFS service then returns a GML result set containing full geometry and feature attributes.