[GRASS-SVN] r50488 - grass/trunk/vector/v.to.rast

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jan 27 04:59:15 EST 2012


Author: mmetz
Date: 2012-01-27 01:59:15 -0800 (Fri, 27 Jan 2012)
New Revision: 50488

Modified:
   grass/trunk/vector/v.to.rast/support.c
Log:
port r50487 to trunk with modifications

Modified: grass/trunk/vector/v.to.rast/support.c
===================================================================
--- grass/trunk/vector/v.to.rast/support.c	2012-01-27 09:33:13 UTC (rev 50487)
+++ grass/trunk/vector/v.to.rast/support.c	2012-01-27 09:59:15 UTC (rev 50488)
@@ -269,6 +269,11 @@
 	{
 	    int is_fp = Rast_map_is_fp(rast_name, G_mapset());
 
+	    if (!label_column) {
+		G_verbose_message(_("Label column was not specified, no labels will be written"));
+		break;
+	    }
+
 	    Rast_set_cats_title("Labels", &rast_cats);
 
 	    /* open vector map and database driver */
@@ -303,17 +308,11 @@
 		G_malloc(sizeof(struct My_labels_rule) * nrec);
 
 	    /* get column type */
-	    if (!label_column) {
-		G_verbose_message(_("Label column was not specified, no labels will be written"));
-		break;
+	    if ((col_type =
+		 db_column_Ctype(Driver, Fi->table,
+				 label_column)) == -1) {
+		G_fatal_error(_("Column <%s> not found"), label_column);
 	    }
-	    else {
-		if ((col_type =
-		     db_column_Ctype(Driver, Fi->table,
-				     label_column)) == -1) {
-		    G_fatal_error(_("Column <%s> not found"), label_column);
-		}
-	    }
 
 	    /* for each attribute */
 	    for (i = 0; i < cvarr.n_values; i++) {



More information about the grass-commit mailing list