create_points: Create an ESRI shapefile containing point features indexed to...

Description Usage Arguments Details Value Examples

View source: R/create_points.R

Description

This function converts a raster into a shapefile with point features corresponding to each cell. Each point will have an attribute for its cell number.

Usage

1
create_points(template, boundary = NULL, output_file = NULL)

Arguments

template

A Raster object to be convert into point features. Alternatively, an XML file generated by create_raster_metadata().

boundary

An optional SpatialPolygons object to subset the point features after they have been generated according to the the grid from template. It should be in the same projection as template.

output_file

An optional path to a .shp file to which the shapefile will be written. If this argument is not supplied, the features will be returned as a SpatialPointsDataFrame object.

Details

If an output file is specified, this function will write an ESRI shapefile to that file. The cell number will appear as the "no_cell" field in the attribute table.

Value

A SpatialPointsDataFrame object or nothing (with a side-effect of writing to a file).

Examples

1
2
3
4
## Not run: 
create_points(raster("C:/Desktop/extent.tif"), "C:/Desktop/shapefiles/all_points.shp")

## End(Not run)

jnghiem/bfasttools documentation built on Nov. 4, 2019, 3:02 p.m.