https://github.com/britishgeologicalsurvey/bgs-api-documentation

Documentation and examples for interacting with BGS OGCAPI-X endpoints

https://github.com/britishgeologicalsurvey/bgs-api-documentation

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Documentation and examples for interacting with BGS OGCAPI-X endpoints

Basic Info
Statistics
  • Stars: 1
  • Watchers: 5
  • Forks: 2
  • Open Issues: 1
  • Releases: 0
Created over 3 years ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.md

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 - https://labs.os.uk/public/osngd/os-ngd-api-features/ - https://labs.os.uk/public/osngd/os-ngd-api-features/code-playground/#template-leaflet - https://labs.os.uk/public/osngd/os-ngd-api-features/examples/items.html#filter=bbox,datetime - https://osngd.gitbook.io/osngd/accessing-os-ngd/access-the-os-ngd-api-features - https://osdatahub.os.uk/docs/ofa/overview

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, completiondate, waterdepthm, tvdm, 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:

bash pip3 install -r requirements-dev.txt

Run the test with:

bash 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.

Owner

  • Name: British Geological Survey
  • Login: BritishGeologicalSurvey
  • Kind: organization
  • Email: enquiries@bgs.ac.uk
  • Location: Keyworth, Nottinghamshire

The British Geological Survey is responsible for advising the UK government on geoscience and providing impartial advice to industry, academia and the public.

GitHub Events

Total
  • Push event: 2
Last Year
  • Push event: 2

Dependencies

requirements.txt pypi
  • OWSLib *
  • folium *
  • geopandas *
  • jupyter *
  • matplotlib *
  • notebook *
  • requests *
requirements_dev.txt pypi
  • descartes * development
  • jupyter_client * development
  • nbconvert * development
  • nbval * development
  • pytest * development