[GRASS-user] Retrieve pixel position

(forgot to cc to the list)

António:

Thanls for the tip. But isn't there any other more "interactive" way
(like r.what?)

I thought you have a points vector map and want to retrieve row,col for each
point. Maybe "d.what.rast -c" is what you are looking for then?

Cheers, Nikos

On Tuesday 03 of August 2010 19:11:27 Nikos Alexandris wrote:

(forgot to cc to the list)

António:
> Thanls for the tip. But isn't there any other more "interactive" way
> (like r.what?)

I thought you have a points vector map and want to retrieve row,col for
each point. Maybe "d.what.rast -c" is what you are looking for then?

In case I did think correctly that you want to script something, I think
"r.stats -x" is the only way to get specific row,cols. I don't know any other
module that will report rows and cols.

So, given that your points of interest are a vector map, then something like
"v.to.rast" + "r.mapcalc ( to create a MASK)" + "r.stats -xg over the MASK",
would give you coordinates and rowcol for _all_ non-NULL pixels in the MASK.

If you loop this (using "for") over your points of interest, will return for
each point the requested values.

Hope this helps, Nikos