While shapefiles can contain multiple polygons, ShrinkShape (ssr) can only process a single shape at a time and thus shapefiles with multiple polygon features need to be split into independent shapefiles prior to processing them with ShrinkShape. This function splits a shapefile into multiple shapefiles by unique values in the GRIDCODE attribute.
shpsplitter(SHAPEFILE = "f09uqresids64", CODE = "f09_R64_")
The name of the shapefile without ".shp" that will be subjected to splitting.
This parameter allows all of the output shapefiles to have this same filename start (to help group like files).
The output filenames (shapefiles) will all begin with the string provided by CODE and then the unique GRIDCODE value will be appended to this to keep the lineage of the data clean. Select a CODE that makes sense.
Outputs from this function are shapefiles, one for each unique GRIDCODE attribute in the input SHAPEFILE. The shapefiles are written to the workspace on the computer in preparation for processing with ssr (individually) or sequentially with batchssr.
In furture releases, the attribute for splitting will be made a parameter, but for now it must be GRIDCODE. This tool requires libraries sp and rgdal.
Tarmo K. Remmel
Remmel, T.K. 2016. Classifying boreal wildfires by clustering ShrinkShape spectra of internal unburned vegetation patches. US-IALE 2016 Annual Meeting: Landscape Change, 3-7 April, Asheville, North Carolina, USA.
1 2 3 4 5 6 7 8
## Not run: # The functionality is provided by the library rgdal, and specifically readOGR. # Depending on the number of unique GRIDCODE values in the shapefile, this function # has the potential to produce a large number of output files. shpsplitter(SHAPEFILE="f09uqresids64", CODE="f09_R64_") ## End(Not run)