Skip to main content

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

A tool to aid in the transition from the legacy NWIS discrete data format to the WQX format

This blog describes a mapping file available to users to ease the transition to the WQX version 3.0 format. The spreadsheet provides high-level mapping of data fields in the legacy NWIS format to WQX fields.

Date Posted September 15, 2024 Last Updated September 19, 2024
Author Lee Stanish
Kate Norton
Leslie DeSimone
Reading Time 3 minutes Share

Overview

Recently, the USGS modernized the format of its discrete water quality and sample data from a USGS-specific output format to the internationally recognized Water Quality Exchange (WQX) standard (for more background, read this blog post). Over many years, users have come to rely on USGS data from the NWIS qw webpage in a particular format for ongoing reporting and data analysis. Making the switch to a new format can be challenging, and we want to support users during this transition period. This blog post describes a resource (spreadsheet ) to help users access and use USGS discrete data in their existing workflows as they transition from legacy to modernized services.

The spreadsheet is available in MS Excel file format and maps NWIS data output fields from the legacy qw format to the WQX v3.0 tabular (such as .csv, .txt or .xlsx file formats) field names. This table is intended to be used as a guide to translate existing data processing or analysis workflows: it is not a one-to-one mapping that users could plug into an automated workflow and translate between legacy and current output formats. This is because, while some of the legacy NWIS qw fields directly translate to a single WQX field, many do not map one-to-one, and some of the mappings are somewhat complex.

Here is a simple example: for the WQX field ‘Location_Identifier’, the field is populated by combining two legacy NWIS fields: agency_cd and site_no.

A schematic with two text columns and a triangle in between the columns indicating a flow of information from left to right. Text on the left is for legacy NWIS water quality data fields and text on the right shows the mapping to a WQX field name.

Figure 1. Diagram illustrating a simple scenario of NWIS ‘qw’ field mappings to the WQX v3.0 tabular data format for the WQX field ‘Location_Identifier’.

While this is a fairly straightforward example that could be automated, there are other, more complicated mappings. Take, for example, mapping legacy NWIS qw remark_cd. This field maps to multiple WQX fields including Result_ResultDetectionCondition, Result_MeasureValueType and DetectionLimit_TypeA. These are conditional fields and are populated based on the specific information in remark_cd. For instance, censored data are populated in the Result_ResultDetectionCondition and DetectionLimit_TypeA fields, while non-censored data populate the WQX fields Result_MeasureValueType and Result_StatisticalBase.

A schematic with two text columns and a box containing a logical decision point in between the columns indicating a flow of information from left to right. Text on the left is for legacy NWIS water quality data fields and text on the right shows the mapping to different sets of WQX field names.

Figure 2. Diagram illustrating a complex example of the logic underlying the NWIS field mappings to the WQX v3.0 tabular data downloads.

There are two important things to consider about how the WQX v3.0 fields appear in a data download. Users download the data as a subset of the full WQX v3.0 metadata set called a data profile. There are multiple different profiles that serve a subset of data relevant to a particular use case. The first point is that not all data fields appear in every data profile, and that is by design so as to avoid overwhelming users with 340+ columns! Second, there are differences in a few field names depending on the data profile being downloaded. The diagram below illustrates the differences in field names related to the Detection Limit fields for different profiles.

A flowchart illustrating how a user-selected data profile influences the output format of detection limit data.

Figure 3. Diagram showing differences in WQX v3.0 field names based on the user-selected Data Profile for detection limit metadata.

How users should approach using the mapping spreadsheet

The goal of this mapping file is to simplify the process of transitioning to the new WQX v3.0 format. The file will be maintained for approximately six (6) months after legacy qw format is decommissioned, after which time users’ transitions will be complete and this resource will be retired.

We recognize that this is a significant change in how the data are structured and that users may still have questions even with this reference. We are available to answer questions, so please do not hesitate to reach out.

For general questions about USGS data format and delivery: wdfn@usgs.gov

For questions about the WQX v3.0 translation of the USGS qw format: gs-w_help_nwis@usgs.gov

Share:

Related Posts

  • Accessing discrete water quality and sample data on WDFN

    March 19, 2024

    Introduction We are excited to share with you some updates to how USGS discrete (occurring as separate and distinct events) water quality and field sample (a.

  • How the USGS uses the WQX standard

    December 27, 2023

    Overview The Water Quality Exchange (WQX) standard is an internationally recognized data standard that makes it easier to share and use water quality data The USGS is expanding its current use of the WQX standard from a relatively coarse mapping for data delivered on the Water Quality Portal (WQP) to a comprehensive mapping of USGS sample data on both the WQP and the modernized USGS data portal, Water Data For the Nation (WDFN) Overall, USGS metadata will be more visible to users and it will be human-readable What is WQX?

  • Improved Public Delivery of Water Quality and Field Samples Data

    August 24, 2023

    What are sample data? Sample data are derived from manual field collection and laboratory analyses, including for water quality, sediment, biological, air and soil samples (waterdata.

  • WQX3.0 Data Now Available on the Water Quality Portal

    May 20, 2024

    The Water Quality Portal (WQP) is the largest publicly available water quality data warehouse in the United States. It integrates publicly available data from many providers and outputs those data in a common format, known as the Water Quality Exchange (WQX) standard.

  • Advanced Check Status Users

    May 19, 2024

    Here at WDFN, we employ user-centered design to build better products and reduce risk. This blog is one of a five-part series on users of WDFN: Are You a USGS Water Data User?