This dataset is a copy of the National Wetlands Inventory, offering the data in more GIS-friendly and cloud-native geospatial formats. The original dataset is distributed as zipped Geodatabase files, and is available for download from here.
The script below was used to download the data from the National Wetlands Inventory in Geodatabase format from here. The script uses the leafmap Python package.
First, create a conda environment with the required packages:
If you are using Google Colab, you can install the packages as follows:
Then, run the script below:
The script below was used to convert the data from the original Geodatabase format to Parquet format. The script uses the leafmap Python package.
The total file size of the Geodatabase files is 32.5 GB. The total file size of the Parquet files is 75.8 GB.
The script below can be used to access the data using DuckDB. The script uses the duckdb Python package.
Alternatively, you can use the aws cli to access the data directly from the S3 bucket:
To visualize the data, you can use the leafmap Python package with the lonboard backend. The script below shows how to visualize the data.
Alternatively, you can specify a color map to visualize the data.
Display a legend for the data.
Find out the total number of wetlands in the United States by aggregating the 51 parquet files.
Find out the number of wetlands in each state. Note that the NWI datasets do not contain a field for state names. The filename
argument can be used to add an extra filename
column to the result that indicates which row came from which file.
Inspect the list of filenames.
Create a State
column based on the filename
column by extracting the state name from the filename.
Create a wetlands
table from the DataFrame above.
To visualize the data on the map, we need a GeoDataFrame. Let's create a states
table from the us_states.parquet file.
Join the wetlands
table with the states
table.
Export the joined table as a Pandas DataFrame.
Convert the Pandas DataFrame to a GeoDataFrame.
Visualize the data on the map.
Create a pie chart to show the percentage of wetlands in each state.
Create a bar chart to show the number of wetlands in each state.
Calculate the total area of wetlands in the United States. It takes about 3 minutes to run this query. Please be patient.
Calculate the total area of wetlands in each state. It takes about 3 minutes to run this query. Please be patient.
Create a pie chart to show the percentage of wetlands in each state.
Create a bar chart to show the wetland area in each state.