[GRASSLIST:4682] Re: robinson projection

Glynn Clements glynn at gclements.plus.com
Thu Oct 28 23:53:10 EDT 2004


Ian MacMillan wrote:

> Hi all again, I have a weird problem.  I am trying to make a world map 
> using the robinson projection.  I have projected in a raster map of the 
> world into this location, and instead of obtaining the nice oval-ish 
> shape we are used to, the new raster is a rectangle with areas at the 
> edges duplicated.  The edges are distorted as they should be, but there 
> is no way to determine where the edges of the original map lay.

This is a known issue, but I'm not sure that it can be fixed within
GRASS.

First, r.proj works by inverse projection, i.e. it projects the
coordinates of each cell in the current region via the inverse
projection to obtain the corresponding lat-long coordinate, then reads
the corresponding cell from the source map.

Second, the equations which describe many of the projections are
periodic (especially in longitude), and the inverse of a periodic
function is multi-valued (e.g. sin(t) = sin(t + 2.n.pi) for all
integral n, so if k = sin(t), arcsin(k) is the set {t+2.n.pi} for all
integral n rather than a single value).

So, if you project a region which is large enough to contain an entire
projected globe, you will end often up with duplicate points. No
clipping is performed, and I'm not sure that GRASS has enough
information about the projection to do so.

One possible solution is to convert the source map to sites using
r.to.sites, project the sites using s.proj, then convert them back to
a raster map using e.g. s.surf.rst.

Sites are projected using forward projections, so the periodic-inverse
issue doesn't arise.

> I 
> figured this is ok if I could project in a vector box of the world 
> (from a latlong location), and just use that as a mask.  Trouble is 
> that when I project in a vector area with bounding coordinates of n=72 
> s=-72 e=180 w=-180 in latlong space, it comes into the Robinson 
> location as a box, not an oval-ish shape.  This doesn't make any sense 
> to me.  Is this a problem with proj.4?  Or is it impossible to 
> delineate lines of longitude in the Robinson projection (measurement 
> units are meters)?

This is a limitation of v.proj.

A line segment is projected by projecting its endpoints; the projected
segment is the (straight) line segment between the projected
endpoints.

This is correct if the transformation is affine, and close enough if
the transformation is almost affine (e.g. if the length of the line
segment is a very small fraction of the earth's circumference), but
way off if the projection is far from affine (i.e. exhibits visible
curvature).

To get a more accurate result, you would have to split each line
segment into many shorter segments. the more segments, the closer the
approximation.

It would be nice if v.proj could do this automatically, but at present
it doesn't.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-user mailing list