Hi, I think I've solved this. I can compute i,j with:
On 2016-02-04 at 16:48, Ken Mankoff <[email protected]> wrote: > I'd like to do additional processing elsewhere (Python), outside of > grass, based on the index (i,j) of each point in a raster. Is > it possible to loop through the lon,lat or x,y coordinates in grass, > perform a calculation, and then also generate the i,j grid index > values for each point? > eval `g.region -pg` r.out.xyz input=surf output=- fs=, | cut -d"," -f1-2 | while read -r line do x=$(echo $line | cut -f1 -d,) y=$(echo $line | cut -f2 -d,) i=`echo "(($x)-($w))/$ewres"|bc` j=`echo "(($y)-($s))/$nsres"|bc` echo $x $y $i $j done -k. _______________________________________________ grass-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-user
