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@umn.edu
tel: 612.625.2261
fax: 612.625.5212
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@umn.edu
tel: 612.625.2261
fax: 612.625.5212
--
Instituto IGARÉ
http://geocities.yahoo.com.br/institutoigare
e-mail: institutoigare@yahoo.com.br
On Wed, January 5, 2005 22:23, Sandro Klippel said:
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
This should probably be:
for MAP in `ls ~/projects/wrf/shape_files/*.shp`;
do v.in.ogr -o dsn=~/projects/wrf/shape_files/ output=`basename $MAP .shp`
layer=`basename $MAP .shp`; done
as for shapefile, dsn is the directory containing them, not the files themselves.
Moritz
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@umn.edu
tel: 612.625.2261
fax: 612.625.5212
--
Instituto IGARÉ
http://geocities.yahoo.com.br/institutoigare
e-mail: institutoigare@yahoo.com.br
Thanks both of you.
On Jan 6, 2005, at 3:02 AM, Moritz Lennert wrote:
On Wed, January 5, 2005 22:23, Sandro Klippel said:
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
This should probably be:
for MAP in `ls ~/projects/wrf/shape_files/*.shp`;
do v.in.ogr -o dsn=~/projects/wrf/shape_files/ output=`basename $MAP .shp`
layer=`basename $MAP .shp`; done
as for shapefile, dsn is the directory containing them, not the files themselves.
Moritz
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@umn.edu
tel: 612.625.2261
fax: 612.625.5212
--
Instituto IGARÉ
http://geocities.yahoo.com.br/institutoigare
e-mail: institutoigare@yahoo.com.br
Kirk R. Wythers
Dept. of Forest Resources
University of Minnesota
email: kwythers@umn.edu
tel: 612.625.2261
fax: 612.625.5212