v.report bugs?

Ronald Thomas ront at niwot.CFNR.ColoState.EDU
Wed Nov 24 09:06:26 EST 1993


Below is a copy of v.report code fixes as posted to the list's
last March:  one more reason for checking out the archive's before
asking questions that have been asked, answered, and for most, resolved.

About the categories error problem; 'v.report' expects to find a 
sequential category file, ir., starting at 0 and ending at your highest
category, with NO empty spaces allowed.  I wrote a script file (included
below) that "fills in" the empty spaces.  This is a temporary and poor fix,
but Ido not know how to fix the problem within the code.

Hope these things help.

Ronald Thomas                                ront at meeker.cfnr.colostate.edu
 Natural Resource Spec. (GIS)         ^^^    Phone: 303-586-3565  x285
  Resources Management Division  ^^  ^^^^^   FAX: 303-586-4702
   Rocky Mountain National Park ^^^ ^^^^^^^  Estes Park, CO  80517

   *****************included letter ******************
Date: Mon, 1 Mar 93 13:11:03 MST
From: nps!susan at cerl.cecer.army.mil (Susan Stitt)

Below are the code fixes for v.report. I compared the original source code as 
we had it, and the current code as it now works.  Hopefully I have caught 
everything.  Please let me know, if you are successful. Thanks!


Susan Stitt
Geographic Information Systems Division
National Park Service 
PO Box 25287
Denver CO 80225-0287
(303)969-2590
susan%nps at cerl.cecer.army.mil



v.report/cmd/do_v_stats.c
	old line 239
		fprintf(dumpfile,"area\n");

	new line 239
		fprintf(dumpfile,"area%d\n",cnt);


v.report/cmd/perimeter.c
	old line 17
		if(i==((np-1)-1))
	new line 17
		if(i==(np-1))


v.report/cmd/prt_report.c
	old line 64
		unit[i].factor    =1.0e+3;
	new line 64
		unit[i].factor    =1.0e-3;


v.report/cmd/stats.c
	old line 39
		sscanf(buf,"%s,%d",atype, &nalloc);
	new line 39
		sscanf(buf,"%s%d",atype, &nalloc);

and

	old line 48
		Gstats = (GSTATS *) G_calloc (nalloc, sizeof(GSTATS));
	new line 48
		Gstats=(GSTATS *) G_malloc ((int)(nalloc * sizeof(GSTATS)));


v.report/cmd/Gmakefile
   old line 23
       $(CC) $(LDFLAGS) -o $@ $(LIST) $(VECTLIB) $(GISLAB) $(LIBES) $(MATHLIB)
   new line 23
       $(CC) $(LDFLAGS) -o $@ $(LIST) $(LIBES) $(VECTLIB) $(GISLIB) $(MATHLIB)


v.report/inter/Gmakefile
   old line 7
       $(CC) $(LDFLAGS) -o $@ $(LIST) $(VECTLIB) $(GISLIB) $(VASK) $(LIBES)
   new line 7
       $(CC) $(LDFLAGS) -o $@ $(LIST) $(GISLIB) $(VASK)



***************** included script *********************


#! /bin/sh
# USAGE:  "boost cell_file"
#Developed & written by Ron Thomas
#National Park Service
if [ -z "$GISRC" ]
then
echo "You must be using GRASS to be using this program!!"
echo 
echo "                 exiting"
exit 1
fi
cd $LOCATION/cats
cat $1 >> $1.orig
head -4 $1  >> tempfile
last=`tail -1 $1 | awk -F':' '{print $1}'`
i=0
until [ $i -gt $last ]
do
echo -n $i: >> tempfile
egrep \^$i: $1 | awk -F':' '{ORS = ""; OFS = ":";print $2,$3,$4,$5,$6}'  >> tempfile
echo ""  >> tempfile
i=`expr $i + 1`
done
mv tempfile $1



More information about the grass-user mailing list