Description Usage Arguments Details Value See Also
This function uses the gdal_polygonize.py GDAL utility. Its implementation was adapted from the solution developed by John Baumgartner and Francisco Rodriguez-Sanchez.
1 2 3 4 5 6 7 | APpolygonize(
inRaster,
readToMemory = TRUE,
outFile = NULL,
OSGeoPath = "C:/OSGeo4W64",
connectivity = 4
)
|
inRaster |
a RasterLayer or a path to a raster file |
readToMemory |
logical. Read output polygons into memory as a SpatialPolygonsDataFrame |
outFile |
character. Optional path for saving output as an Esri Shapefile. |
OSGeoPath |
character. Path to the OSGeo4W installation directory |
connectivity |
numeric. Can be either set to 4 (rook's case) or 8 (queen's case) |
This function needs OSGeo4W to be installed. The OSGeo4W installation path, set to 'C:/OSGeo4W64' by default, will then be used to find the gdal_polygonize.bat file.
SpatialPolygonsDataFrame
GDAL: https://gdal.org/
OSGeo4W download page: https://trac.osgeo.org/osgeo4w/
John Baumgartner's blog post on gdal_polygonize: https://johnbaumgartner.wordpress.com/2012/07/26/getting-rasters-into-shape-from-r/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.