v.in.arc in an easier way

Lars Schylberg larss at lmv.lm.se
Tue Feb 4 12:59:29 EST 1992


There has been a lot talking around the v.in.arc command lately.
Maybe it is not so easy to use, but I thing some problems are due to
the problems in arc/info.  I am no arc/info expert, but learned some
aml to survive.  I wrote this script last spring to make make the
export part in arc/info easier.  It is a Bourne shell script that
creates two aml scripts and runs arc info to do the ungenerate
commands and dumps info content with the two amls.  The script does
ungenerate both on lines and polygon data at the same time.  It up 
to the user to decide then what to import when v.in.arc is used.
The script should be run from the unix prompt.

I called the script "m.export.arc.covers.sh".  I hope some people can be
helped by this script.  Please respond to me if you improve the script.

Lars Schylberg
National Land Survey of Sweden           Dept. of Photogrammetry
R&D Departmant                           Royal Inst. of Technology
S-80112 Gavle, Sweden                    10044 Stockholm, Sweden

larss at lmv.lm.se                          larss at fmi.kth.se

======== cut here ====== m.export.arc.covers.sh ================================
/bin/sh
#
#  m.export.arc.covers.sh
#
#  Export a arc coverages
#  put them in ungenerate files for import to GRASS
#
#  Author: Lars Schylberg (larss at fmi.kth.se), 910626
#          National Land Survey of Sweden
#          Gavle, Sweden
#--------------------------------------------------------------------
# Input arguments:
# $1 : arc_cover
#
case $# in
0) echo 'Usage: '$0' arc_cover'; exit 2;;
1) ;;
*) echo 'Usage: '$0' arc_cover'; exit 2;;
esac
#
# fix file names for INFO
#
name=$1
name_aat=${name}.aat
name_pat=${name}.pat
NAME_AAT=`echo $name_aat | tr a-z A-Z`
NAME_PAT=`echo $name_pat | tr a-z A-Z`
CURRENT_DIR=`pwd`
#
# generate aml file to print aat to file
#
echo '&data ARC INFO
ARC
CALC $COMMA-SWITCH=-1
OUTPUT '${CURRENT_DIR}'/'${name_aat}'.txt
SELECT '${NAME_AAT}'
ITEMS PRINT
DISPLAY PRINT
Q STOP
&end' > aat.aml
#
echo '&data ARC INFO
ARC
CALC $COMMA-SWITCH=-1
OUTPUT '${CURRENT_DIR}'/'${name_pat}'.txt
SELECT '${NAME_PAT}'
ITEMS PRINT
DISPLAY PRINT
Q STOP
&end' > pat.aml
#
#  Do the ungenerate on lines, points and info content
#
arc << EOF2
ungenerate line $name ${CURRENT_DIR}/${name}.lin
ungenerate point $name ${CURRENT_DIR}/${name}.pts
&r aat
&r pat
quit
EOF2
#
echo Done
#
# do some cleaning up
#
/bin/rm aat.aml
/bin/rm pat.aml















More information about the grass-user mailing list