Creates *.kml files of a subset of polygons from a polygon shapefile
Subset polygons acording to the matches between a vector and a specified column from a SpatialPolygonsDataFrame.
string with the name of a polygon shapefile or an object of
the values to be matched.
column of the *.dbf file with the values to be matched against.
string indicating the path to the folder containing the shapfile. If the shapefile is in the working directory or if
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.
*.kml files of the subsetted polygons.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# Load data with the polygon identifiers. data(psu.ssu) # Take a sample of 10 PSU with probability # proportional to size with replacement. (selected.psu <- SamplePPS(psu.ssu, 10, write = FALSE)) ## 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. # Uncomment the following line to create kml files: # MapkmlPSU('santos', selected.psu[, 1], 1, shp.path) ## Define the shape argument as an object x of class SpatialPolygonsDataFrame. # MapkmlPSU(x, selected.psu[, 1], 1)
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.