lonlat2map: Convert Longitude and Latitude to X and Y

Description Usage Arguments Value Author(s) See Also Examples

View source: R/map.R

Description

If a projection is already being used (e.g. as set by mapPlot) then only longitude and latitude should be given, and the other arguments will be inferred by lonlat2map. This is important because otherwise, if a new projection is called for, it will ruin any additions to the existing plot.

Usage

1
2
lonlat2map(longitude, latitude, projection = "",
  debug = getOption("oceDebug"))

Arguments

longitude

a vector containing decimal longitudes, or a list containing items named longitude and latitude, in which case the indicated values are used, and next argument is ignored.

latitude

a vector containing decimal latitude (ignored if longitude is a list, as described above).

projection

optional indication of projection. This must be character string in the format used by the rgdal package; see mapPlot.)

debug

an integer specifying whether debugging information is to be printed during the processing. This is a general parameter that is used by many oce functions. Generally, setting debug=0 turns off the printing, while higher values suggest that more information be printed. If one function calls another, it usually reduces the value of debug first, so that a user can often obtain deeper debugging by specifying higher debug values.

Value

A list containing x and y.

Author(s)

Dan Kelley

See Also

mapLongitudeLatitudeXY is a safer alternative, if a map has already been drawn with mapPlot, because that function cannot alter an existing projection. map2lonlat is an inverse to map2lonlat.

Other functions related to maps: lonlat2utm, map2lonlat, mapArrows, mapAxis, mapContour, mapDirectionField, mapGrid, mapImage, mapLines, mapLocator, mapLongitudeLatitudeXY, mapPlot, mapPoints, mapPolygon, mapScalebar, mapText, mapTissot, oceCRS, shiftLongitude, usrLonLat, utm2lonlat

Examples

1
2
3
4
5
6
7
8
## Not run: 
library(oce)
## Cape Split, in the Minas Basin of the Bay of Fundy
cs <- list(longitude=-64.49657, latitude=45.33462)
xy <- lonlat2map(cs, projection="+proj=merc")
map2lonlat(xy)

## End(Not run)

oce documentation built on Oct. 4, 2018, 5:04 p.m.