mapproject(x, y, projection="", parameters=NULL, orientation=NULL)
x
and y
, giving the
coordinates of the points to be projected may also be given.
Missing vprojection
argument.
This argument is optional only in the sense that certain
projections do not require additional parameters.
If a projection does require additional parameters, these
mc(latitude,longitude,rotation)
which describes
where the "North Pole" should be when computing the projection.
This is mainly used for specifying the point of tangency for a planar
projection; you should not use it fox
and y
, containing the projected coordinates.
NA
s project to NA
s.
Points deemed unprojectable (such as north of 80 degrees
latitude in the Mercator projection) are returned as NA
.
Because of the ambiguity of the first two arguments, the other
arguments must be given by name.
Each time mapproject
is called, it leaves on frame 0 the
dataset .Last.projection
, which is a list with components projection
,
parameters
, and orientation
giving the arguments from the
call to mapproject
or as constructed (for orientation
).
Subsequent calls to mapproject
will get missing information
from .Last.projection
.
Since map
uses mapproject
to do its projections, calls to
mapproject
after a call to map
need not supply any arguments
other than the data.
parameters=c(lat,lon,rot)
.
Imagine a transparent gridded sphere around the globe.
First turn the overlay about the North Pole
so that the Prime Meridian (longitude 0)
of the overlay coincides with meridian lon
on the globe.
Then tilt the North Pole of the
overlay along its Prime Meridian to latitude lat
on the globe.
Finally again turn the
overlay about its "North Pole" so
that its Prime Meridian coincides with the previous position
of (the overlay) meridian rot
.
Project the desired map in
the standard form appropriate to the overlay, but presenting
information from the underlying globe.In the descriptions that follow (adapted from the McIlroy reference), each projection is shown as a function call; if it requires parameters, these are shown as arguments to the function. The descriptions are grouped into families.
Equatorial projections centered on the Prime Meridian (longitude 0). Parallels are straight horizontal lines. [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Azimuthal projections centered on the North Pole. Parallels are concentric circles. Meridians are equally spaced radial lines. [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Polar conic projections symmetric about the Prime Meridian. Parallels are segments of concentric circles. Except in the Bonne projection, meridians are equally spaced radial lines orthogonal to the parallels. [object Object],[object Object],[object Object],[object Object],[object Object]
Projections with bilateral symmetry about the Prime Meridian and the equator. [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Doubly periodic conformal projections. [object Object],[object Object],[object Object],[object Object]
Miscellaneous projections. [object Object],[object Object],[object Object]
Retroazimuthal projections. At every point the angle between vertical
and a straight line to "Mecca", latitude lat0
on the prime meridian,
is the true bearing of Mecca.
[object Object],[object Object]
Maps based on the spheroid. Of geodetic quality, these projections do not make sense for tilted orientations. [object Object],[object Object]
M. D. McIlroy, documentation for from Tenth Edition UNIX Manual, Volume 1, Saunders College Publishing, 1990.
M. D. McIlroy, Source code for maps and map projections.
library(maps)
# Bonne equal-area projection with state abbreviations
map("state",proj='bonne', param=45)
data(state)
text(mapproject(state.center), state.abb)
map("state",proj="albers",par=c(30,40))
map("state",par=c(20,50)) # another Albers projection
map("world",proj="gnomonic",orient=c(0,-100,0)) # example of orient
# see map.grid for more examples
Run the code above in your browser using DataLab