[GRASS-SVN] r50964 - grass/trunk/raster/r.topidx

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Feb 27 18:29:24 EST 2012


Author: hamish
Date: 2012-02-27 15:29:24 -0800 (Mon, 27 Feb 2012)
New Revision: 50964

Modified:
   grass/trunk/raster/r.topidx/file_io.c
Log:
resolution error message clarify (#1597) and make status messages less important (merge from devbr6)

Modified: grass/trunk/raster/r.topidx/file_io.c
===================================================================
--- grass/trunk/raster/r.topidx/file_io.c	2012-02-27 23:25:01 UTC (rev 50963)
+++ grass/trunk/raster/r.topidx/file_io.c	2012-02-27 23:29:24 UTC (rev 50964)
@@ -11,6 +11,7 @@
     CELL *ccell = NULL;
     FCELL *fcell = NULL;
     struct Cell_head inhead;
+    char buf_wrns[32], buf_wrew[32], buf_mrns[32], buf_mrew[32];
 
     fd = Rast_open_old(iname, "");
 
@@ -26,10 +27,19 @@
     atb = (DCELL **) G_malloc(sizeof(DCELL *) * window.rows);
     a = (DCELL **) G_malloc(sizeof(DCELL *) * window.rows);
 
-    if (window.ew_res < inhead.ew_res || window.ns_res < inhead.ns_res)
-        G_fatal_error(_("Current region resolution [%.2fx%.2f] lower than input map resolution [%.2fx%.2f]! Needs to be at least identical or the current region resolution lower than the input map resolution"), window.ew_res, window.ns_res, inhead.ew_res, inhead.ns_res);
+    if (window.ew_res < inhead.ew_res || window.ns_res < inhead.ns_res) {
+	G_format_resolution(window.ew_res, buf_wrew, G_projection());
+	G_format_resolution(window.ns_res, buf_wrns, G_projection());
+	G_format_resolution(inhead.ew_res, buf_mrew, G_projection());
+	G_format_resolution(inhead.ns_res, buf_mrns, G_projection());
+	G_fatal_error(_("The current region resolution [%s x %s] is finer "
+			"than the input map's resolution [%s x %s]. "
+			"The current region resolution must be identical "
+			"to, or coarser than, the input map's resolution."),
+		      buf_wrew, buf_wrns, buf_mrew, buf_mrns);
+    }
 
-    G_important_message(_("Reading elevation map..."));
+    G_message(_("Reading elevation map..."));
 
     for (i = 0; i < window.rows; i++) {
 	G_percent(i, window.rows, 2);
@@ -75,7 +85,7 @@
 
     fd = Rast_open_new(oname, DCELL_TYPE);
 
-    G_important_message(_("Writing topographic index map..."));
+    G_message(_("Writing topographic index map..."));
 
     for (i = 0; i < window.rows; i++) {
 	G_percent(i, window.rows, 2);



More information about the grass-commit mailing list