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

Description Usage Arguments Details Value References See Also Examples

View source: R/MapkmlPSU.R

Description

Subset polygons acording to the matches between a vector and a specified column from a SpatialPolygonsDataFrame.

Usage

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

Arguments

shape

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

psu

the values to be matched.

id

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

path

string indicating the path to the folder containing the shapfile. If the shapefile is in the working directory or if shape argument is a shapefile, path can be ignored.

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

http://oswaldosantos.github.io/capm

See Also

readShapeSpatial

Examples

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

# Take a sample of 10 PSU.
(selected_psu <- SamplePPS(psu.ssu = city[, c("track_id", "hh")], psu = 10))

## Define shape from shapefile.
shp_path <- system.file("extdata", 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 = "35SEE250GC_SIR",
          psu = selected_psu[, "selected.psu"],
          id = "CD_GEOCODI", path = shp_path)

## Define the shape argument as an object x of class SpatialPolygonsDataFrame.
MapkmlPSU(shape = x, psu = selected_psu[, "selected.psu"], id = "CD_GEOCODI")

## End(Not run)

capm documentation built on May 29, 2017, 12:34 p.m.

Search within the capm package
Search all R packages, documentation and source code