writeshape | R Documentation |
writeshape
Write ESRI shapefile out
writeshape
writeshape(shp, file = NULL, crs = raster::crs(shp))
shp |
Spatial file |
file |
file path, without '.shp'. |
crs |
projection |
library(sp)
library(rgeos)
library(rgdal)
sp1 = readWKT("POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))")
raster::crs(sp1) =sp::CRS("+init=epsg:4326")
writeshape(sp1, file=file.path(tempdir(), 'sp1'))
sp2=readOGR(file.path(tempdir(), 'sp1.shp'))
plot(sp2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.