Cookbook example data

In order to help you test setting up services with data that we know work before you try using your own data we supply a number of example data sets that can be used to set up different kinds of services.

Image with world file

This is an image file with associated worldfile to locate it in geographic coordinates. This is the type of file that you might have if you only have paper maps which you have to scan to use. It is suitable for setting up a simple WMS without any useful GetFeatureInfo response or the ability to be styled by an SLD. Download from ftp://ftp.bgs.ac.uk/pubload/OneGeology/exampledata/georeferencedimage.zip.

Shapefile

ESRI Shapefile is a very common vector GIS format. The example could be used for a Simple WMS with GetFeatureInfo response and a Simple Feature WFS. It could also serve as the basis of an SLD enabled WMS but it doesn't have the fields that are used in the OneGeology Portal age and lithology tool so wouldn't work with that unless those fields were added. Also, because of the 10 character limit on length of Shapefile field names your server software will need to be able map shorter field names to the longer ones expected by the Portal. The field name length restriction also means that a simple feature WFS can't be made to conform to specific standard Schemas like GeoSciML Lite unless your server software can map the names to the longer standard property names. Download from ftp://ftp.bgs.ac.uk/pubload/OneGeology/exampledata/shapefileunharmonised.zip.

GeoPackage

This is a relatively recent standard format for exchanging vector and raster GIS data in a single file. It can potentially be used for quite complex data structures. The example contains two files that could be used for a Simple WMS with GetFeatureInfo response and a Simple Feature WFS. They can also serve as the basis of an SLD enabled WMS and the GeologicUnitView.gpkg file has the fields that are used for highlighting queries in the OneGeology Portal age and lithology tool. As this format doesn't have the restrictions on field length of Shapefiles the examples are able to use the same names as specified in the GeoSciML-Lite GeologicUnitView and ShearDisplacementView feature types. Field values have been populated with appropriate values from INSPIRE vocabularies so that these examples can be used to produce a simple feature WFS returning standards conformant GeoSciML-Lite features. Download from ftp://ftp.bgs.ac.uk/pubload/OneGeology/exampledata/geopackagegeoscimllite.zip.

GeoTIFF

GeoTIFF is a raster format with geographic registration included. The example has been obtained from the EMODNET Portal for Bathymetry and has RGB bands suitable for display as an image although other GeoTIFF's could have more and not necessarily image bands. This could be used for a WMS but is included primarily to test WCS setup. Download from ftp://ftp.bgs.ac.uk/pubload/OneGeology/exampledata/geotiff.zip.

PostGIS data

This data set can be used as a basis for WMS with GetFeatureInfo, SLD enabled WMS usable in OneGeology Portal, Simple Feature WFS conforming to GeoSciML Lite schema and Complex Feature WFS conforming to GeoSciML schema. A PostGIS database could also store raster data but the example dataset does not. PostGIS is more suitable for production services than Image files or Shapefiles and is more capable for providing data and as a basis for services conforming to standard application schemas.

It is assumed that you have installed the PostGIS software and that you have a spatially enabled database (the default installation will create one called postgis). The following will all be working within this spatially enabled database.

Download the latest version of the database dump file wfscookbook.YYYY-MM-DD.backup from ftp://ftp.bgs.ac.uk/pubload/OneGeology/wfscookbook/. (Each version will have its release date in place of YYYY-MM-DD.)

Create a separate schema for the example data. The schema name is used in the commands below so, if you change it from wfscookbook you will need to change these accordingly

CREATE SCHEMA wfscookbook AUTHORIZATION postgres;

Import the data from the database dump file downloaded above. If you have installed the pgAdmin graphical administration tool you can use the menu option Tools ‣ Restore.... If you are using the command line you can use the command pg_restore --host localhost --port 5432 --username "postgres" --dbname "postgis" --no-password --no-owner --no-privileges --no-tablespaces --schema wfscookbook --verbose wfscookbook.backup (assuming you are using the default 'postgis' named database. You should create a database user with read-only access to these tables for the WFS software to use when accessing them.

CREATE ROLE ows_reader LOGIN PASSWORD 'your_password'
 VALID UNTIL 'infinity';
COMMENT ON ROLE ows_reader
IS 'A role with read only access to data used in web services.';
grant usage on schema wfscookbook to ows_reader;
grant select on table geometry_columns to ows_reader;
grant select on table spatial_ref_sys to ows_reader;
grant select on all tables in schema wfscookbook to ows_reader;

If you have problems with the above steps which are difficult to resolve you may find that setting log_statement=all in postgresql.conf, reloading the server and then monitoring the log file is helpful for debugging them.