Description Usage Arguments Details Value Examples
View source: R/create_points.R
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.
1 | create_points(template, boundary = NULL, output_file = NULL)
|
template |
A Raster object to be convert into point features.
Alternatively, an XML file generated by |
boundary |
An optional SpatialPolygons object to subset the point
features after they have been generated according to the the grid from
|
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. |
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.
A SpatialPointsDataFrame object or nothing (with a side-effect of writing to a file).
1 2 3 4 | ## Not run:
create_points(raster("C:/Desktop/extent.tif"), "C:/Desktop/shapefiles/all_points.shp")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.