How to translate coordinates from cylindrical to a Lambert Azimuthal Equal Area Projection
On Tue, Apr 23, 2013 at 11:17 AM, Ivailo <ubuntero.9161 at gmail.com> wrote:
Meanwhile I have found the "World Coordinate Converter" at http://twcc.free.fr where I can convert single coordinate pairs from "GPS (WGS84) (deg)" to "ETRS89/ETRS-LAEA". Yet, I would still appreciate if somebody could provide advice how to do such an operation on a raster object within R (or even on coordinate pairs within a data.frame).
The spTransform function in package:rgdal is the thing for you! Also, read up about epsg codes... Note however that a regular grid in one coordinate system might not be a regular grid in another system - the cells might not even line up. So, for example, the X coordinate of the bottom left cell which is the same as the X coordinate of the top left cell in the original coordinate system might not be the same in the transformed coordinate system - the projected raster ends up as a trapezium rather than a rectangle. To transform a raster from one CRS to another, use projectRaster in the raster package, which does the necessary warping to get a regular grid in the new system. This will involve some interpolation. I think your best strategy with your big raster would be to first crop it so that when projected it will completely cover the extent of your target area. That makes your raster smaller and more manageable. Then project that to your target CRS, and you'll get a trapezium shape. Crop that to your your target area. Hope that helps. Barry