A function to calculate vegetation classification area for reporting.
Source:R/main.R
veg_class_area.Rd
veg_class_area
calculates classified areas.
Arguments
- irast
Character file path to input veg density rasters that have been through the veg classification process, i.e. those that are found in `veg_class_cloud_prob\` or `veg_class\`.
- iregions
Character file path to a shapefile (including extension) that defines reporting regions. The shapefile should have an attribute column that defines the overall reporting "region" plus "site", such as "NatPark_site1", "NatPark_site2" etc. The underscore delineates region from site and must be present.
- attribname
Character string of the name of the attribute column that contains the region information.
- areaname
Character vector representing the geographical area that the user is processing. It is good practice to add in the satellite sensor used to create the index images to help keep track of the source. Just do not add any numbers to the names. An example might be "lgcsmp_lsat" or "lgcsmp_sent" for Lalang-garram landsat and Lalang-garram sentinel respectively. It will be used for inclusion to the output csv name.
- ext
Character representation of the file extension of the input rasters. Defaults to ".tif" as this is the preferred file type.
- probabilities
Boolean to indicate whether to calculate cloudy probabilities. Default is TRUE.
Details
This function is designed to calculate the area of each class as
defined by using the veg_class
per reporting area and site.
Reporting areas are defined by input shapefile. Output results to csv.
Note that the attribute column of the input shapefile must contain a region name followed by a site name separated by an underscore.
The function can also compute cloudy probabilities. This is when some mangroves have been masked in one year, the function looks to see what the classification was the previous year. If that year wasn't cloudy in that location then it most probably retains the same classification. This is then reported as a "cloud likely ..." class and this is done per pixel.
If this behavior is not wanted, 'probabilities = FALSE', then any pixel identified as cloudy is simply reported as "cloud" in the area stats.
Author
Bart Huntley, bart.huntley@dbca.wa.gov.au