APpolygonize: AP Polygonize

Description Usage Arguments Details Value See Also

View source: R/APpolygonize.R

Description

This function uses the gdal_polygonize.py GDAL utility. Its implementation was adapted from the solution developed by John Baumgartner and Francisco Rodriguez-Sanchez.

Usage

1
2
3
4
5
6
7
APpolygonize(
  inRaster,
  readToMemory = TRUE,
  outFile = NULL,
  OSGeoPath = "C:/OSGeo4W64",
  connectivity = 4
)

Arguments

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)

Details

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.

Value

SpatialPolygonsDataFrame

See Also


APfun documentation built on Oct. 23, 2020, 8:10 p.m.