[GRASS-SVN] r52070 - grass/branches/develbranch_6/vector/v.distance
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jun 14 07:35:50 PDT 2012
Author: mmetz
Date: 2012-06-14 07:35:49 -0700 (Thu, 14 Jun 2012)
New Revision: 52070
Modified:
grass/branches/develbranch_6/vector/v.distance/main.c
Log:
v.distance: always sort results for -a
Modified: grass/branches/develbranch_6/vector/v.distance/main.c
===================================================================
--- grass/branches/develbranch_6/vector/v.distance/main.c 2012-06-14 14:15:04 UTC (rev 52069)
+++ grass/branches/develbranch_6/vector/v.distance/main.c 2012-06-14 14:35:49 UTC (rev 52070)
@@ -782,6 +782,8 @@
/* Update database / print to stdout / create output map */
if (print_flag->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);
@@ -839,7 +841,7 @@
if (!do_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 (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