Links and Resources

Site: Geoinformatics - University of Salzburg
Course: Spatial Representations and Spatial Data Infrastructures
Book: Links and Resources
Printed by: Guest user
Date: Friday, 18 October 2024, 10:37 AM

1. Intro

As you already know from the overview lecture, geospatial web services for vector data are either provided to the client as map ('image') services, or alternatively as feature services.

The following pages provide insights into the differences between WMS and WFS, therefore go through the exercises carefully and on your own, make sure you follow the suggested steps independently and by using some other data than the ones in the exercises below.

To fully complete the practical exercise, you will need software like ArcGIS Online to load and display features in GeoJSON, CSV, Shapefile, KML or other supported formats.

2. First steps into W*S services

bWe will spend some time exploring various online services in detail, here we get to know an experimentation server provided by Boundless, accessible via >https://demo.boundlessgeo.com/geoserver, running an instance of >GeoServer.

From the above linked demo... page klick on LayerPreview to get a choice of different options. Don't be shy to experiment smile

Then go to 'Countries of the World', drop down the menu at the right and under WMS select eg the JPEG-PNG option. This will produce an image like below - obviously a simple raster image as you can check when you copy it into your preferred image handling software (like IrfanView). GeoServer offers a broad range of output formats for WMS >check them here!

This image was generated by a WMS request to the server, where the underlying data source was rendered and converted into an image (like a screenshot at the server) and set back to the client. When the user zooms in, the entire process has to be repeated for an enlarger subset. Obviously, this approach generates a lot of network traffic when multiple users interactively explore a geographic region.

You can also check out other format options under WMS: some, like TIFF, typically cannot be displayed by your browser and you will instead be offered a download option. Clearly, a WMS always creates a server-side image and provides this to the client, one way or another.

3. Looking further into WMS

To gain some more understanding of WMS, open this demo service >http://openlayers.org/en/latest/examples/wms-no-proj.html

A map of Switzerland and its protected areas is presented, and if you zoom out your will notice it is an unprojected map sheet. Still, you can zoom and pan - and every time you change the extent and / or scale, a new image is created at the server and sent to the client.

When you zoom in until you see large pixels it becomes clear that this map is held as a raster file at the server and cannot provide more detailed resolution than available at the host.

Web Map Services = WMS can be based on vector as well as raster data sets held on the server, both are converted into images, but as this app allows extreme zooming the original raster format becomes visible.

This example also provides the HTML and JS code supplied to 'talk' to the server - inspect and try to understand its basic elements!

4. Changing the display interactively

Here we use a WMS dialog from Leaflet with the same Boundless Geoserver world map we were keeping busy above. In this case our client supports zoom and pan, and every time we change the display extent or position the server sends a new image: 

source: https://leafletjs.com/examples/wms/wms-example1.html

5. Now, looking at features with WFS

A Web Feature Service (WFS) follows an entirely different approach: instead of images, the actual vector features are sent to the client. This might or might not result in a lower data volume, but since the features are cached and rendered at the client (eg, web browser) fewer roundtrips between client and server are required.

Now use the Tasmania samples on the Boundless GeoServer (state boundaries, roads and cities) and scroll down in the drop down selector to the WFS formats. These are a variety of vector formats, for this exercise we will use the GeoJSON option, a popular and open geospatial vector format.

The server response will pop up in a separate window, where you can inspect the structure of the format, its coordinate units etc. As a next step, you can save the GeoJSON text response into a file, and open it eg in ArcGIS Online, where it should show up like below:

6. Going global with WFS

Hopefully, on the previous page you have clicked on the features in Tasmania and noticed that you got an attribute popup: WFS not only deliver coordinates, but also a full set of attributes which can be queried, but also used for rendering (eg colouring).

And, to make it clear that WFS coordinates as eg delivered via GeoJSON are 'global' geographic coordinates - you surely noticed this when looking at the GeoJSON text file - we display these on a globe (a scene in ArcGIS Online speak): use the vignette below to zoom out into a global perspective, and check if you again can get an attribute popup!

For your own exercise with accessing a WFS through the Boundless GeoServer use a different service (not Tasmania) and use another format (not GeoJSON) for import and visualisation in ArcGIS Online or another client software.

7. Final Thoughts

The demo and exercise on the previous pages are designed to make the client-server interaction in geospatial web services transparent, to better understand what usually is happening without the user even noticing, 'behind the scenes'.

In practice, common desktop and web GIS will directly interact with WMS, WFS and other services discussed below. We need to be aware, though, that depending on the type of service used characteristics like performance, flexibility and security will differ.

To look at a more direct interaction with a web service open a New Map in ArcGIS Online, and go to Add | Add Layer from Web, and paste this string

https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/World_Countries_(Generalized)/FeatureServer

This will access a WFS and display a generalized map of world countries on your map. When searching for keywords or browsing the Living Atlas we follow such a link automatically, without even thinking about such a server URL, the type of service or its characteristics. Still, these are important for many uses - and in particular when establishing our own services.