d2ir: Convert between Geographic Coordinates and ICES Rectangles

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/d2ir.R

Description

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

Usage

1
2
3
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

Details

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

Value

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

Note

The statistical rectangles are coded as follows:

The latitudinal rows are 30' high, numbered from 01 at the southern boundary of the ICES statistical area (36<c2><b0>00'N, see ICES No. 2 chart) northwards to 99. The northern limit of the statistical recangle system is thus 85<c2><b0>30'N. The longitudinal columns are 1<c2><b0> wide, coded in an alphanumeric system which starts at the western boundary of the ICES statistical area (44<c2><b0>00'W, see ICES No.1 chart) with A0, continuing A1, A2, A3 to 40<c2><b0>W. East of 40<c2><b0>W the system continues B0, B1, B2, ..., B9, C0, C1, C2, ..., M8, using a different letter for each 10<c2><b0> block and covering the entire west-east extent of the ICES statistical area, thus:

A0 44<c2><b0>00'W -- 40<c2><b0>00'W A3
B0 40<c2><b0>00'W -- 30<c2><b0>00'W B9
C0 30<c2><b0>00'W -- 20<c2><b0>00'W C9
D0 20<c2><b0>00'W -- 10<c2><b0>00'W D9
E0 10<c2><b0>00'W -- 0<c2><b0>00' E9
F0 0<c2><b0>00' -- 10<c2><b0>00'E F9
G0 10<c2><b0>00'E -- 20<c2><b0>00'E G9
H0 20<c2><b0>00'E -- 30<c2><b0>00'E H9
J0 30<c2><b0>00'E -- 40<c2><b0>00'E J9
K0 40<c2><b0>00'E -- 50<c2><b0>00'E K9
L0 50<c2><b0>00'E -- 60<c2><b0>00'E L9
M0 60<c2><b0>00'E -- 68<c2><b0>30'E M8

Note that letter ‘I’ is omitted, unless useI=TRUE.

When designating a statistical rectangle, the north coordinate is stated first. Thus, the recangle of which the southwest corner is 54<c2><b0>00'N, 3<c2><b0>00'E is coded 37F3.

Author(s)

Sigurdur Thor Jonsson with contributions from Asta Gudmundsdottir and Arni Magnusson.

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

1
2
3
4
5
6
7
8
9
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!

Example output

Loading required package: maps
Loading required package: mapdata
[1] "37F3"
[1] "29D0" "49E0"
    lat lon
1 54.25 3.5
    lat   lon
1 36.25 -43.5
    lat  lon
1 85.25 67.5
    lat   lon
1 36.25 -43.5
2 85.25  67.5

geo documentation built on May 29, 2017, 5:36 p.m.