[GRASS-user] v.coordinate.sh - improve this script?

Gabriele N. gis.gn at libero.it
Fri Jan 25 07:28:39 EST 2008



hamish_b wrote:
> 
> 
> error on line 92:
> if [$vettoriale2 == '']; then
> 
> you must have spaces next to [] and should quote variables. better:
> (-z means zero length string, -n means non-zero length string)
> 
> if [ -z "$vettoriale2" ] ; then
> 
> Ok.
> 
>> The script is certainly improved. For example viewing points included
>> (as eg in i.points on in d.path) or shifting automatically monitors
>> or using snap for the insertion points etc. ...
> 
> if you use d.where with the middle mouse button you can connect points
> with a line. Or your script can draw them using "d.graph -m". see
> d.mark from the wiki addons page.
> 
> You can do some shell math to convert the coordinates to a snapped
> version. (e.g. 1234567.89 -> 1234000.00 with some awk '%' modulus or
> log transform + round + back transform magic)
> 
> you might like "d.zoom -f" to get panning options, etc.
> 
> Use "d.where -1" for single point.
> 
>> coord_1a=`cat coord_1 |head -n 1 | awk -F " " '{ print $1 " " $2 }'`
> 
> You don't really need `head` there, only data is sent to stdout.
> but it doesn't hurt anything.
> 
> You might use g.tempfile for the temporary files so the script will
> work from any directoy. (e.g. running script while not in home dir)
> 
> 
>> I have no programming experience, and I hope that someone can help me
>> improve.
> 
> that's what we're here for, to train others to become grass devels so
> that they can help others....
> 
>> Necessary installing xdialog and xmessage
> 
> if using GRASS's xmonitors you can replace those with d.menu + d.ask,
> they are neat little under-utilized modules. But they will not be
> ported to GRASS 7.
> 
> 
> 
> have fun,
> 
> Hamish
> 
> 
> 
>      
> ____________________________________________________________________________________
> Never miss a thing.  Make Yahoo your home page. 
> http://www.yahoo.com/r/hs
> 
> _______________________________________________
> grass-user mailing list
> grass-user a lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
> 
> 
	
I am improving the script.
d.mark was exactly what I was looking for. Here's what I did: 

  echo "clicca sul punto della mappa di input"
  d.where > coord_1
  coord_mark_1=`cat coord_1 |head -n 1 | awk -F " " '{ print $1 }'`
  coord_mark_2=`cat coord_1 |head -n 1 | awk -F " " '{ print $2 }'`
  coord_mark=`echo $coord_mark_1,$coord_mark_2`
  d.mark -m at=$coord_mark symbol=triangle color=241:0:0 fcolor=yellow
size=12

Now I have to try and make other improvements.

Thanks

Gabriele
-- 
View this message in context: http://www.nabble.com/v.coordinate.sh---improve-this-script--tp15063748p15086652.html
Sent from the Grass - Users mailing list archive at Nabble.com.



More information about the grass-user mailing list