[R-sig-Geo] alter the lon & lat lines and coastline according to the grid coordinates

Roger Bivand Roger.Bivand at nhh.no
Tue Jun 10 18:25:04 CEST 2008


On Tue, 10 Jun 2008, Costas Douvis wrote:

> Hi everyone
>
> My problem might be easy to deal with but I have already spent quite some
> time and effort with no result. Any help will be appreciated
>
> My data come from an RCM that I ran, Regcm3.

In case anyone was unsure (I was), these are regional climate models. 
There seem to be discussion on their lists. To get control of this data 
format, you need to establish its exact representation, in PROJ.4 format. 
>From there you can - treating the grids as having point support, do what 
you want, but the first step is to find the exact PROJ.4 incantation. See 
the spTransform methods in rgdal for details. There is a copy of coarse 
GSHHS coastline data in maptools, see Rgshhs - note that these are in 
geographical coordinates.

My advice would be to try to construct a SpatialPointsDataFrame in LCC, 
but you'll meed to convert the pseudo-centres of the irregular grid cells 
in long-lat to planar coordinates first - perhaps see project in rgdal 
assuming that datum transformation is not an issue. But you'll need the 
correct lcc parameters (lat_0, lon_0, etc.) to get back to a regularly 
spaced planar grid.

Are they using ETRS_LCC?

library(rgdal)
EPSG <- make_EPSG()
EPSG[grep("ETRS-LCC", EPSG$note),]

Can you find out from the RCM documentation?

See gridlines in sp for the grid lines.

Roger

> My domain spans over the
> wider area of Europe. The model grid is Lambert conformal. This means that
> the data values that come from the same line or column of a data matrix do
> not correspond to the exact same latitude or longitude. I have the values
> of latitude and longitude of each grid point in 2 matrices with the same
> dimensions as my data
>
> So what I need to do is to plot those data on a map. I guess that the best
> way to do this is to plot them on a rectangle map, preferably using
> filled.contour (forgetting for a moment that the grid is actually bended),
> and afterwards overlay the latitude and longitude lines and the coastline
> as they really are on that map (i.e. the lat and lon lines should not be
> straight)
>
> Is that possible?
> Or do you have a better suggestion?
>
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list