Skip to contents

Save spatial data.frame as shapefile.zip

Usage

shape2zip(shp, file = "shapefile.zip")

Arguments

shp

a spatial data.frame as from shapefile_from_any() or sf::st_read()

file

full path to and name of the .zip file to create

Value

normalized path of the cleaned up file param (path and name of .zip)

Examples

# shp <- shapes_from_fips(fips = name2fips(c('tucson,az', 'tempe, AZ')))
shp <- testshapes_2
if (FALSE) { # \dontrun{
fname <- file.path(tempdir(), "myfile.zip")
fpath <- shape2zip(shp, fname)
file.exists(fpath)
zip::zip_list(fpath)
# read it back in
shp2 <- shapefile_from_any(fpath)
} # }