Land cover changes are obtained by first merging two raster files in two different years (year1 and year 2) together based on the geographic coordinates, and then count
the number of pixels (or grids) by types of land cover changes, such as corn to soybeans. The process is done in the CropScape server (the default option) or inside the GetDataComp
function.
To obtain land cover chaneg data, the raster objects in two different years must have the same spatial resolutions and identical coordinates to be directly merged together.
The CropScape server does internal checks on this and would report an error if the two rasters cannot be directly merged together due to unequal spatial resolution or different
coordinates. However, the GetCDLComp
function allows users to obtain land cover changes from two raster files that have different resolutions. This is achieved by resample the raster
data using the nearest neighbor resampling technique such that both rasters have the same resolutions (the finer resolution raster is downscaled to lower resolution).
Then, the resampled data are processed automatically to get data on land cover changes (this is done by using the manualrotate
function).
This feature is useful when dealing with the rasters in 2006 and 2007, which are at 56-meter resolution. While the rasters in other years are at 30-meter resolution.
Also note that the resampling process will lead to sampling errors. Whenever the manual calculation of land cover changes is used, a warning message will show up to alert users.
If without warning, the data are directly from the CropScape GetCDLComp service.
In rare cases, the CropScape server fails to generate land cover change data even without the issue of unequal spatial resolution. A common issue is mismatch in data sizes: the raster objects in two years
have different pixel numbers. It is unclear that why this would happen. Nevertheless, when there is data mismatch, the GetCDLComp
function will attempt to calculate for land cover change
manually using the manual_rotate
function. Data associated with the unmatched coordinates are
discarded at the merging process. Again, a warning message will show up to alert users if manual_rotate
function is used. If no coordinates can be matched, the
manual_rotate
function would also fail to get land cover change data. In this case, a warning message will show up to alert users.
The usage of this function is similar to the GetCDLData
function. Please see the help page of the GetCDLData
function
for details. Note that the aoi
cannot be a single point here.