[GRASS-SVN] r50960 - grass/branches/develbranch_6/raster/r.topidx

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Feb 27 18:16:14 EST 2012


Author: hamish
Date: 2012-02-27 15:16:14 -0800 (Mon, 27 Feb 2012)
New Revision: 50960

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

Modified: grass/branches/develbranch_6/raster/r.topidx/file_io.c
===================================================================
--- grass/branches/develbranch_6/raster/r.topidx/file_io.c	2012-02-27 22:57:26 UTC (rev 50959)
+++ grass/branches/develbranch_6/raster/r.topidx/file_io.c	2012-02-27 23:16:14 UTC (rev 50960)
@@ -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];
 
     if ((fd = G_open_cell_old(iname, mapset)) < 0)
 	G_fatal_error(_("Cannot open raster map <%s>"), iname);
@@ -28,12 +29,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);
@@ -87,7 +95,7 @@
     if ((fd = G_open_raster_new(oname, DCELL_TYPE)) < 0)
 	G_fatal_error(_("Cannot create raster map <%s>"), oname);
 
-    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