[GRASS-user] How to get lon/lat at every cell of the map

Dear folk,

I need access to the geographical location (lon/lat) of every cell in a geo-referenced raster file to project some data according to the geographical location (latitude). I was wondering if it would be possible to get a raster file with the individual values of latitude (or longitude) in every cell of the file from an initial raster map.

Thanks in advance

José A.


José A. Ruiz Arias

Departamento de Física

Escuela Politécnica Superior

Edificio A-3, Campus Lagunillas

Universidad de Jaén

23071 Jaén Spain

Tlf. +34 953212474

Email: jararias@ujaen.es


José Antonio Ruiz Arias wrote:

I need access to the geographical location (lon/lat) of every cell in a
geo-referenced raster file to project some data according to the
geographical location (latitude). I was wondering if it would be possible to
get a raster file with the individual values of latitude (or longitude) in
every cell of the file from an initial raster map.

  r.stats -1g + awk + proj + awk + v.in.ascii + v.to.rast

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

José Antonio Ruiz Arias wrote:
> I need access to the geographical location (lon/lat) of every cell
> in a geo-referenced raster file to project some data according to
> the geographical location (latitude). I was wondering if it would be
> possible to get a raster file with the individual values of latitude
> (or longitude) in every cell of the file from an initial raster map.

Glynn Clements wrote:

  r.stats -1g + awk + proj + awk + v.in.ascii + v.to.rast

spearfish example using r.out.xyz and m.proj modules, and UNIX cut,
paste, and tr tools.

(WGS84 LatLon

r.out.xyz roads > file1.txt
r.out.xyz roads | m.proj -od | tr ' ' '|' | tr '\t' '|' > file2.txt
paste -d'|' file1.txt file2.txt | cut -f1-5 -d'|' > file3.txt
v.in.ascii in=file3.txt out=road_pts cat=3

v.to.rast ...

(maybe cut cat off before m.proj so cs2cs doesn't treat it like a z value?)

Hamish