[GRASS-user] Re: Creating raster of geographic coordinates

Marcello Gorini gorini at gmail.com
Thu Mar 3 12:13:30 EST 2011

Nepomuk Reinhard wrote:
> Dear all,
> I'm a newbie in grass GIS so I'm sorry, if this question is very simple.
> Has anyone any idea how to create a raster map including only the
> information of the latitude and longitude of each cell? I want to write a
> script to compute the solar elevation angle for a large area and time
> range and it would be easier with this map. Can anyone help me? Thank you
> very much


You can assess the internal variables which r.mapcalc work with by some
specific commands. x() and y() retrieve the coordinate information. 

So, after definining your region of calculation with g.region, you can then

r.mapcalc "long=x()"   
r.mapcalc "lat=y()"

In this way, you will have two rasters, each of which contains one dimension
of your coordinates. Then you can do calculations with them as you like.

Is it what you wanted? Hope it helps.


View this message in context: http://osgeo-org.1803224.n2.nabble.com/Creating-raster-of-geographic-coordinates-tp6080460p6085591.html
Sent from the Grass - Users mailing list archive at Nabble.com.

More information about the grass-user mailing list