View source: R/grib_proj4str.R
grib_proj4str | R Documentation |
grib_proj4str
generates a PROJ4 string for a given gribMessage class
object based on the message's keys and, optionally, user input.
grib_proj4str(gribMessage, userProj4 = NULL)
gribMessage |
|
userProj4 |
An optional argument that can be a named |
grib_proj4str
uses a GRIB message's keys to generate a PROJ4 string on
the fly. A user can even input their own PROJ4 elements using the
userProj4
arugment. Be aware that any user PROJ4 elements that
conflict with already present elements will override the elements extracted
from the GRIB file. Several other packages have functions that can use this
PROJ4 string to appropriately project the values in the GRIB message. Several
common grid types are supported at this time, but likely not all.
This function is influenced by the PROJ4 string method used in the pygrib Python module (see pygrib source).
Returns a character
string of the PROJ4 elements associate
with the gribMessage
.
g <- grib_open(system.file("extdata", "lfpw.grib1", package = "gribr"))
gm <- grib_get_message(g, 1)
grib_proj4str(gm)
# add proj4 parameters, if needed
# overrides proj in this case
grib_proj4str(gm, list(lat_0 = 35, lon_0 = -95, proj = "lcc"))
grib_close(g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.