[GRASS-SVN] r45411 - grass/branches/develbranch_6/imagery/i.pca

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 16 07:03:44 EST 2011


Author: hamish
Date: 2011-02-16 04:03:44 -0800 (Wed, 16 Feb 2011)
New Revision: 45411

Modified:
   grass/branches/develbranch_6/imagery/i.pca/support.c
Log:
experimental metadata output formatting to help with #1279

Modified: grass/branches/develbranch_6/imagery/i.pca/support.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.pca/support.c	2011-02-16 11:46:19 UTC (rev 45410)
+++ grass/branches/develbranch_6/imagery/i.pca/support.c	2011-02-16 12:03:44 UTC (rev 45411)
@@ -47,7 +47,7 @@
 	eigval_total += eigval[i];
 
     for (i = 0; i < bands; i++) {
-	char tmpeigen[256], tmpa[80];
+	char tmpeigen[2048], tmpa[80];  /* (bands*8)+30 instead of 2048? */
 
 	sprintf(tmpeigen, "PC%d %9.2f (", i+1, eigval[i]);
 	for (j = 0; j < bands; j++) {
@@ -56,6 +56,10 @@
 	    if (j < (bands - 1) ){
 		sprintf(tmpa, ",");
 		G_strcat(tmpeigen, tmpa);
+		if (j%6 == 0 && j != bands) {
+		    sprintf(tmpa, "\n%15s", " ");
+		    G_strcat(tmpeigen, tmpa);
+		}
 	    }
 	}
 	G_strcat(tmpeigen, ") ");



More information about the grass-commit mailing list