[GRASS-user] Re: GRASS script to export raster

Glynn Clements glynn at gclements.plus.com
Wed Mar 9 16:30:06 EST 2011


Kim Besson wrote:

> WHat I need is to:
> - Export raster values in an ASCII file written from left to right and
> bottom to top and each line only includes Raster value (not X neither Y).
> Is this possible in GRASS with a Python Script?

Use r.out.ascii and tac.

r.out.ascii writes the cell values (without the coordinates), one
output row for each map row, top to bottm. tac reverses the lines of a
text file.

> Also I will need to import raster values written in ASCII file written from
> left to right and bottom to top where each line is a single raster value
> without X and Y.

Use tac and r.in.ascii (you'll also need to provide a header, as
documented in the r.in.ascii manual page).

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


More information about the grass-user mailing list