polytopoints: polygons to points

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/polytopoints.R

Description

From a shape/kml file with polygons, the function creates a new shapefile with the grid of all the points inside the polygons.
It takes into account the spatial resolution of the images. A point is created if the center of the pixel is inside the polygon. Therefore, the new shapefile has no more than one point per pixel. The shapefile is projected with the same projection than the map.

Usage

1
polytopoints(shapefile, shapedir, ndvidirectory, region, Ystart, shapeext = "shp", type = "VITO_CLIP", outname = "buffer", outdir = ".")

Arguments

shapefile

name of the shape/kml file with polygons to be transformed in points.
For a shapefile called ‘name.shp’ , shapefile="name".
For a kml file, write the name of the layer.

shapedir

path to the shape/kml file.
For a shapefile, shapedir is the path to the folder containing the shapefile. For example if the directory of the shapefile is ‘C:/Dir/name.shp’, shapefile="C:/Dir/".
For a kml file, shapedir is the full directory of the kml file. For example shapefile="C:/Dir/name.kml".
Please note that paths to files in R can be specified with either "/" or "\\" in Windows OS and "/" in UNIX OS.

ndvidirectory

path to the ndvi images folder (GeoTIFF files). /cr Please note that paths to files in R can be specified with either "/" or "\\" in Windows OS and with "/" in UNIX OS.

region

name of the region, same as in the name of the ndvi images.

Ystart

starting year of the analysis (in four-digit format).

shapeext

extension of the shape/kml file : "shp" for a Esri shapefile or "kml" for a kml file from Google earth .
By default, shapeext = "shp".

type

type of nomenclature followed by the NDVI images : "VITO_CLIP", "VITO_VGT" or "GIMMS" (see details for more information).
By default, type = "VITO_CLIP".

outname

name of the new shapefile.
By default, outname = "buffer".

outdir

directory where the new shapefile will be saved. By default, outdir = "."(the current directory).

Details

More about the variable type :
type = GIMMS : nomenclature from Global Land Cover Facility
[RE][YY][MMM][DDD].[SAT]-VIg.tif

type = VITO_VGT : FreeVGT VITO's nomenclature
NDV_[YYYYMMDD]_[REGION]_Extract.tif

type = VITO_CLIP : nomenclature after clipping the images in a particular region.
[REGION][YYYY]M[MM]P[D].tif

Value

Nothing is returned but a shapefile is created and saved in the folder outdir under the name outname.

Author(s)

Romain Frelat and Bruno Gerard

See Also

pointtobuffer

Examples

1
#There is no shapefile with polygons for the moment

ndvits documentation built on May 31, 2017, 2:06 a.m.

Related to polytopoints in ndvits...