[GRASS-SVN] r46658 - grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.rectify

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jun 10 11:03:24 EDT 2011


Author: mmetz
Date: 2011-06-10 08:03:24 -0700 (Fri, 10 Jun 2011)
New Revision: 46658

Modified:
   grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.rectify/exec.c
   grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.rectify/main.c
   grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.rectify/report.c
   grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.rectify/target.c
Log:
sync to 6.5

Modified: grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.rectify/exec.c
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.rectify/exec.c	2011-06-10 13:35:34 UTC (rev 46657)
+++ grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.rectify/exec.c	2011-06-10 15:03:24 UTC (rev 46658)
@@ -18,12 +18,12 @@
     char *name;
     char *mapset;
     char *result;
-    char *type;
+    char *type = "raster";
     int n;
     struct Colors colr;
     struct Categories cats;
     struct History hist;
-    int colr_ok, hist_ok, cats_ok;
+    int colr_ok, cats_ok;
     long start_time, rectify_time;
     double aver_z;
     int elevfd;
@@ -51,6 +51,8 @@
     /* this is used only if target cells have no elevation */
     get_aver_elev(&group.control_points, &aver_z);
 
+    G_message("-----------------------------------------------");
+
     /* rectify each file */
     for (n = 0; n < group.group_ref.nfiles; n++) {
 	if (!ref_list[n])
@@ -69,14 +71,14 @@
 	G_debug(2, "RESULT %s", result);
 	G_debug(2, "select_current_env...");
 
-	G_message(_("Rectified input raster map <%s> will be saved as <%s>"),
-		  name, result);
-
 	select_current_env();
 
 	cats_ok = G_read_cats(name, mapset, &cats) >= 0;
 	colr_ok = G_read_colors(name, mapset, &colr) > 0;
-	hist_ok = G_read_history(name, mapset, &hist) >= 0;
+
+	/* Initialze History */
+	if (G_read_history(name, mapset, &hist) < 0)
+	    G_short_history(result, type, &hist);
 	G_debug(2, "reading was fine...");
 
 	time(&start_time);
@@ -94,12 +96,7 @@
 		G_write_colors(result, G_mapset(), &colr);
 		G_free_colors(&colr);
 	    }
-	    if (hist_ok)
-		G_write_history(result, &hist);
-
-	    /* Initialze History */
-	    type = "raster";
-	    G_short_history(name, type, &hist);
+	    /* Write out History */
 	    G_command_history(&hist);
 	    G_write_history(result, &hist);
 
@@ -120,7 +117,5 @@
 	camera_angle(angle_map);
     }
     
-    G_done_msg(" ");
-
     return 0;
 }

Modified: grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.rectify/main.c
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.rectify/main.c	2011-06-10 13:35:34 UTC (rev 46657)
+++ grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.rectify/main.c	2011-06-10 15:03:24 UTC (rev 46658)
@@ -110,7 +110,7 @@
     mem->type = TYPE_DOUBLE;
     mem->key_desc = "memory in MB";
     mem->required = NO;
-    mem->answer = "100";
+    mem->answer = "300";
     mem->description = _("Amount of memory to use in MB");
 
     ipolname = make_ipol_list();
@@ -370,6 +370,8 @@
     /* go do it */
     exec_rectify(extension, interpol->answer, angle->answer);
 
+    G_done_msg(" ");
+
     exit(EXIT_SUCCESS);
 }
 

Modified: grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.rectify/report.c
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.rectify/report.c	2011-06-10 13:35:34 UTC (rev 46657)
+++ grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.rectify/report.c	2011-06-10 15:03:24 UTC (rev 46658)
@@ -1,14 +1,13 @@
+#include <grass/glocale.h>
 #include "global.h"
 
-int
-report(long rectify, int ok)
+int report(long rectify, int ok)
 {
     int minutes, hours;
     long seconds;
     long ncells;
 
-    fprintf(stderr, "%s\n", ok ? _("complete") : _("failed"));
-    fprintf(stderr, "-----------------------------------------------\n");
+    G_message("%s", ok ? _("complete") : _("failed"));
 
     if (!ok)
 	return 1;
@@ -18,17 +17,17 @@
     hours = minutes / 60;
     minutes -= hours * 60;
     ncells = target_window.rows * target_window.cols;
-    fprintf(stderr, _(" %d rows, %d cols (%ld cells) completed in "),
-	    target_window.rows, target_window.cols, ncells);
+    G_verbose_message(_("%d rows, %d cols (%ld cells) completed in"),
+			target_window.rows, target_window.cols, ncells);
     if (hours)
-	fprintf(stderr, "%d:%02d:%02ld hours\n", hours, minutes, seconds % 60);
+	G_verbose_message(_("%d:%02d:%02ld hours"), hours, minutes, seconds % 60);
     else
-	fprintf(stderr, "%d:%02ld minutes\n", minutes, seconds % 60);
+	G_verbose_message(_("%d:%02ld minutes"), minutes, seconds % 60);
     if (seconds)
-	fprintf(stderr, _(" %.1f cells per minute\n"),
-		(60.0 * ncells) / ((double)seconds));
+	G_verbose_message(_("%.1f cells per minute"),
+			  (60.0 * ncells) / ((double)seconds));
+		      
+    G_message("-----------------------------------------------");
 
-    fprintf(stderr, "-----------------------------------------------\n");
-
     return 1;
 }

Modified: grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.rectify/target.c
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.rectify/target.c	2011-06-10 13:35:34 UTC (rev 46657)
+++ grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.rectify/target.c	2011-06-10 15:03:24 UTC (rev 46658)
@@ -2,21 +2,21 @@
 #include <string.h>
 #include "global.h"
 
-int get_target(char *name)
+int get_target(char *group)
 {
-    char location[40];
-    char mapset[40];
+    char location[GMAPSET_MAX];
+    char mapset[GMAPSET_MAX];
     char buf[1024];
     int stat;
 
-    if (!I_get_target(name, location, mapset)) {
-	sprintf(buf, _("Target information for group <%s> missing.\n"), name);
+    if (!I_get_target(group, location, mapset)) {
+	sprintf(buf, _("Target information for group <%s> missing"), group);
 	goto error;
     }
 
     sprintf(buf, "%s/%s", G_gisdbase(), location);
     if (access(buf, 0) != 0) {
-	sprintf(buf, _("Target location <%s> not found\n"), location);
+	sprintf(buf, _("Target location <%s> not found"), location);
 	goto error;
     }
     select_target_env();
@@ -29,7 +29,7 @@
 	return 1;
     }
     sprintf(buf, _("Mapset <%s> in target location <%s> - "), mapset, location);
-    strcat(buf, stat == 0 ? _("permission denied\n") : _("not found\n"));
+    strcat(buf, stat == 0 ? _("permission denied") : _("not found"));
   error:
     G_fatal_error(buf);
 }



More information about the grass-commit mailing list