Merging MODIS Terra Vegetation Continuous Fields Scenes in RData Category: Tree Cover Data Description: Terra MODIS Vegetation Continuous Fields (VCF) is a subpixel measure of percent tree cover derived using the 7 bands of data available from the Moderate-resolution Imaging Spectroradiometer sensor (MODIS) aboard the Terra satellite. The data is available from the Global Land Cover Facility (www.landcover.org). VCF are generated annually (available 2000-2010) and are available in 500 meter and 250 meter resolutions. Here, we use the 250 meter resolution data. Pixel values between 0-100 represent percent tree cover, while 200 and 253 represent water and null values, respectively. Site: www.landcover.org Data Link: ftp://ftp.glcf.umd.edu/glcf/Global_VCF/Collection_5/2010/ Data Use Policy: http://glcf.umd.edu/data/policy.shtml Use with R: While packages have been written to download MODIS data using R, the packages I’ve found have either been deprecated or do not cover the VCF data sets. For that reason, data needs to be manually downloaded to a folder and the code below brings the data into R and merges tiles to create larger scenes. First load packages and set your working directory.
Now, we need to unzip the files in the folders, but only those files for our area of interest (AOI). For this example, our AOI will be Africa. It’s important to know that the folders and TIFF files within the folders follow a naming scheme that starts in the lower left of the MOD44B_V5_TRE.2010.jpg image file with the lowest alphabetical and numerical values and reads left to right. You will need to determine what TIFF files you need, unless you want the entire global dataset. Also, you could determine this ahead of time and only download those folders from the ftp site. I prefer to have all the data in case I need it later. For Africa, we need TIFF images that are in rows “TS”, “RQ”, “PN”, “ML”, “KJ”, “HG”, and fit in these respective ranges of tiles for each row, respectively: 10:13, 10:15, 9:15, 12:16, 10:14, 5:6. This might become clearer in the code below.
So this is what the list of tiles in the image looks like:
The code below will loop through all the folders, and untarball (.gz) all the files of interest using the name.list variable created above.
Now we will merge the TIFF files into a list and then into one TIFF file
Now we merge the files into one.
Last, we can download a shapefile to put around our final TIFF. The TIFF has a WGS84 projection, so we’ll use the same for the boundary.
Now we can plot them both!
|
Spatial Ecology @ MSUClick on "Category" below to search for R code compiled by the Zarnetske Spatial & Community Ecology Lab and students in MSU's Spatial Ecology graduate course (FOR870/FW870) Category
All
Archive
October 2016
|