Masthead

Web Services

Web services are the communication that go on behind the scenes without humans being directly involved. In other words, these are computer to computer interactions.

It's interesting to note that the "web" is the interconnected set of web pages that run on the Internet. Since web services do not deal with web pages or "links" they really should be called "Internet Services".

Uses

Web services are used to provide a huge assortment of services on electronic applications including; online banking (including ATMs), online shopping, and others. Within the geospatial world, web services provide geolocating services and access to spatial data for mapping and monitoring.

Examples of data that is available through web services include:

Web Services

The image below shows how a client, typically using JavaScript within a web site, can access a script on a server. This script can then access a database. This is how your online shopping carts work. The script can also access a device and return information on that device. This is how GoogleMaps finds you on your phone.

These systems can become quite complicated. In the example below, there is a device on the right (actually a carbon flux tower from Campbell Scientific) that has a script which takes data from the instrument and saves it to a database. Depending on the device and the application, devices may be sampled multiple times each second to once a week. The script on the server "caches" this information both for backup and easy access. Then, another script on the server provides the data to a JavaScript script on the client.

Web Service Protocols

Web services cannot function without having an agreed upon protocol between the client and the server. There are different types of protocols:

History

During the start of this century, the OGC developed a series of web service protocols to exchange data. These included WFS, WMS, and WCS (see below). Unfortunately, WMS was too slow and WFS was too complicated. WMS has been largely replaced by the new tile protocols while WFS is being replaced by protocols like KML.

Standard GIS protocols

Standard protocols are ones that are defined through a standards organization such as the Open Geospatial Consortium (OGC). Below are the standard web protocols:

These have been replaced by a number of tile protocols that were first ad-hoc and are now becoming standardized:

KML is an interesting case because it was originally a commercial protocol but is now being considered as a standard.

Tile Map Services

Tile Map Services, such as those in GoogleMaps and Map Quest, are key to keeping the performance of GIS mapping solutions at required levels. TMS relies up on spatial data being provided as a series of steps within a pyramid. The steps at the top level are low resolution (ultimately placing the entire world in a 256x256 raster) while the tiles at the bottom steps are very high resolution (up to 1 meter per pixel).

Pyrdamid

A pyramid of tiles (OGC)

Each step in the pyramid is then divided into rows and columns of tiles.

Defniitions for tiles

Tile Step Definitions from the WTMS Specification (OGC)

The original tile web services were extremely simple and you'll see this in the source for your OpenStreetMap tile service. However, things tend to get more complicated when they are run through a committee so the WTMS specification is quire complicated and includes calls to get the capabilities of a web server, metadata, and tiles. Below is an example of a call to get a tile with lines added to make it easier to see each of the parameters. The remainder of the specification is available at OGC.

http://www.maps.bob/maps.cgi?service=WMTS
&request=GetTile
&version=1.0.0
&layer=etopo2
&style=default
&format=image/png
&TileMatrixSet=WholeWorld_CRS_84
&TileMatrix=10m
&TileRow=1
&TileCol=3

JSON

JSON is a simple format and an alternative to XML. At first, I did not realize why folks were using JSON and then I did some performance testing with JavaScript and found out that JavaScript parses JSON files really quickly. Thus, for client-side web applications, JSON is very cool. Otherwise, I would use XML.

With HTML 5 there is now a strong need for a "Tiled Vector" protocol but I do not know of a standard on yet. MapBox is definitely leading the way in this area and CanvasMap now includes the ability to support vector tiles from BlueSpray.

Lots of "Standards"

One challenge with "standards" is that they tend to proliferate until it is really difficult to support all of the standards. GeoServer, with OpenLayers, is the one solution that appears to support everything.

List of standard web service protocols from GeoServer

REST vs. SOAP

You will see the terms REST and SOAP appear in web service documentation. These are two methods for encoding web service calls. REST is actually how the web works (i.e. a URL) and has always dominated the web service world. However, SOAP, which is based on Java, was preferred by the web service standards folks for years and so it appears in much of the documentation and some folks feel that if you're not doing "SOAP", you're not doing web services. This is simply silly.

RESTful Services

RESTful is another name for REST based services.

Biological Data Exchange

I work within biological data exchange, a subset of the natural resource data exchange world. Efforts in this area include:

Security

The natural resource world does not have to worry about security like the commercial and government world does. However, if you need to protect your data exchange, it is relatively easy now to to setup your servers to use 128-bit SSL to encrypt your communications. This encryption has never been broken (that we know of) and is widely supported.

Test Your Knowledge

 

Lab 12 >

© Copyright 2018 HSU - All rights reserved.