[GRASS-user] Script help

Hamish hamish_nospam at yahoo.com
Thu Nov 8 05:17:57 EST 2007


Richard Chirgwin wrote:

> I have a large number of shapefiles to import, but I'm a scripting newcomer.
>
> Where do I locate the Grass-GIS 6 example scripts to work out how to 
> import them in bulk rather than one-by-one? All I'm looking for is to 
> say: For file <name>.shp create vector <name> through a whole directory.

assuming the location matches the .prj projection info,


for FILE in *.shp ; do
  v.in.ogr dsn="$FILE" out=`basename $FILE .shp`
done


If you are confident that the projection matches but the .prj files are missing
use the -o flag.


Hamish


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the grass-user mailing list