Description Usage Arguments Details Author(s)
Converts a raster of multibeam data to a single multi-part polygon showing the outline of the data
1 2 | multibeamToPolygon(multibeam = NULL, multibeamType = NA, NAVal = NULL,
polyfile = NULL, polyformat = "ESRI Shapefile")
|
multibeam |
Filepath to multibeam raster file. See gdalDrivers() for a list of readable formats. Default is NULL and function will then prompt for the file location using choose.files(). |
multibeamType |
Raster type - should be 1 for RGB multi-band file, or 2 for floating point single band. Default is NA and function will prompt for it using readline(). |
NAVal |
NA value of the input raster. This is required for floating point raster files. Default is NULL and function will prompt for a value using readline(). |
polyfile |
Filepath and name for output file location. Default is NULL and function will then prompt for it using choose.dir() and readline(). |
polyformat |
File type for output polygon file. Default is ESRI Shapefile. See ogrDrivers() for a list of available formats. |
This function uses the Raster package to read in the raster file. The raster is then reclassified, setting all areas with data to 1. The reclassified raster is then converted to polygons using the gdal_polygonize function, and then dissolved to a single polygon using ogr2ogr. Both of these commands run in the OSGeo4W batch file that is included in the QGIS installation - if you have QGIS installed somewhere other than D:/Programs the function will prompt you for the location of the OSGeo4W.bat file.
James Hutchison
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.