Presentation is loading. Please wait.

Presentation is loading. Please wait.

Spatial Databases: Web Services DT211-4 DT228-4 Semester 2 2008-9 Pat Browne

Similar presentations


Presentation on theme: "Spatial Databases: Web Services DT211-4 DT228-4 Semester 2 2008-9 Pat Browne"— Presentation transcript:

1 Spatial Databases: Web Services DT211-4 DT228-4 Semester 2 2008-9 Pat Browne http://www.comp.dit.ie/pbrowne/Spatial%20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

2 2.WFS description  The Web Feature Service (WFS) is an interface specified by the Open GIS Consortium (OGC) that allows for the exchange of geographic data across the Web. It defines the rules for requesting and retrieving geographic information using the Hyper Text Transmission Protocol (HTTP). The interface describes the data manipulation operations on geographic features. Extensible Markup Language (XML) -based Geographic Markup Language (GML) is used for exchange of information. WFS supports the vector data model.

3 2.WFS description  A WFS implementation allows a client to retrieve and update features encoded in GML from multiple servers. The WFS operations support INSERT, UPDATE, DELETE, LOCK, QUERY and DISCOVERY operations. A geographic feature is described by a set of properties where each property can be thought of as a {name, type, value} tuple. The name and type of each feature property is determined by its type definition. Geographic features are those that may have at least one property that is geometry- valued

4 2.WFS description  A WFS a transaction is a logical unit of work that is composed of one or more data manipulation operations. Though not directly by WFS, WFS assumes that geographic features are persistently stored and that transaction semantics, such as atomic failure, are assumed to exist. It is the function of a web feature service, in its interaction with the data storage system used to persistently store features, to ensure that changes to data are consistent. (e.g. shapefiles or relational database systems based on SQL).

5 2.WFS description  The WFS specification details all the required XML and GML definitions, of meta data and map data, predicate or filter language will be defined in XML and be derived from CQL(like SQL where) as defined in the OpenGIS Catalogue Interface Implementation Specification. The following diagram shows the basic WFS client server model (WFS follows a general web service model ).

6 2.WFS description In summary, WFS specifies interfaces for describing data manipulation operations on geographic features. Data manipulation includes: 1. Creating a new feature instance 2. Deleting a feature instance 3. Updating a feature instance 4. Locking a feature instance 5. Integrating and querying features based on spatial and nonspatial constraints and predicates.

7 2.WFS operations GetCapabilities: A web feature service must be able to describe its capabilities. Specifically, it must indicate which feature types it can service and what operations are supported on each feature type. DescribeFeatureType: A web feature service must be able, upon request, to describe the structure of any feature type it can service. GetFeature: A web feature service must be able to service a request to retrieve feature instances. In addition, the client should be able to specify which feature properties to fetch and should be able to constrain the query spatially and non-spatially.

8 2.WFS operations GetGmlObject: A web feature service may be able to service a request to retrieve element instances by traversing XLinks that refer to their XML IDs. In addition, the client should be able to specify whether nested XLinks embedded in returned element data should also be retrieved. Transaction: A web feature service may be able to service transaction requests. A transaction request is composed of operations that modify features; that is create, update, and delete operations on geographic features

9 2.WFS Processing Processing requests would proceed as follows: 1. A client application would request a capabilities document from the WFS. 2. A client application (optionally) makes a request to a web feature service for the definition of one or more of the feature or element types that the WFS can service. 3. Based on the definition of the feature type(s), the client application generates a request as specified in this document. 4. The request is posted to a web server. 5. The WFS is invoked to read and service the request. 6. When the WFS has completed processing the request, it will generate a status report and hand it back to the client. In the event that an error has occurred, the status report will indicate that fact.

10 2.WFS Processing

11 2. WFS Advantages  Actual map data returned: Because the actual geographic data and attributes of that data full geographic analysis is possible, not just visual representation using a image file as in WMS.  Standardization - WFS is not owned by any one company, but is instead organized by the OGC (an alliance of many organizations), all with a stake in making the standard successful. This makes comparisons of different software platforms easier, as one unifying standard allows them to compete on their own merit.  Interoperability - Since WFS is an open standard, both open and proprietary software solutions can leverage WFS in order to share data. This means that using WFS does not lock you into one company, one software, or one solution, but can instead be used with multiple server and client technologies.  Web-based - WFS is a web-based protocol, with all of the benefits that this entails. Minimal architecture is required on the client side to access data (web-access and a browser, at the minimum). Data can also be retrieved and visualized from multiple WFS servers. Data can be accessed and even edited by multiple people simultaneously

12 2. WFS Advantages  Non-local - Because WFS is web-based, this eliminates the need to have a local copy of data, and allows data providers to be the custodians of the data.  Only the required data is sent - Data tailored to needs by means of filtering. Data can be filtered by location and/or by data attributes (CQL). This prevents unnecessary transmittal of extraneous data, allowing for a more streamlined workflow.  Editing - WFS allows for transactions, which means that data can be edited as well as retrieved. This two-way communication enables all the benefits of a local solution, without the infrastructure requirements.

13 2. WFS Disadvantages  Security - Unless the user is trusted or the data signed the data can be 'free to air', which may not be required for some application (e.g. police or military). The solution to this problem is to use conventional web security features. A WFS server can employ standard security/authentication methods (passwords, encryption, certificates, and signed objects), preventing unauthorized access, and providing granular access as needed.  Styling and rendering: In WFS the client must take care of styling, but WFS data can be used as a data source to WMS which allows the map to be rendered using SLD.  Performance: In general WFS is slower than WMS.

14 2. WFS Applications  Application to spatial and non-spatial data collection.  For many applications (e.g. census, surveying, environmental monitoring) data collectors can connect to the main data server, retrieve geographic features and their metadata, and then make changes to that data then update the server's information. Then new data can be created and sent to the server as well. This is superior to the traditional process of taking notes in the field and reporting back afterwards, all of this data collection and transmittal can happen in real time, allowing others to immediately benefit from any data collection activity.  WFS in relation to other web components.  The diagram below show how WFS relates to other OGC specification, how an actual WFS relates to its local software environment and the internal map server (e.g. GeoServer view). Focus at least the local software view and the OGC view.

15 2. WFS in relation to other web components

16 2. OpenLayers

17  OpenLayers (OL) is an open source JavaScript library for displaying map data in web browsers. OL provides an API for building complex web-based geographic applications. Data can be combined from a number of sources without requiring any server side processing as layers can be assembled and rendered on the client. Client side programming includes panning and zooming of maps, client-side tiling, markers, popup windows, various adjustable navigation components, keyboard commands, an event handling mechanism and client server communications. Each part of OL is configurable. OL can act as a Web Client for

18 2. OpenLayers  Each part of OL is configurable. OL can act as a Web Client for  1)OGC web services (WFS-T,WMS, and WCS (XML.GML)), and  2)commercial services such as Google Maps(KML), MSN Virtual Earth, ESRI products and  3)open source initiatives or defacto standards such as Geographically Encoded Objects for RSS feeds(GeoRSS). TheOL GeoRSS parser will automatically connect an information bubble to the map markers, similar to Google maps.

19 2. OpenLayers  OL helps integrates a diverse set of heterogeneous data sources (e.g. shape file and database). A variation on OL is Mapbulider built into GeoServer which supports OGC WFS and WMS.  OL facilitates a client-side JavaScript "map -mash-up” style application; A mash-up is a Web application that combines data from one or more sources into a single integrated tool. The term Mashup implies easy, fast integration, frequently done by access to open APIs and data sources to produce results that were not the original reason for producing the raw source data. An example of a mashup is the use of cartographic data from Google Maps to add location information to real estate data, thereby creating a new and distinct Web service that was not originally provided by either source.

20 2.OpenLayers  OL can return projection information. A projection is a way of converting geographic coordinates (latitude and longitude) into a plane (Irish National Grid).  OL supports any projection, but needs PROJ4 for OL for projections on the fly. OL can request form map servers data in a particular projection. Strong support for the Spherical Mercator projection used by Google Map, Open Street Map, and Virtual Earth.  Two ways of getting data.  In one mode OL can request new data without refreshing an entire document, requests can be made to any origin. Another way to retrieve data from a server is to update the location of a document in a frame. These types of requests can also be made to any origin. However, the code running in the original document is restricted to reading data in documents that come from the same origin.

21 2.OpenLayers Core Classes  Core classes  OpenLayers.Map: is the main class of the OpenLayers API. It compiles the application's main map and provides numerous methods for the administration of the map display, including the display of layers and operating components, zooming and panning. In addition, this class allows for queries of current map status through numerous 'get' methods.  OpenLayers.Layer: All map displays are based on the Layer class. Layer.js produces individual layers, sets the transparency and resolution of each, and provides the basic 'get' methods.  OpenLayers.Control: Operating elements in OpenLayers are elements related to map navigation as well the display of map information (e.g. scale). The Control class serves as a base class for all operating elements, among them:

22 2.OpenLayers Core Classes  Ajax avoids the traditional Web client/server/web-page interaction between the customer and the server.  OpenLayers.Events: takes over the event handling from OpenLayers.  OpenLayers.Pixel: displays monitor coordinates in n x- and y- pixel values.  OpenLayers.Size: displays a pixel size value pair in width and height.  OpenLayers.LonLat: displays geographic coordinates in longitude and latitude.  OpenLayers.Bounds: displays a rectangular area (bounding box) whose four sides (left, below, right, above) are indicated with geographic coordinates in float format. The Bounds class provides different get- functions (e.g. center and pixel dimensions of the bounding box) as well as comparative functions (e.g. whether a pixel is located within the defined bounding box).  OpenLayers.Util: contains the different functions and settings which cannot be assigned to any of the otherOpenLayers classes.

23 2.OpenLayers Underlying technology  The basic technology is Asynchronous JavaScript and XML  (AJAX) which includes of JavaScript and XML. XML is the W3C recommended standard for creating formats and sharing data on the Web  OL normally uses XML for data interchange (though JavaScript Object Notation (JSON) can be used as an alternative). Ajax is a way of developing Web applications that combines:  XHTML and CSS standards based presentation  Interaction with the page through the DOM  Data interchange with XML and XSLT  Asynchronous data retrieval with a XMLHttpRequest object which is used to read or send data on the server asynchronously.  JavaScript to tie it all together.

24 AJAX  The Ajax interpreter works within the Web browser (through JavaScript and the DOM) to render the Web application and handle any requests that the user might have of the Web server. Because the Ajax runtime is handling the requests, it can hold much of the information in the Ajax environment, while allowing the interaction with the application and the customer to happen asynchronously and independently of any interaction with the server. This allows the browser to handle a lot of the map processing locally without reference to the server e.g. display, rendering, scaling, querying.  Asynchronous data transfers through the XMLHttpRequest object. This allows websites to be refreshed in the background instead of having to be re-loaded after every modification. Because of this technology, a web mapping application is able to execute a user’s command in a fairly short time period, as the necessary steps can be completed in the background. As a result, the usability of interactive web mapping applications is approaching the features of classic Desktop(GIS) applications. The processing of web page formerly was only server-side, using web services or PHP scripts, before the whole page was sent within the network. But Ajax can selectively modify a part of a page displayed by the browser, and update it without the need to reload the whole document with all images, menus, etc... For example, fields of forms, choices of user, may be processed and the result displayed immediately into the same page.

25 OL Security  Browsers execute JavaScript code in a sandbox, a sealed environment with little or no access to the computer’s resources. In general OL uses AJAX security features. All communication initiated by OpenLayers. Request methods are restricted to the same origin policy: requests may only be issued with the same protocol, to the same domain, and through the same port as the document the code is running from. This is because of the underlying JavaScript security model. JavaScript programs have control over their own page inside the browser, but that is where their abilities end


Download ppt "Spatial Databases: Web Services DT211-4 DT228-4 Semester 2 2008-9 Pat Browne"

Similar presentations


Ads by Google