[GRASS-SVN] r31734 - grass/trunk/general/g.transform

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jun 17 07:03:09 EDT 2008


Author: martinl
Date: 2008-06-17 07:03:09 -0400 (Tue, 17 Jun 2008)
New Revision: 31734

Modified:
   grass/trunk/general/g.transform/crs.c
   grass/trunk/general/g.transform/main.c
Log:
g.transform: i18n, standard option, summary output enabled (merge from devbr6, r31733)


Modified: grass/trunk/general/g.transform/crs.c
===================================================================
--- grass/trunk/general/g.transform/crs.c	2008-06-17 10:59:40 UTC (rev 31733)
+++ grass/trunk/general/g.transform/crs.c	2008-06-17 11:03:09 UTC (rev 31734)
@@ -452,4 +452,3 @@
 
 	return MSUCCESS;
 }
-

Modified: grass/trunk/general/g.transform/main.c
===================================================================
--- grass/trunk/general/g.transform/main.c	2008-06-17 10:59:40 UTC (rev 31733)
+++ grass/trunk/general/g.transform/main.c	2008-06-17 11:03:09 UTC (rev 31734)
@@ -5,7 +5,7 @@
  *               Glynn Clements
  * PURPOSE:      Utility to compute transformation based upon GCPs and 
  *               output error measurements
- * COPYRIGHT:    (C) 2006 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2006-2008 by the GRASS Development Team
  *
  *               This program is free software under the GNU General Public
  *               License (>=v2). Read the file COPYING that comes with GRASS
@@ -21,6 +21,7 @@
 #include <grass/gis.h>
 #include <grass/glocale.h>
 #include <grass/imagery.h>
+#include <grass/glocale.h>
 
 extern int CRS_compute_georef_equations(struct Control_Points *,double *, double *,double *,double *,int);
 extern int CRS_georef(double,double,double *,double *,double *,double *,int);
@@ -85,7 +86,8 @@
 	equation_stat = CRS_compute_georef_equations(&points, E12, N12, E21, N21, order);
 
 	if (equation_stat == 0)
-		G_fatal_error("Not Enough Points -- %d are required.", order_pnts[order - 1]);
+		G_fatal_error(_("Not enough points, %d are required"),
+			      order_pnts[order - 1]);
 
 	if (equation_stat <= 0)
 		return;
@@ -179,13 +181,13 @@
 static void analyze(void)
 {
 	if (equation_stat == -1)
-		G_warning("Poorly placed control points");
+		G_warning(_("Poorly placed control points"));
 	else if (equation_stat == -2)
-		G_fatal_error("Insufficient memory");
+		G_fatal_error(_("Insufficient memory"));
 	else if (equation_stat < 0)
-		G_fatal_error("Parameter error");
+		G_fatal_error(_("Parameter error"));
 	else if (equation_stat == 0)
-		G_fatal_error("No active control points");
+		G_fatal_error(_("No active control points"));
 	else if (summary)
 	{
 		printf("Number of active points: %d\n", count);
@@ -233,16 +235,11 @@
 
 	/* Get Args */
 	module = G_define_module();
-	module->keywords = _("general");
-    module->description =
-		_("Computes a coordinate transformation based on the control points");
+	module->keywords = _("general, transformation, GCP");
+	module->description =
+		_("Computes a coordinate transformation based on the control points.");
 
-	grp = G_define_option();
-	grp->key             = "group";
-	grp->type            = TYPE_STRING;
-	grp->required        = YES;
-	grp->gisprompt       = "old,group,group";
-	grp->description     = _("Name of imagery group");
+	grp = G_define_standard_option(G_OPT_I_GROUP);
 
 	val = G_define_option();
 	val->key             = "order";
@@ -257,6 +254,15 @@
 	fmt->required        = NO;
 	fmt->multiple        = YES;
 	fmt->options         = "idx,src,dst,fwd,rev,fxy,rxy,fd,rd";
+	fmt->descriptions    = _("idx;point index;"
+				 "src;source coordinates;"
+				 "dst;destination coordinates;"
+				 "fwd;forward coordinates (destination);"
+				 "rev;reverse coordinates (source);"
+				 "fxy;forward coordinates difference (destination);"
+				 "rxy;reverse coordinates difference (source);"
+				 "fd;forward error (destination);"
+				 "rd;reverse error (source)");
 	fmt->answer          = "fd,rd";
 	fmt->description     = _("Output format");
 
@@ -280,6 +286,7 @@
 
 	I_put_control_points(name, &points);
 
+	analyze();
+
 	return 0;
 }
-



More information about the grass-commit mailing list