Learn R Programming

uFTIR (version 0.1.2)

rgdal_polygonize: GDALPolygonize in R

Description

The function calls the C GDALPolygonize routine (using C++). It does overwrite. It uses always 8 point connectedness. It writes on disc a file in "ESRI Shapefile" format.

I wrote a separate package with the function at first. However, I did not want to submit such a small package to CRAN to resolve the 'polygonize' problem. Therefor, I included the source code of that package in uFTIR at a later stage. If you are looking for a package to polygonize a raster file (similar to GDAL polygonize.py) you can use the GDALPolygonize package directly. You can find it in GitHub.

That's also why this function is not exported for you to use it.

Usage

rgdal_polygonize(raster, folder, layer, field, overwrite = TRUE)

Arguments

raster

name/location of raster file to polygonize. Any driver included in GDAL should work.

folder

name/location of the shape file to write. File extension should not be included.

layer

name of the layer (.shp file) to write. Do not include de file extension.

field

name of the field that will keep the raster values.

overwrite

TRUE/FALSE to overwrite an existing file (folder).

Value

integer 0

Examples

Run this code
# NOT RUN {
NULL
# }

Run the code above in your browser using DataLab