[R] how to image.plot a XY grid file into a lat-lon map

Vladimir Eremeev wl2776 at gmail.com
Thu Apr 5 11:29:52 CEST 2007

If your country or state borders are polygons or polylines, you could convert
them to desired projection using 
the function project from the package rgdal.

Latitude-longitude grid also could be added by generating desired polylines
in lat-lon and converting them to the desired projection using project.

Linda Smith wrote:
> I have a netcdf gridded file with LCC projection. I can easily use
> image.plot to visualize it. However, as the axises are in X,Y, not Lat and
> Lon, I could not add state or country maps onto it (or lat lon
> information).
> I do have a grid2d file that describes the lat and lon for each (X,Y)
> grid,
> but the lat and lon are not regularly spaced, so I could not use
> image.plot.
> Does anyone know how to plot this type of gridded data so that country or
> state borders can be easily added? Thanks a lot!

What do you mean by "grid2d file that describes the lat and lon for each
(X,Y) grid"?
If this are two rasters of the same size having corresponding latitude and
longitude values in each raster cell, then you could use contourLines to get
lat-lon grid. However, you, probably, will want to smooth it.
View this message in context: http://www.nabble.com/how-to-image.plot-a-XY-grid-file-into-a-lat-lon-map-tf3528721.html#a9852612
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list