writeshape: Write ESRI shapefile out 'writeshape'

Description Usage Arguments Examples

View source: R/writeShape.R

Description

Write ESRI shapefile out writeshape

Usage

1
writeshape(shp, file = NULL, crs = raster::crs(shp))

Arguments

shp

Spatial file

file

file path, without '.shp'.

crs

projection

Examples

1
2
3
4
5
6
7
8
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)

happynotes/PIHMgisR documentation built on Jan. 25, 2020, 9:51 p.m.