Skip to content

Latest commit

 

History

History
99 lines (64 loc) · 6.07 KB

README.md

File metadata and controls

99 lines (64 loc) · 6.07 KB

BGS Open API Documentation

To make our data more FAIR, BGS have made a selection of our Open Data available as an API using the OGCAPI-Features standard at https://ogcapi.bgs.ac.uk/. This is targeted at academics, developers, data scientists & geospatial specialists who would like to work with our data programmatically using R/Python etc or would like a live connection to frequently updated datasets in their desktop GIS platform.

We would really appreciate your feedback or suggestions including what other data would benefit from this delivery mechanism.

The API is compatible with both ESRI ArcPro & QGIS allowing you a “live” link to the data – useful for those with frequent updates

OpenAPI specification is available through Swagger UI at - https://ogcapi.bgs.ac.uk/openapi?f=html

Data collections include:

For further documentations see OS which use the same protocol

Queries

Simple Queries

Limited to BBOX, Property Display/Filters & Sort.

Example: To get all Hydrocarbon Wells where water depth = 50 m and include attributes wellid, wellname, completion_date, water_depth_m, tvd_m, td_m

CQL Queries

These allow full complex queries against those collections using a postgres backend.

Some example URL encoded queries:

Users don't have to URL encode the queries - the following will also work if copy & pasted into a browser: https://ogcapi.bgs.ac.uk/collections/recentearthquakes/items?f=json&limit=100&filter=ml BETWEEN 4 AND 4.5 AND depth > 5

Examples

In the notebook folder we have a few example Jupyter Notebooks showing how you can interact with our data.

Follow the instructions below to install and run the demonstration Jupyter Notebook on your own machine. Alternatively, you can view the code and results in your browser. Click here for mobile-friendly version rendered by Jupyter nbviewer.

Prerequisites

  • Python 3
  • A Python 3 package manager e.g. pip3, conda

Installing dependencies

The following packages should be installed via pip3 or conda:

pip3 install -r requirements.txt

For developers

To test that the notebook runs to completion, extra packages are required:

pip3 install -r requirements-dev.txt

Run the test with:

pytest --nbval-lax notebooks\ogcapi-features-cql-owslib-earthquakes.ipynb

Starting the notebook

The demo runs in a Jupyter notebook. Start the notebook with:

jupyter notebook

A browser window will open at http://localhost:8888 with a list of available notebooks.