Analysis of mercury concentration in Clark Fork River
The analysis is based on live queries made to the official U.S. Environmental Protection Agency (EPA) web services. It is not generated or simulated. The process follows a standard, two-step geospatial query process.
The process involves two main interactions with public environmental data services:
-
Finding the NHDPlusV2 COMID from Coordinates: Sampling sites are defined by latitude and longitude. The national hydrography dataset (NHDPlusV2) identifies every stream segment with a unique number called a COMID. The first step is to translate each coordinate pair into the correct COMID. This is done by querying the EPA's WATERS "Point Indexing Service," which is designed to find the nearest NHDPlusV2 stream feature to any given geographic point.
-
Querying the StreamCat API with the COMID: With the list of COMIDs for the sites, the next step is to query the EPA's StreamCat API. This service provides access to hundreds of landscape metrics for every stream segment in the country. For each COMID, the total upstream watershed area is requested, which is a standard metric provided by the service.
This entire workflow is automated and ensures that the validation is against the official, authoritative dataset used by environmental agencies and researchers across the country.
The analysis can be reproduced using the Python scripts in this repository. The scripts use pygeohydro and pynhd libraries, which are part of the HyRiver suite of tools designed for accessing hydrology data.
First, you will need to install the necessary libraries:
pip install -r requirements.txt