tda_map draws spatial objects in a geographical coordinate system
– a projection, rather than the plain x and y of plot(). TDA
builds that system with psetupg and then draws with sdpmap;
graticule adds meridians and parallels with sdpgrat, and
points adds coordinates given directly with sdpgeo.
Usage
tda_map(
s,
view,
region,
projection = 10,
width = 150,
graticule = list(),
points = NULL,
symbol = 1,
newpage = TRUE,
...
)Arguments
- s
a
tda_spatialstructure.- view
centre of the projection, as longitude and latitude.
- region
half-width and half-height of the mapped area, in degrees.
- projection
10 cylindrical equidistant, 11 cylindrical equal-area, 12 Mercator, 20 azimuthal orthographic. For projection 20 the longitude half-width is limited to 90 degrees, and the whole region rectangle must fit on the projection disc, so both halves of
regionneedsin(lon)^2 + sin(lat)^2 <= 1at the view latitude.- width
width of the plot in mm.
- graticule
a list of options for the meridians and parallels, or
NULLfor none.lonandlattake TDA's sequence notation,"-84(2)-76"meaning every 2 degrees from -84 to -76.- points
a data frame of
lonandlatto mark, orNULL.- symbol
marker symbol for
points; TDA'ss=, which cannot be spelled that way here becausesis the structure. 4 is an open circle, 5 a filled one, 8 a square, 15 a diamond.- newpage
start a new grid page.
- ...
further options for
sdpmap.
Details
region is required and has no default: it is the half-width and
half-height of the mapped area in degrees, measured from view. So
view = c(-80, 35), region = c(6, 3) maps 6 degrees of longitude
and 3 of latitude either side of that point.
See also
Other spatial analysis:
plot.tda_spatial(),
tda_polygons(),
tda_read_dbf(),
tda_read_shapefile(),
tda_read_spatial,
tda_sd(),
tda_sd_analyses,
tda_sd_ps3(),
tda_spatial()
Examples
if (requireNamespace("sf", quietly = TRUE)) {
nc <- tda_read_shapefile(system.file("shape/nc.shp", package = "sf"))
tda_map(nc, view = c(-80, 35), region = c(6, 3),
graticule = list(lon = "-84(2)-76", lat = "34(1)37",
fsx = 2, fsy = 2))
}