jupytext:
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.16.2
kernelspec:
display_name: Python 3
language: python
name: python3
Non-Floodplain Wetlands

Introduction
The datasets represent the extent and approximate location of Geographically Isolated Wetlands (GIWs), also known as non-floodplain wetlands (NFWs), in the conterminous United States. National Wetlands Inventory (NWI) lacustrine systems and palustrine wetlands were determined to be “isolated” based on their geographic location (i.e., unconnected, based on a distance measure, to specific classes of NHD aquatic systems). GIWs were here considered geographically isolated when they were outside of 10 meters from select NHD lines and polygons or were not adjacent to NWI Riverine or Estuarine wetlands and (where applicable) outside of 10 meters from a coastline (e.g., oceans or Great Lakes).
The datasets have two versions:
- Version 1 (46.37 GB): The original Lane & D'Amico (2016) dataset with the original attributes. We call this dataset NFW.
- Version 2 (90.18 GB): The original Lane & D'Amico (2016) dataset with additional attributes from the 10-m resolution depression dataset. We call this dataset Wetland Depressions.
Reference
- Lane, C. R., & D'Amico, E. (2016). Identification of putative geographically isolated wetlands of the conterminous United States. JAWRA Journal of the American Water Resources Association, 52(3), 705-722. https://doi.org/10.1111/1752-1688.12421
Environment setup
First, create a conda environment with the required packages:
1conda create -n gdal python=3.11
2conda activate gdal
3conda install -c conda-forge mamba
4mamba install -c conda-forge libgdal-arrow-parquet gdal leafmap lonboard
1conda create -n gdal python=3.11
2conda activate gdal
3conda install -c conda-forge mamba
4mamba install -c conda-forge libgdal-arrow-parquet gdal leafmap lonboard
If you are using Google Colab, you can uncomment the following to install the packages and restart the runtime after installation.
1# %pip install leafmap lonboard
1# %pip install leafmap lonboard
Data download
Click on this link to download the data to your computer and unzip it.
Data conversion
The script below was used to convert the data from the original Geodatabase format to Parquet format. The script uses the leafmap Python package.
1gdb = "Geographically_Isolated_Wetlands_of_ConterminousUnitedStates.gdb"
2# leafmap.gdb_to_vector(gdb, ".", gdal_driver="Parquet")
1gdb = "Geographically_Isolated_Wetlands_of_ConterminousUnitedStates.gdb"
2# leafmap.gdb_to_vector(gdb, ".", gdal_driver="Parquet")
The total file size of the Geodatabase files is 4.4 GB. The total file size of the Parquet files is 46.37 GB.
Data access
The script below can be used to access the data using DuckDB. The script uses the duckdb Python package.
1import duckdb
2
3con = duckdb.connect()
4con.install_extension("spatial")
5con.load_extension("spatial")
6
7state = "IA" # Change to the US State of your choice
8url = f"https://data.source.coop/giswqs/giw/wetlands/{state}_IW.parquet"
9# con.sql(f"SELECT * EXCLUDE geometry, ST_GeomFromWKB(geometry) as geometry FROM '{url}'")
1import duckdb
2
3con = duckdb.connect()
4con.install_extension("spatial")
5con.load_extension("spatial")
6
7state = "IA" # Change to the US State of your choice
8url = f"https://data.source.coop/giswqs/giw/wetlands/{state}_IW.parquet"
9# con.sql(f"SELECT * EXCLUDE geometry, ST_GeomFromWKB(geometry) as geometry FROM '{url}'")
Find out the total number non-floodplain wetlands in the selected state:
1con.sql(f"SELECT COUNT(*) FROM '{url}'")
1con.sql(f"SELECT COUNT(*) FROM '{url}'")
Alternatively, you can use the aws cli to access the data directly from the S3 bucket:
1aws s3 ls s3://us-west-2.opendata.source.coop/giswqs/giw/wetlands/
1aws s3 ls s3://us-west-2.opendata.source.coop/giswqs/giw/wetlands/
Data visualization
To visualize the data, you can use the leafmap Python package with the lonboard backend. The script below shows how to visualize the data.
1import leafmap
2
3state = "DC" # Change to the US State of your choice
4url = f"https://data.source.coop/giswqs/giw/wetlands/{state}_IW.parquet"
5gdf = leafmap.read_parquet(
6 url, return_type="gdf", src_crs="EPSG:5070", dst_crs="EPSG:4326"
7)
8leafmap.view_vector(gdf, get_fill_color=[0, 0, 255, 128])
1import leafmap
2
3state = "DC" # Change to the US State of your choice
4url = f"https://data.source.coop/giswqs/giw/wetlands/{state}_IW.parquet"
5gdf = leafmap.read_parquet(
6 url, return_type="gdf", src_crs="EPSG:5070", dst_crs="EPSG:4326"
7)
8leafmap.view_vector(gdf, get_fill_color=[0, 0, 255, 128])
Data analysis
Find out the total number of NFWs in CONUS:
1con.sql(
2 f"""
3SELECT COUNT(*) AS Count
4FROM 's3://us-west-2.opendata.source.coop/giswqs/giw/wetlands/*.parquet'
5"""
6)
1con.sql(
2 f"""
3SELECT COUNT(*) AS Count
4FROM 's3://us-west-2.opendata.source.coop/giswqs/giw/wetlands/*.parquet'
5"""
6)
The total number of NFWs in CONUS is 8,380,620.
+++
Find out the number of NFWs in each state and order them by the number of NFWs:
1giw_count_df = con.sql(
2 f"""
3SELECT inState AS State, COUNT(*) AS Count
4FROM 's3://us-west-2.opendata.source.coop/giswqs/giw/wetlands/*.parquet'
5GROUP BY inState
6ORDER BY COUNT(*) DESC;
7"""
8).df()
9giw_count_df.head()
1giw_count_df = con.sql(
2 f"""
3SELECT inState AS State, COUNT(*) AS Count
4FROM 's3://us-west-2.opendata.source.coop/giswqs/giw/wetlands/*.parquet'
5GROUP BY inState
6ORDER BY COUNT(*) DESC;
7"""
8).df()
9giw_count_df.head()
Create a pie chart showing the number of NFWs in each state:
1leafmap.pie_chart(
2 giw_count_df,
3 "State",
4 "Count",
5 height=700,
6 title="Number of Non-Floodplain Wetlands (NFWs) by State",
7)
1leafmap.pie_chart(
2 giw_count_df,
3 "State",
4 "Count",
5 height=700,
6 title="Number of Non-Floodplain Wetlands (NFWs) by State",
7)

Create a bar chart showing the number of NFWs in each state:
1leafmap.bar_chart(
2 giw_count_df, "State", "Count", title="Number of Non-Floodplain Wetlands (NFWs) by State"
3)
1leafmap.bar_chart(
2 giw_count_df, "State", "Count", title="Number of Non-Floodplain Wetlands (NFWs) by State"
3)

Calculate the total area of NFWs in each state and order them by the area of wetlands:
1sum_df = con.sql(
2 f"""
3SELECT inState AS State, Sum(hectares) AS Hectares
4FROM 's3://us-west-2.opendata.source.coop/giswqs/giw/wetlands/*.parquet'
5GROUP BY inState
6ORDER BY Sum(hectares) DESC;
7"""
8).df()
9sum_df.head()
1sum_df = con.sql(
2 f"""
3SELECT inState AS State, Sum(hectares) AS Hectares
4FROM 's3://us-west-2.opendata.source.coop/giswqs/giw/wetlands/*.parquet'
5GROUP BY inState
6ORDER BY Sum(hectares) DESC;
7"""
8).df()
9sum_df.head()
Create a pie chart showing the total area of NFWs in each state:
1leafmap.pie_chart(
2 sum_df,
3 "State",
4 "Hectares",
5 height=700,
6 title="Percentage Area of Non-Floodplain Wetlands (NFWs) by State",
7)
1leafmap.pie_chart(
2 sum_df,
3 "State",
4 "Hectares",
5 height=700,
6 title="Percentage Area of Non-Floodplain Wetlands (NFWs) by State",
7)

Create a pie chart showing the total area of NFWs in each state:
1leafmap.bar_chart(
2 sum_df, "State", "Hectares", title="Total Area of Non-Floodplain Wetlands (NFWs) by State"
3)
1leafmap.bar_chart(
2 sum_df, "State", "Hectares", title="Total Area of Non-Floodplain Wetlands (NFWs) by State"
3)
1median_df = con.sql(
2 f"""
3SELECT inState AS State, median(hectares)*10000 AS Meters
4FROM 's3://us-west-2.opendata.source.coop/giswqs/giw/wetlands/*.parquet'
5GROUP BY inState
6ORDER BY median(hectares) DESC;
7"""
8).df()
9median_df.head(10)
1median_df = con.sql(
2 f"""
3SELECT inState AS State, median(hectares)*10000 AS Meters
4FROM 's3://us-west-2.opendata.source.coop/giswqs/giw/wetlands/*.parquet'
5GROUP BY inState
6ORDER BY median(hectares) DESC;
7"""
8).df()
9median_df.head(10)
Create a bar chart showing the median area of NFWs in each state:
1leafmap.bar_chart(
2 median_df,
3 "State",
4 "Meters",
5 title="Median Area of Non-Floodplain Wetlands (NFWs) by State",
6)
1leafmap.bar_chart(
2 median_df,
3 "State",
4 "Meters",
5 title="Median Area of Non-Floodplain Wetlands (NFWs) by State",
6)

+++
Calculate the number of NFWs intersecting surface depressions (i.e., wetland depressions) in each state:
1giw_dep_count_stat = con.sql(
2 f"""
3SELECT inState AS State, COUNT(DISTINCT Final_ID) AS Count
4FROM 's3://us-west-2.opendata.source.coop/giswqs/giw/wetlands_v2/*.parquet'
5WHERE area IS NOT NULL
6GROUP BY inState
7ORDER BY COUNT(*) DESC;
8"""
9).df()
10giw_dep_count_stat.head()
1giw_dep_count_stat = con.sql(
2 f"""
3SELECT inState AS State, COUNT(DISTINCT Final_ID) AS Count
4FROM 's3://us-west-2.opendata.source.coop/giswqs/giw/wetlands_v2/*.parquet'
5WHERE area IS NOT NULL
6GROUP BY inState
7ORDER BY COUNT(*) DESC;
8"""
9).df()
10giw_dep_count_stat.head()
Merge the NFW table with the wetland depressions table:
1merged_df = giw_count_df.merge(giw_dep_count_stat, on="State")
2merged_df.columns = ["State", "GIW_Count", "DEP_Count"]
3merged_df["Percent"] = merged_df["DEP_Count"] / merged_df["GIW_Count"] * 100
4merged_df.head()
1merged_df = giw_count_df.merge(giw_dep_count_stat, on="State")
2merged_df.columns = ["State", "GIW_Count", "DEP_Count"]
3merged_df["Percent"] = merged_df["DEP_Count"] / merged_df["GIW_Count"] * 100
4merged_df.head()
Compare the number of NFWs and wetland depressions in each state:
1leafmap.bar_chart(
2 merged_df,
3 "State",
4 ["GIW_Count", "DEP_Count"],
5 title="Number of NFWs and Wetland Depressions by State",
6)
1leafmap.bar_chart(
2 merged_df,
3 "State",
4 ["GIW_Count", "DEP_Count"],
5 title="Number of NFWs and Wetland Depressions by State",
6)

+++
Compute the statistics of the area of NFWs and wetland depressions in each state:
1giw_dep_count_stat = con.sql(
2 f"""
3SELECT inState AS State, COUNT(DISTINCT Final_ID) AS Count,
4SUM(area) / 1e6 AS Total_Area_km2,
5SUM(volume) / 1e9 AS Total_Volume_km3,
6Median(area) AS Median_Area_m2,
7Median(volume) AS Median_Volume_m3
8FROM 's3://us-west-2.opendata.source.coop/giswqs/giw/wetlands_v2/*.parquet'
9WHERE area IS NOT NULL
10GROUP BY inState
11ORDER BY COUNT(*) DESC;
12"""
13).df()
14giw_dep_count_stat.head(10)
1giw_dep_count_stat = con.sql(
2 f"""
3SELECT inState AS State, COUNT(DISTINCT Final_ID) AS Count,
4SUM(area) / 1e6 AS Total_Area_km2,
5SUM(volume) / 1e9 AS Total_Volume_km3,
6Median(area) AS Median_Area_m2,
7Median(volume) AS Median_Volume_m3
8FROM 's3://us-west-2.opendata.source.coop/giswqs/giw/wetlands_v2/*.parquet'
9WHERE area IS NOT NULL
10GROUP BY inState
11ORDER BY COUNT(*) DESC;
12"""
13).df()
14giw_dep_count_stat.head(10)
The median size of wetland depressions in each state:
1leafmap.bar_chart(
2 giw_dep_count_stat[giw_dep_count_stat['State'] != "NV"],
3 "State",
4 "Median_Area_m2",
5 title="The Median Size of Maximum Depression Area by State",
6)
1leafmap.bar_chart(
2 giw_dep_count_stat[giw_dep_count_stat['State'] != "NV"],
3 "State",
4 "Median_Area_m2",
5 title="The Median Size of Maximum Depression Area by State",
6)

+++
The median maximum storage volume of wetland depressions in each state:
1leafmap.bar_chart(
2 giw_dep_count_stat,
3 "State",
4 "Median_Volume_m3",
5 title="The Median Maximum Storage Volume of Wetlands Depressions by State",
6)
1leafmap.bar_chart(
2 giw_dep_count_stat,
3 "State",
4 "Median_Volume_m3",
5 title="The Median Maximum Storage Volume of Wetlands Depressions by State",
6)
