refocusWorld | R Documentation |
worldLL
/worldLLhigh
Data SetsRefocus the worldLL
/worldLLhigh
data sets, e.g., refocus
them so that Eastern Canada appears to the west of Western Europe.
refocusWorld (polys, xlim=NULL, ylim=NULL, clip.AN=TRUE)
polys |
|
xlim |
|
ylim |
|
clip.AN |
|
This function accepts a PolySet containing one or more polygons with X-coordinates that collectively span approximately 360 degrees. The function effectively joins the PolySet into a cylinder and then splits it at an arbitrary longitude according to the user-specified limits. Modifications in the resulting PolySet are restricted to shifting X-coordinates by +/- multiples of 360 degrees, and instead of clipping polygons, the return value simply omits out-of-range polygons.
PolySet, likely a subset of the input PolySet, which
retains the same PID
/SID
values.
The Antarctic polygon is treated as a special case in that it is expanded longitudinally
by duplicating it to the West and East of the base polygon. The expanded Antarctica is
then clipped to the limits of the plot, or not if 'clip.NA=FALSE'
.
Nicholas M. Boers, Staff Software Engineer
Jobber, Edmonton AB
Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Institute of Ocean Sciences (IOS), Sidney BC
Last modified Rd: 2018-10-26
joinPolys
local(envir=.PBSmapEnv,expr={
oldpar = par(no.readonly=TRUE)
#--- load appropriate data
data(worldLL,envir=.PBSmapEnv)
#--- set limits
xlim <- c(-100,25)
ylim <- c(0,90)
#--- refocus and plot the world
polys <- refocusWorld(worldLL, xlim, ylim)
plotMap(polys, xlim, ylim)
par(oldpar)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.