projKenya: Map projection for Kenya

View source: R/projKenya.R

projKenyaR Documentation

Map projection for Kenya

Description

Projection specifically chosen for Kenya. Project from lat/lon to northing/easting in kilometers. Uses epsg=21097 with km units. May not work on all systems due to differences in the behavior between different PROJ and GDAL versions.

Usage

projKenya(lon, lat = NULL, inverse = FALSE)

Arguments

lon

either longitude or, if inverse == TRUE, easting in km

lat

either latitude or, if inverse == TRUE, northing in km

inverse

if FALSE, projects from lon/lat to easting/northing. Else from easting/northing to lon/lat

Value

A 2 column matrix of easting/northing coordinates in km if inverse == FALSE. Otherwise, a 2 column matrix of longitude/latitude coordinates.

Author(s)

John Paige

Examples

eastLim = c(-110.6405, 832.4544)
northLim = c(-555.1739, 608.7130)
coordMatrixEN = cbind(eastLim, northLim)
coordMatrixLL = projKenya(coordMatrixEN, inverse=TRUE)

coordMatrixLL
# if the coordMatrixLL isn't the following, projKenya may not support 
# your installation of GDAL and/or PROJ:
#      east north
# [1,] 33.5  -5.0
# [2,] 42.0   5.5

projKenya(coordMatrixLL, inverse=FALSE)
# regardless of your PROJ/GDAL installations, the result of the 
# above line of could should be:
#            lon       lat
# [1,] -110.6405 -555.1739
# [2,]  832.4544  608.7130


martinbryan/SUMMER documentation built on April 10, 2024, 5:03 a.m.