[GRASS-SVN] r40567 - grass/branches/releasebranch_6_4/vector/lidar/v.outlier

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jan 20 03:33:15 EST 2010


Author: mmetz
Date: 2010-01-20 03:33:14 -0500 (Wed, 20 Jan 2010)
New Revision: 40567

Modified:
   grass/branches/releasebranch_6_4/vector/lidar/v.outlier/main.c
   grass/branches/releasebranch_6_4/vector/lidar/v.outlier/outlier.c
Log:
fixing aux table and bug in P_Outlier(), backport from trunk r39785

Modified: grass/branches/releasebranch_6_4/vector/lidar/v.outlier/main.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/lidar/v.outlier/main.c	2010-01-20 08:29:39 UTC (rev 40566)
+++ grass/branches/releasebranch_6_4/vector/lidar/v.outlier/main.c	2010-01-20 08:33:14 UTC (rev 40567)
@@ -134,7 +134,8 @@
     Thres_Outlier = atof(Thres_O_opt->answer);
 
     /* Setting auxiliar table's name */
-    sprintf(table_name, "%s_aux", out_opt->answer);
+    /* sprintf(table_name, "%s_aux", out_opt->answer); */
+    sprintf(table_name, "Auxiliar_outlier_table");
 
     /* Checking vector names */
     Vect_check_input_output_name(in_opt->answer, out_opt->answer,
@@ -188,13 +189,19 @@
 	G_fatal_error(_("No database connection for driver <%s> is defined. Run db.connect."),
 		      dvr);
 
+    /* Something went wrong in a previous v.outlier execution */
+    if (db_table_exists(dvr, db, table_name)) {
+	if (P_Drop_Aux_Table(driver, table_name) != DB_OK)
+	    G_fatal_error(_("Old auxiliar table could not be dropped"));
+    }
+
     /* Setting regions and boxes */
     G_get_set_window(&original_reg);
     G_get_set_window(&elaboration_reg);
     Vect_region_box(&elaboration_reg, &overlap_box);
     Vect_region_box(&elaboration_reg, &general_box);
 
-    /* Fixxing parameters of the elaboration region */
+    /* Fixing parameters of the elaboration region */
     /*! Each original_region will be divided into several subregions. These
      *  subregion will be overlapped by its neibourgh subregions. This overlapping
      *  is calculated as OVERLAP_PASS times the east-west resolution. */
@@ -355,7 +362,7 @@
 	Vect_close(&Qgis);
     }
 
-    G_done_msg("");
+    G_done_msg(" ");
 
     exit(EXIT_SUCCESS);
 }				/*!END MAIN */

Modified: grass/branches/releasebranch_6_4/vector/lidar/v.outlier/outlier.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/lidar/v.outlier/outlier.c	2010-01-20 08:29:39 UTC (rev 40566)
+++ grass/branches/releasebranch_6_4/vector/lidar/v.outlier/outlier.c	2010-01-20 08:33:14 UTC (rev 40567)
@@ -14,7 +14,7 @@
 	       int num_points, dbDriver * driver)
 {
     int i;
-    double interpolation, weight, residual, eta, csi, *gradient;
+    double interpolation, weight, residual, eta, csi, gradient[2];
 
     extern int nsplx, nsply;
     extern double passoN, passoE;



More information about the grass-commit mailing list