R/hdrPRJ.R

Defines functions .writeHdrPRJ

# Author: Robert J. Hijmans
# Date :  April 2011
# Version 1.0
# Licence GPL v3


.writeHdrPRJ <- function(x, ESRI=TRUE) {
	if (.requireRgdal()) {

		p4s <- wkt(x)
		if (! inherits(p4s, "try-error")) {
			prjfile <- filename(x)
			extension(prjfile) <- '.prj'
			cat(p4s, file=prjfile)
		} else {
			return(FALSE)
		}
		return(invisible(TRUE))
	} else {
		return(FALSE)
	}
}

	

Try the raster package in your browser

Any scripts or data that you put into this service are public.

raster documentation built on Jan. 5, 2021, 3:01 a.m.