[GRASS-user] Re: [Qgis-user] latitude map

Alex Mandel tech_dev at wildintellect.com
Tue Jan 19 16:02:13 EST 2010


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



More information about the grass-user mailing list