[GRASSLIST:5258] Re: scripting v.in.ogr

Sandro Klippel sandroklippel at yahoo.com.br
Wed Jan 5 16:23:33 EST 2005


Dear Kirk 

Im not sure that I understand, but I suggest

for MAP in `ls ~/projects/wrf/shape_files/*.shp`; 
do v.in.ogr -o dsn=$MAP output=`basename $MAP .shp` 
layer=`basename $MAP .shp`; done 

Em Qua 05 Jan 2005 18:11, Kirk R. Wythers escreveu:
> I would like to automate a process where shape files are read into
> GRASS via v.in.ogr. Currently I can issue individual commands like:
>
>   v.in.ogr -o dsn=~/projects/wrf/shape_files/ output=polys_t59_v1
> layer=polys_t59_v1
>
> where polys_t59_v1 is one of 30 or so different shape files that I want
> to keep as individual vectors. What I need is to replace polys_t59_v1
> with a variable that would hold each shape file temporarily while it is
> read into GRASS.
>
> Can anyone get me started with this kind of script. In the past I've
> used:
>
> for MAP in `g.mlist` ; do
>
> to hold map names  that are listed, but this will not work because the
> shape files are not in GRASS yet.
>
> Thanks,
>
> Kirk R. Wythers
> Dept. of Forest Resources
> University of Minnesota
> email: kwythers at umn.edu
> tel: 612.625.2261
> fax: 612.625.5212

-- 

Instituto IGARÉ
http://geocities.yahoo.com.br/institutoigare
e-mail: institutoigare at yahoo.com.br




More information about the grass-user mailing list