recenter-methods

0th

Percentile

Methods for Function recenter in Package `sp'

Methods for function recenter in package sp to shift or re-center geographical coordinates for a Pacific view. All longitudes < 0 are added to 360, to avoid for instance parts of Alaska being represented on the far left and right of a plot because they have values straddling 180 degrees. In general, using a projected coordinate reference system is to be prefered, but this method permits a geographical coordinate reference system to be used. This idea was suggested by Greg Snow, and corresponds to the two world representations in the maps package.

Keywords
methods
Aliases
  • recenter-methods
  • recenter
  • recenter,SpatialRings-method
  • recenter,Srings-method
  • recenter,Sring-method
  • recenter,SpatialLines-method
  • recenter,Slines-method
  • recenter,Sline-method
Examples
crds <- matrix(c(179, -179, -179, 179, 50, 50, 52, 52), ncol=2)
SL <- SpatialLines(list(Slines(list(Sline(crds, CRS("+proj=latlong"))))))
bbox(SL)
SLr <- recenter(SL)
bbox(SLr)
rcrds <- rbind(crds, crds[1,])
SR <- SpatialRings(list(Srings(list(Sring(rcrds, CRS("+proj=latlong"))), ID="r1")))
bbox(SR)
SRr <- recenter(SR)
bbox(SRr)
opar <- par(mfrow=c(1,2))
plot(SR)
plot(SRr)
par(opar)
crds <- matrix(c(-1, 1, 1, -1, 50, 50, 52, 52), ncol=2)
SL <- SpatialLines(list(Slines(list(Sline(crds, CRS("+proj=latlong"))))))
bbox(SL)
SLr <- recenter(SL)
bbox(SLr)
rcrds <- rbind(crds, crds[1,])
SR <- SpatialRings(list(Srings(list(Sring(rcrds, CRS("+proj=latlong"))), ID="r1")))
bbox(SR)
SRr <- recenter(SR)
bbox(SRr)
opar <- par(mfrow=c(1,2))
plot(SR)
plot(SRr)
par(opar)
Documentation reproduced from package sp, version 0.7-10, License: GPL version 2 or later

Community examples

Looks like there are no examples yet.