geo1007-labinstructions

GEO1007 Lab 3 - Setting up an OGC WMS and WFS server

Goal of this practical assignment is to set up the server-side of the Geoweb services architecture.

You will use the open source product GeoServer to publish geodata via a WMS (map service) and a WFS (data service).

The software needed for this assignment is:

The geodata that is needed:

In the text there are 6 questions. Answer these questions in your report.

❓ Question / Result #1

This is more a ‘meta’ question as a start (which will not give you any points), about the computer you use for this assignment:

This is for us to know if the software works well on different systems.

Download and install PostgreSQL with PostGIS

In GEO1006 (GeoDBMS course) most / all of you have installed PostGIS. You can use that same database, same user and same schema for the GEO1007 practical assignments.

Note: if you did not follow GEO1006, then contact the supervisor present at the Geolab.

If you do not have a PostgreSQL installation anymore, or you want to re-install PostgreSQL with PostGIS, you can follow the instructions for Windows or Mac / Linux.

Download and install GeoServer

Download and install GeoServer by following the guideline how to install GeoServer.

To get a fast introduction to what GeoServer is meant for, read the ‘Overview’ and ‘History’ pages on their web site.

💡 Hint

There are several ways to install GeoServer, but we choose to deploy it on our Apache Tomcat server which supports web archive files (.war). This makes deployment generally quite straightforward.

❓ Question / Result #2

What is the purpose of GeoServer (what is it meant for?), and what are the differences and similarities between GeoServer, a web server (such as Apache Tomcat) and the database server (PostgreSQL with PostGIS)? Also, in your answer include a drawn diagram in which you explain how these components relate to each other.

Setting up a WMS/WFS service - tutorial, with Delft data

Start your web server (Apache Tomcat) if it is not running already, and go to the GeoServer ‘Web Administration Interface’: http://localhost:8080/geoserver

Log in with (default) username admin and password geoserver.

Goal of this part of the assignment is to set-up an OGC WMS and WFS web service. This is done by defining a WMS/WFS layer in GeoServer that, in this case, connects to your PostGIS database. How to do that is explained step-by-step in the GeoServer user manual It offers two tutorials on how to set up a WMS/WFS service, one for geodata stored in ESRI shapefiles and one for PostGIS tables respectively.

⚠️ Important

Skip the shapefile tutorial, only do the ‘Publishing a PostGIS table’ tutorial, but with other data than mentioned in the tutorial, instead use the delft_parcels.zip that is on the git repo of the course.

Now execute the following steps:

💡 Refresher

If you are using pgAdmin4, use the Query Tool to open and run delft_parcels.sql. Make sure you have PostGIS installed as an extension to your database or the commands will not work.

💡 Tip

Confirm your database port (usually 5432) from pgAdmin 4 by right clicking on PostGresQL 16 and selecting properties. If it differs from the standard 5432, take a note, you will need it later.

❓ Question / Result #3

Why is it essential to specify the correct SRS (Spatial Reference System also known as Coordinate Reference System or CRS) for a dataset, that is published as WMS/WFS layer via GeoServer?

Test the ‘parcels’ layer as WMS

The test can be done in GeoServer itself with ‘Layer preview’. It is a useful way to test whether layers have been defined correctly. Note: The ‘Layer preview’ is in fact a ‘client’ within GeoServer (it sends requests to the ‘web services’ part of GeoServer).

Go to the ‘parcels’ layer in ‘Layer preview’, and select (from the ‘Select one’ list): WMS, with PNG or JPEG as output.

The result should be a second browser window (or tab), with:

❓ Question / Result #4

4.1: Copy the GetMap url to your report

4.2: Save the output map, and include it in your report (as image in the text, or as separate file)

4.3: List (in your report, create a table with) the parameters (Key Value Pairs) in the GetMap url after the ‘?’ sign, and give a short explanation for each of these parameters with focus on: What is each parameter used for?

Test the ‘parcels’ layer as WFS

Again in ‘Layer preview’ request the same layer but now as data service, via a WFS request with GML 3.1 output, and secondly also with GeoJSON output.

❓ Question / Result #5

Include in your report:

5.1: Which differences do you see between the WFS request and the WMS request for the same ‘parcels’ layer? Relate these differences to the different purpose of WFS and WMS.

5.2: Compare the GML 3.1 output with the GeoJSON output. Are there - besides the differences in ‘encoding’ (XML versus JSON) - also differences in data model (the way the data content is structured, and maybe details in one encoding that are not in the other encoding)?

How does a WMS GetFeatureInfo request work?

In the ‘Layer Preview’ there is also the option to have a preview in OpenLayers. Choose that option to look at the ‘parcels’ layer.

When you click on a parcel this results in a table row with information about that parcel (below the map).

❓ Question / Result #6

6.1: Use the Web developer tools of your browser (Firefox or other) to discover which web request is used to get that parcel information. What is that web request (copy the url to your report)?

6.2: In that web request: Is a unique identifier of the parcel used to get the parcel information? Or is another mechanism used? If so, what mechanism / method?

Submit

Your report with answers should be in one zip-file containing:

Bundle all source files in one zipfile, and name it as follows: lab3_lastname1_lastname2 (so two names if you work in a team of two).

Submit (together with the files and report for Lab 4) via Brightspace.