pgirmess (version 1.6.9)

writePRJ: Write the projection file of a shapefile from a spatial object

Description

Write the projection file of a shapefile from a spatial object

Usage

writePRJ(spobj, filename)

Arguments

spobj

any spatial object having a CRS extractible with proj4string

filename

a character string naming the file to print to. If '""' (the default), prints to the standard output connection, the console (unless redirected by 'sink')

Details

A suffix '.prj' is added to the file name if not user provided.

Examples

Run this code
# NOT RUN {
library(sp)
mypoints<-data.frame(long=runif(10,-90,+90),lat=runif(10,-90,+90))
coordinates(mypoints)<-~long+lat # SpatialPoints object
proj4string(mypoints)<-CRS("+proj=longlat +ellps=WGS84 +datum=WGS84") # WGS84 coordinates
writePRJ(mypoints,"")

# }

Run the code above in your browser using DataLab