Crop on disk using gdalUtilities::ogr2ogr

GDALcrop(filename, filename2, destinationPath = NULL, studyArea = NULL)

Arguments

filename

character. File name (only) to original spatial file.

filename2

character. File name (only) to use when saving cropped spatial file.

destinationPath

folder path to filename and where filename2 will be saved.

studyArea

a SpatVector, or NULL (default), from which the extent to crop filename to will be extracted. If NULL, no cropping/saving happens and filename is simply loaded.

Value

a cropped SpatVector that corresponds to filename2.