[GRASS-user] latitude map

Hi,

What is the best way of getting a raster map (global coverage,
lat-long coordinates) in which the value of each pixel is its
latitude? I'm thinking of digitizing the upper and lower horizontal
limits of the region, giving them the values of the maximum and
minimum latitude (respectively), and then interpolating them. But
which would be the most appropriate interpolation method? Or is there
a better way of doing this?

Thanks in advance,
Márcia

PS: apologies for cross-posting

A. Marcia BARBOSA wrote:

Hi,

What is the best way of getting a raster map (global coverage,
lat-long coordinates) in which the value of each pixel is its
latitude? I'm thinking of digitizing the upper and lower horizontal
limits of the region, giving them the values of the maximum and
minimum latitude (respectively), and then interpolating them. But
which would be the most appropriate interpolation method? Or is there
a better way of doing this?

Thanks in advance,
Márcia

PS: apologies for cross-posting

I was just tinkering with R and I think this could be 4-5 lines of code
using the sp package. It has 2 classes for GRIDs SpatialPixels and
SpatialGrids. SpatialPixels is a point layer, derived from the centers
of Grid cells and regularly spaced. You can convert the original layer
to SpatialPixels then extrat the long from it's spatial data into it's
table and then convert it back to a GRID for export.

The basic process would seem to be to create a regular point grid of the
center points of each pixel and then get the lat,lon for each of those
points and join that back to the grid cells.
It's possible in Grass, QGIS and others I think, not sure which would be
easiest. Not sure where you were going with interpolation.

Note: Since this is Global coverage, the points will not be regularly
spaced numeric intervals due to projections, datum and the like, however
it should look evenly spaced. I'm sure you could make them evenly spaced
numerically if thats what you wanted.

Alex

A. Marcia BARBOSA wrote:

What is the best way of getting a raster map (global coverage,
lat-long coordinates) in which the value of each pixel is its
latitude?

in a lat/lon location+mapset:

g.region n= s= w= e= res= ... (set the bounds for you new map)

r.mapcalc "lat_map = y()"

I expect this will be available from the QGIS grass toolbox.

Hamish

(I also expect this will bounce from the qgis-users list, so pls fwd)

Thanks a lot you both.

I had actually thought of using r.to.vect to get a point map with all
the pixel centres, then v.to.db to get their coordinates etc., but the
maps are too large and resolution too high. Obviously r.mapcalc was
the solution I was looking for, I just regret not noticing it
before... And I'll never cease to be amazed at how many things
r.mapcalc can do.

Cheers
Márcia