[GRASS-user] Raster file from ascii file and flattening Africa .... :)

Moritz Lennert mlennert at club.worldonline.be
Wed Dec 3 12:05:15 EST 2008


On 03/12/08 10:26, Corrado wrote:
> Dear friends,
> 
> I am a kind of advanced newbie, if that makes sense.
> 
> I have a text file of the form
> 
> coordinate x,coordinate y,cat={real number between 250 and 450}
> 
> where coordinate are expressed in latitude and longitude. The files represents 
> measurements of the size of a skulls on sites all over Africa.
> 
> From it, I would like to build a raster file, 100 km by 100km.  There are 2 
> problems:
> 
> 1) Unfortunately,  in some 100km x 100km squares, there is one of the points 
> whilst in others there are maybe 20. How do I average, so that in each square 
> I only have 1 value representing the average?

r.in.xyz does this for you directly during the import.

Or you have r.resampl.stats, r.statistics, r.average, r.mode, r.median.

>  
> 2) How do we "flatten" Africa so that we may use 100km x 100km squares instead 
> of 1 degree x 1 degree, without committing a geographical crime? What we need 
> is to respect the areas ....

I don't know what you mean by "flatten". IIUC, you are simply speaking 
about using a projection system. You have to create a location in the 
projection of your choice (I'll leave it to others to advise you on the 
best choice for the whole of Africa, but according to your criteria, you 
would need an equal area - see [1,2] for an introduction). Then use 
r.proj to reproject your map from the lat-long location to the projected 
location where you can then resample.

Moritz

[1] http://en.wikipedia.org/wiki/Map_projection#Equal-area
[2] http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html


More information about the grass-user mailing list