Learn R Programming

M3 (version 0.3)

get.proj.info.M3: Obtain information about the projection used in the Models3 file

Description

Obtain information about the projection used by in the Models3-formatted file. Build a string describing the projection which can be used by the R package rgdal.

Usage

get.proj.info.M3(file, earth.radius=6370000)

Arguments

file
File name of Models3-formatted file which contains information about the projection. Currently, this function can only handle files with a Lambert conic conformal, polar stereographic, and longitude/latitude projections.
earth.radius
Radius of the earth (in meters), which is assumed to be spherical by the Models3 I/O API. Default value is 6 370 000 m. Note that the radius in some previous version of the Models3 I/O API was 6 370 997 m, which may be appropriate for some users. For instance, this latter value was used in previous packages supplied by Battelle.

Value

the rgdal package (for projections to and from longitude/latitude, for example).

Warning

Currently, this function can only handle files with Lambert conic conformal, polar stereographic, and longitude/latitude projections.

Details

This function assumes that the file uses the Lambert conic conformal projection, polar stereographic projection, or longitude/latitude. The Models3 I/O API assumes a spherical earth. The default value for earth.radius is 6 370 000 m (sometimes referred to as “sphere 20”), which is the current value used in the Models3 I/O API. Note that the radius in some previous versions of the Models3 I/O API was 6 370 997 m, and this value was also used in previous packages for reading Models3-formatted files, which were developed for EPA by Battelle.

References

See information about the meaning of Models3 I/O API projection arguments at http://www.baronams.com/products/ioapi/GRIDS.html.

See Also

project.lonlat.to.M3, project.M3.to.lonlat, project.M3.1.to.M3.2, get.map.lines.M3.proj

Examples

Run this code
## Find the path to a demo file on lambert conic conformal projection.
lcc.file <- system.file("extdata/ozone_lcc.ncf", package="M3")
## Get string with projection information, using previous value for
## the earth's radius.
get.proj.info.M3(lcc.file, earth.radius=6370997)

## Find the path to a demo file on polar stereographic projection.
polar.file <- system.file("extdata/surfinfo_polar.ncf", package="M3")
## Get string with projection information.
get.proj.info.M3(polar.file)

Run the code above in your browser using DataLab