MapkmlPSU: Creates *.kml files of a subset of polygons from a polygon...

Description Usage Arguments Details Value References Examples

View source: R/MapkmlPSU.R

Description

Subset the polygons specified in psu and creates *.kml files of theses polygons.

Usage

1
2
MapkmlPSU(shape = NULL, psu = NULL, id = NULL,
  path = "./psu_maps/")

Arguments

shape

string with the path of a polygon shapefile or an object of class sf (see examples).

psu

polygons to subset.

id

column of the *.dbf file with the values to be matched against.

path

class character with the path in which maps will be saved. If the path already exists, it will be overwrited.

Details

If there are *.kml files in the working directory, the new created files will overwrite it in case of name matching.

shape must receive a shapefile with appropriate coordinate reference system, otherwise, MapkmlPSU report an error.

Value

*.kml files of the subsetted polygons.

References

Baquero, O. S., Marconcin, S., Rocha, A., & Garcia, R. D. C. M. (2018). Companion animal demography and population management in Pinhais, Brazil. Preventive Veterinary Medicine.

http://oswaldosantos.github.io/capm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
data("psu_ssu")

# Take a sample of 5 PSU.
(selected_psu <- SamplePPS(psu.ssu = psu_ssu, psu = 5))
 
## Define shape from shapefile.
shp_path <- system.file("extdata/35SEE250GC_SIR.shp", package="capm")
# The code above used a shapefile avaliable in the
# capm package.
# You might want to write a code like:
# shp.path  <- 'path_to_the_folder_with_the_shapefile'
 
# Create *kml files of 10 polygons.
## Not run: 
MapkmlPSU(shape = shp_path,
         psu = selected_psu[, "selected_psu"],
         id = "CD_GEOCODI")

## Define the shape argument as an object x of class sf.
x <- read_sf(shp_path)
MapkmlPSU(shape = x, psu = selected_psu[, "selected_psu"], id = "CD_GEOCODI")

## End(Not run)

capm documentation built on Oct. 30, 2019, 9:52 a.m.