Google Earth Engine Tutorial: Load and Export NLCD Land Cover Data
Credit: Youtube Channel “Terra Spatial, Tutorial on accessing and exporting National Land Cover Database data for United States land cover analysis.”
You can see all the tutorials from here: Techgeo Academy.
Google Earth Engine (GEE) offers powerful tools for accessing and analyzing geospatial datasets, including the National Land Cover Database (NLCD). The NLCD provides high-resolution land cover information for the United States, which is valuable for environmental monitoring, urban planning, and ecological research. This tutorial will guide you through loading and exporting NLCD land cover data using GEE.
Step 1: Access the NLCD Dataset
To access the NLCD dataset in GEE, you’ll first need to use the appropriate dataset ID. The latest version of NLCD is typically available under the ID "USGS/NLCD"
. You can load it using the following code:
var nlcd = ee.Image("USGS/NLCD");
This command loads the NLCD dataset as an image object. The dataset includes multiple bands for different land cover classes.
Step 2: Filter and Explore the Dataset
Once the dataset is loaded, you can filter it to select a specific year or land cover class. For example, to get the 2021 NLCD data, use:
var nlcd2021 = nlcd.select(['land_cover']).filterDate('2021-01-01', '2021-12-31');
You can visualize the data by adding it to the map:
Map.addLayer(nlcd2021, {min: 1, max: 10, palette: ['green', 'brown', 'blue', 'red']}, 'NLCD 2021');
Replace the palette with your preferred colors to match specific land cover classes. Use the nlcd.select()
method to explore other bands, such as land cover class names or percentages.
Step 3: Export the NLCD Data
After visualizing, you may want to export the data for further analysis. To export as a GeoTIFF:
Export.image.toDrive({ image: nlcd2021, description: 'NLCD_2021', folder: 'GEE_Exports', fileNamePrefix: 'nlcd_2021', region: geometry, // Define your region of interest scale: 30, crs: 'EPSG:4326', maxPixels: 1e10 });
Customize the geometry
variable to define your area. Adjust the scale
and crs
based on your project requirements. The maxPixels
parameter ensures large regions are exported without errors.
FAQ
What is the resolution of NLCD data in Google Earth Engine?
The NLCD dataset in GEE is available at a 30-meter resolution, making it suitable for detailed land cover analysis.
Can I access historical NLCD data through GEE?
Yes, GEE supports datasets from multiple years. Use the filterDate()
function to select the desired time period.
What land cover classes are included in NLCD?
NLCD includes 16 major land cover classes, such as forest, grassland, water, and urban areas, each mapped to numerical codes.
How do I handle errors when exporting large regions?
Increase the maxPixels
parameter or split the export into smaller regions using geometry.bounds()
for sub-regions.
Can I export NLCD data in formats other than GeoTIFF?
GEE supports exporting to multiple formats, including COG and PNG. Use the Export.image.toDrive()
function with specific file extensions in fileNamePrefix
.