[GRASS-SVN] r52071 - grass/branches/releasebranch_6_4/vector/v.distance

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 14 07:38:37 PDT 2012


Author: mmetz
Date: 2012-06-14 07:38:37 -0700 (Thu, 14 Jun 2012)
New Revision: 52071

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

Modified: grass/branches/releasebranch_6_4/vector/v.distance/main.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.distance/main.c	2012-06-14 14:35:49 UTC (rev 52070)
+++ grass/branches/releasebranch_6_4/vector/v.distance/main.c	2012-06-14 14:38:37 UTC (rev 52071)
@@ -782,6 +782,8 @@
     /* Update database / print to stdout / create output map */
     if (print_flag->answer) {	/* print header */
 	fprintf(stdout, "from_cat");
+	if (all)
+	    fprintf(stdout, "|to_cat");
 	i = 0;
 	while (Upload[i].upload != END) {
 	    fprintf(stdout, "|%s", Upload[i].column);
@@ -839,7 +841,7 @@
     if (!all) {
 	count = nfcats;
     }
-    else if (print_as_matrix) {
+    else {
 	qsort((void *)Near, count, sizeof(NEAR), cmp_near_to);
     }
 
@@ -916,6 +918,8 @@
 	    }
 	    else {
 		fprintf(stdout, "%d", Near[i].from_cat);
+		if (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