Gets the proj4 string for a file.
The file (an object of class
The name of a variable
Most NetCDF files are stored without any projection information as a lat-long grid. However, some files – particularly those from RCMs – are on a projected grid. This function returns a proj4 string, suitable for use with the 'proj4' library, which can be used to perform forward and inverse projections.
Given a file and a variable, this function returns the proj4 string for the given file should be. If no projection data is found, it returns an empty string. It currently supports Lambert Conformal Conic, Transverse Mercator, Polar Sterographic, and Rotated Pole projections, plus the latitude_longitude pseudo-projection.
A string containing the proj4 string, or NULL if a translator is not available for the given projection.
1 2 3 4 5 6 7
## Get the proj4 string for a hypothetical file. ## Not run: f <- nc_open("pr.nc") proj4.string <- nc.get.proj4.string(f, "pr") nc_close(f) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.