Learn R Programming

geo (version 1.4-3)

d2ir: Convert between Geographic Coordinates and ICES Rectangles

Description

This function converts geographic coordinates to ICES North Atlantic statistical rectangles and rectangle codes to rectangle center coordinates.

Usage

d2ir(lat, lon = NULL, useI = FALSE)
ir2d(ir, useI = FALSE)

Arguments

lat
vector of latitudes, or a list containing lat and lon.
lon
vector of longitudes (ignored if lat is a list).
useI
whether to use the letter ‘I’ in statistical rectangle codes.
ir
ICES rectangle code, e.g. 37F3

Value

Vector of strings containing ICES statistical rectangle codes or conversely, center coordinates of rectangles which codes were given as input.

Details

The default useI=FALSE is in accordance with the prescription in ICES CM77/Gen:3, but useI=TRUE has been done on occasion.

References

ICES C.M. 1977/Gen:3.

See Also

d2r and r2d convert between geographic coordinates and Icelandic rectangles (a local coding system using the same rectangle size as the ICES coding system).

Examples

Run this code
d2ir(54.25, 3.5)
d2ir(c(50,60), c(-20,-10))

ir2d(d2ir(54, 3))
## center positions for bottom left and approx top right rects
ir2d("01A0")
ir2d("99M7")
ir2d(c("01A0","99M7"))
## note that ICES CM1977/Gen:3 indicates half-size rects on eastern margin!

Run the code above in your browser using DataLab