shapelim: limits of a shape/kml file

Description Usage Arguments Value Author(s) Examples

Description

Returns the limits of the area of a shape/kml file

Usage

1
shapelim(shapefile, shapedir, shapeext = "shp", around = 0.05)

Arguments

shapefile

name of the shape/kml file.
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.

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".

around

extra space added around the area of the shapefile. By default, around=0.05.
Please note that around have to be in the same units and projection as the ndvi maps.

Value

Returns a list with :

xlim

a two dimensions vector with the longitude borders of the shapefile

ylim

a two dimensions vector with the latitude borders of the shapefile

proj

string containing the projection parameters of the shapefile

Author(s)

Romain Frelat and Bruno Gerard

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#with a shape file :
shape="SLP_Mzimba"
shapedir=paste(system.file("extdata/shape", package="ndvits"), "/", sep="")
lim1=shapelim(shape,shapedir)
print(lim1)

#with a kml file
shape="SLP-SAs_CropLand"
shapedir=system.file("extdata/shape/SLP-SAs.kml", package="ndvits")
lim2=shapelim(shape,shapedir,shapeext="kml")
print(lim2)

ndvits documentation built on May 2, 2019, 4:47 p.m.

Related to shapelim in ndvits...