[GRASS-dev] r.sun and pj_do_proj() calls

Glynn Clements glynn at gclements.plus.com
Thu Jun 10 09:39:21 EDT 2010


Paul Kelly wrote:

> >> http://newtrac.osgeo.org/grass/log/grass-addons/r.sun_horizon/r.sun2/rsunlib.c?rev=25783
> >>
> >> The comments say it came from JRC, but what is that?
> >
> > The JRC seems to be the European Commission Joint Research Centre
> > http://ec.europa.eu/dgs/jrc/index.cfm
> >
> > The link to r.sun documentation you gave earlier is a sub-page of that site.
> 
> There is more history still in the old CVS:
> http://freegis.org/cgi-bin/viewcvs.cgi/grass/src/raster/r.sun/
> 
> I had a look at the code yesterday and the thing I don't really follow is 
> why the reprojection needs to be done in the com_par() function when it 
> has already been done in calculate(). A few lines before the call to 
> pj_do_proj() in com_par(), the cosine is taken of the latitude, which I 
> don't think would make sense if it wasn't already a latitude (but the call 
> to pj_do_proj() suggests it is a northing which needs to be 
> inverse-projected to latitude).

The pj_do_proj() in com_par() is an inverse projection, i.e. it
projects from lat/lon back to the location's coordinate system.

This isn't going to be easy to do with the latin/longin arrays. OTOH,
I suspect that it makes the latin/longin arrays pointless; either they
produce identical results to using PROJ, or you get bogus results.

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


More information about the grass-dev mailing list