################################################### # NOTE: requires the prior installation of the # maps package from CRAN and online access # to Sourceforge if (!require(spmaps)) { rSpatial <- "http://r-spatial.sourceforge.net/R" install.packages("spmaps", repos=rSpatial) library(spmaps) } ill <- map("county", regions="illinois", plot=FALSE, fill=TRUE) IDs <- sub("^illinois,", "", ill$names) ill_sp <- map2SpatialPolygons(ill, IDs, CRS("+proj=longlat")) plot(ill_sp, axes=TRUE) ################################################### IJ.east <- 4.516666667 IJ.north <- 52.46666667 WGS84 <- CRS("+proj=longlat +datum=WGS84") IJ.WGS84 <- SpatialPoints(cbind(x=IJ.east, y=IJ.north), WGS84) library(rgdal) EPSG <- make_EPSG() EPSG[grep("^# ED50$", EPSG$note), 1:2] ED50 <- CRS(paste("+init=epsg:4230", "+towgs84=-87,-98,-121,0,0,0,0")) res <- spTransform(IJ.WGS84, ED50) coordinates(res) spDistsN1(coordinates(res), coordinates(IJ.WGS84), longlat=TRUE) ################################################### EPSG[grep("Amersfoort", EPSG$note), 1:2] RD_New <- CRS("+init=epsg:28992") res <- CRSargs(RD_New) res showWKT(CRSargs(RD_New), morphToESRI = TRUE) ################################################### # NOTE: please unpack unitB_data.zip in the # working directory before trying to read # the shapefile library(maptools) list.files("shapes") getinfo.shape("shapes/scot_BNG.shp") scot <- readShapePoly("shapes/scot_BNG.shp") ################################################### ogrDrivers() scot1 <- readOGR(dsn="shapes", layer="scot_BNG") proj4string(scot1) ################################################### getGDALDriverNames() list.files("pix") SP27GTIF <- readGDAL("pix/SP27GTIF.TIF") ################################################### image(SP27GTIF, col=grey(1:99/100), axes=TRUE) ################################################### summary(SP27GTIF)