[GRASS-SVN] r52069 - grass/trunk/vector/v.distance

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 14 07:15:08 PDT 2012


Author: mmetz
Date: 2012-06-14 07:15:04 -0700 (Thu, 14 Jun 2012)
New Revision: 52069

Modified:
   grass/trunk/vector/v.distance/main.c
Log:
v.distance: always sort results for -a

Modified: grass/trunk/vector/v.distance/main.c
===================================================================
--- grass/trunk/vector/v.distance/main.c	2012-06-14 14:01:34 UTC (rev 52068)
+++ grass/trunk/vector/v.distance/main.c	2012-06-14 14:15:04 UTC (rev 52069)
@@ -915,6 +915,8 @@
     /* Update database / print to stdout / create output map */
     if (flag.print->answer) {	/* print header */
 	fprintf(stdout, "from_cat");
+	if (do_all)
+	    fprintf(stdout, "|to_cat");
 	i = 0;
 	while (Upload[i].upload != END) {
 	    fprintf(stdout, "|%s", Upload[i].column);
@@ -972,7 +974,7 @@
     if (!do_all) {
 	count = nfcats;
     }
-    else if (print_as_matrix) {
+    else {
 	qsort((void *)Near, count, sizeof(NEAR), cmp_near_to);
     }
 
@@ -1055,6 +1057,8 @@
 	    }
 	    else {
 		fprintf(stdout, "%d", Near[i].from_cat);
+		if (do_all)
+		    fprintf(stdout, "|%d", Near[i].to_cat);
 		print_upload(Near, Upload, i, &cvarr, catval);
 		fprintf(stdout, "\n");
 	    }



More information about the grass-commit mailing list