[GRASS-SVN] r31895 - grass/trunk/vector/v.in.ascii

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jun 30 09:36:03 EDT 2008


Author: neteler
Date: 2008-06-30 09:36:03 -0400 (Mon, 30 Jun 2008)
New Revision: 31895

Modified:
   grass/trunk/vector/v.in.ascii/in.c
   grass/trunk/vector/v.in.ascii/points.c
Log:
more informative error messages

Modified: grass/trunk/vector/v.in.ascii/in.c
===================================================================
--- grass/trunk/vector/v.in.ascii/in.c	2008-06-30 13:34:46 UTC (rev 31894)
+++ grass/trunk/vector/v.in.ascii/in.c	2008-06-30 13:36:03 UTC (rev 31895)
@@ -439,45 +439,45 @@
 		    switch (coltype[i]) {
 		    case DB_C_TYPE_INT:
 			if (ctype == DB_C_TYPE_DOUBLE) {
-			    G_warning(_("Column number %d defined as double "
-					"has only integer values"), i + 1);
+			    G_warning(_("Column number %d <%s> defined as double "
+					"has only integer values"), i + 1, db_get_column_name(column));
 			}
 			else if (ctype == DB_C_TYPE_STRING) {
-			    G_warning(_("Column number %d defined as string "
-					"has only integer values"), i + 1);
+			    G_warning(_("Column number %d <%s> defined as string "
+					"has only integer values"), i + 1, db_get_column_name(column));
 			}
 			break;
 		    case DB_C_TYPE_DOUBLE:
 			if (ctype == DB_C_TYPE_INT) {
 			    Vect_delete(new->answer);
 			    G_fatal_error(_
-					  ("Column number %d defined as integer "
-					   "has double values"), i + 1);
+					  ("Column number %d <%s> defined as integer "
+					   "has double values"), i + 1, db_get_column_name(column));
 			}
 			else if (ctype == DB_C_TYPE_STRING) {
-			    G_warning(_("Column number %d defined as string "
-					"has double values"), i + 1);
+			    G_warning(_("Column number %d <%s> defined as string "
+					"has double values"), i + 1, db_get_column_name(column));
 			}
 			break;
 		    case DB_C_TYPE_STRING:
 			if (ctype == DB_C_TYPE_INT) {
 			    Vect_delete(new->answer);
 			    G_fatal_error(_
-					  ("Column number %d defined as integer "
-					   "has string values"), i + 1);
+					  ("Column number %d <%s> defined as integer "
+					   "has string values"), i + 1, db_get_column_name(column));
 			}
 			else if (ctype == DB_C_TYPE_DOUBLE) {
 			    Vect_delete(new->answer);
 			    G_fatal_error(_
-					  ("Column number %d defined as double "
-					   "has string values"), i + 1);
+					  ("Column number %d <%s> defined as double "
+					   "has string values"), i + 1, db_get_column_name(column));
 			}
 			if (length < collen[i]) {
 			    Vect_delete(new->answer);
 			    G_fatal_error(_
-					  ("Length of column %d (%d) is less than "
+					  ("Length of column %d <%s> (%d) is less than "
 					   "maximum value " "length (%d)"),
-					  i + 1, length, collen[i]);
+					  i + 1, db_get_column_name(column), length, collen[i]);
 			}
 			break;
 		    }

Modified: grass/trunk/vector/v.in.ascii/points.c
===================================================================
--- grass/trunk/vector/v.in.ascii/points.c	2008-06-30 13:34:46 UTC (rev 31894)
+++ grass/trunk/vector/v.in.ascii/points.c	2008-06-30 13:36:03 UTC (rev 31895)
@@ -158,8 +158,10 @@
 				   skip = TRUE;
 			    }
 			}
-			else
-			    G_fatal_error(_("Unparsable longitude value: %s"), tokens[i]);
+			else {
+			    fprintf(stderr, "Current row: '%s'\n", buf_raw);
+			    G_fatal_error(_("Unparsable longitude value in column <%d>: %s"), i, tokens[i]);
+			}
 		    }
 
 		    if (i == ycol) {
@@ -173,8 +175,10 @@
 			 	    skip = TRUE;
 			    }
 			}
-			else
-			    G_fatal_error(_("Unparsable latitude value: %s"), tokens[i]);
+			else {
+			    fprintf(stderr, "Current row: '%s'\n", buf_raw);
+			    G_fatal_error(_("Unparsable latitude value in column <%d>: %s"), i, tokens[i]);
+			}
 		    }
  		} /* if (x or y) */
 



More information about the grass-commit mailing list