Access WaPOR data through OGC APIs

Site: OpenCourseWare for GIS
Course: Monitor spatial and temporal trends in agricultural water productivity with WaPOR open data
Book: Access WaPOR data through OGC APIs
Printed by: Guest user
Date: Monday, 16 September 2024, 11:42 PM

1. Introduction

Many geospatial data are accessible through standards and API's from the Open Geospatial Consortium (OGC). OGC is an international non-profit foundation, more than 500 commercial, governmental, nonprofit and research organizations collaborate in a consensus process encouraging development and implementation of open standards for geospatial content and services, sensor web and Internet of Things, GIS data processing and data sharing.

The most important standards are:

Standard Description Data model
WMS Web Map Service Rendered picture of data
WFS Web Feature Service Vector data
WCS Web Coverage Service Raster data


If you would like to know more about OGC APIs, you can watch this video:


We're going to use the OWSLib package to connect to these services and we're going to use the Rasterio package to save WCS layer to a GeoTIFF.

We'll demonstrate this for data from FAO WaPOR.

2. Tutorial

Run online

You can run the tutorial online using this link:

Open In Colab

If you have Python setup you can find the Jupyter Notebook on Github.

Run in a conda environment

Here are the steps if you would like to run the Jupyter Notebook locally in a conda environment on windows.

1. Install Miniconda from here
2. Open Miniconda Prompt from the Windows Start Menu
3. Type:

conda create --name tutorials -c conda-forge rasterio owslib jupyterlab git

This will create a new environment with the name tutorials and will install the necessary libraries that we'll use.

4. Activate the new environment by typing

conda activate tutorials

5. Use the commands to go to the folder where you want to save the tutorials (note that the next step will create a subdirectory workshops there).

6. Go to https://github.com/jvdkwast/workshops

7. Click the Code button


8. Copy the HTTPS link

9. With git we can interact with git repositories such as GitHub. Run the following command:

git clone https://github.com/jvdkwast/workshops.git

This will download all the tutorial materials to the subdirectory workshops.

To run the tutorials go to the workshops subdirectory and run the command

jupyter lab

This will open your browser and you can choose the notebook.

This video shows the procedure for running notebooks in github repositories locally: