Learn R Programming

SDMTools (version 1.1-221)

grid.info: Grid Information from Geographic (lat lon) Projections

Description

Since spatial grids in geographic projections do not have equal area or perimeters, grid.info extracts perimeter & area related information for latitudinal bands with differing longitudinal widths. Outputs lengths are in m using Vincenty's equation (distance)and areas in m2. Surface areas are calculated summing surface areas of spherical polygons as estimated using l'Huiller's formula.

Usage

grid.info(lats, cellsize, r = 6378137)

Arguments

lats
is a vector of latitudes representing the midpoint of grid cells
cellsize
is a single value (assuming square cells) or a two value vector (rectangular cells) representing the height (latitude) and width (longitude) of the cells
r
is a single value representing the radius of the globe in m. Default is for the WGS84 elipsoid

Value

  • a data.frame listing:
  • latthe latitude representing the midpoint of the cell
  • toplength of the top of the cell (m)
  • bottomlength of the bottom of the cell (m)
  • sidelength of the side of the cell (m)
  • diagnallength of the diagnals of the cell (m)
  • areaarea of the cell (m2)

References

information on l'Huiller's formula http://williams.best.vwh.net/avform.htm for more info) code for estimating area of polygon on sphere was modified from http://forum.worldwindcentral.com/showthread.php?t=20724

Examples

Run this code
#show output for latitudes from -87.5 to 87.5 at 5 degree intervals
grid.info(lats=seq(-87.5,87.5,5), 5)

Run the code above in your browser using DataLab