[GRASS-SVN] r64880 - grass/branches/develbranch_6/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 17 01:43:33 PDT 2015


Author: mmetz
Date: 2015-03-17 01:43:33 -0700 (Tue, 17 Mar 2015)
New Revision: 64880

Modified:
   grass/branches/develbranch_6/lib/vector/Vlib/break_polygons.c
   grass/branches/develbranch_6/lib/vector/Vlib/build_nat.c
   grass/branches/develbranch_6/lib/vector/Vlib/header.c
   grass/branches/develbranch_6/lib/vector/Vlib/poly.c
Log:
Vlib: sync 64, 65

Modified: grass/branches/develbranch_6/lib/vector/Vlib/break_polygons.c
===================================================================
--- grass/branches/develbranch_6/lib/vector/Vlib/break_polygons.c	2015-03-17 08:43:21 UTC (rev 64879)
+++ grass/branches/develbranch_6/lib/vector/Vlib/break_polygons.c	2015-03-17 08:43:33 UTC (rev 64880)
@@ -63,9 +63,11 @@
 static int fpoint;
 
 /* Function called from RTreeSearch for point found */
-void srch(int id, int *arg)
+int srch(int id, int *arg)
 {
     fpoint = id;
+    
+    return 0;
 }
 
 /*!

Modified: grass/branches/develbranch_6/lib/vector/Vlib/build_nat.c
===================================================================
--- grass/branches/develbranch_6/lib/vector/Vlib/build_nat.c	2015-03-17 08:43:21 UTC (rev 64879)
+++ grass/branches/develbranch_6/lib/vector/Vlib/build_nat.c	2015-03-17 08:43:33 UTC (rev 64880)
@@ -313,6 +313,10 @@
 
     for (i = 0; i < List->n_values; i++) {
 	isle = List->value[i];
+	if (plus->Isle[isle]->area > 0) {
+	    dig_area_del_isle(plus, plus->Isle[isle]->area, isle);
+	    plus->Isle[isle]->area = 0;
+	}
 	Vect_attach_isle(Map, isle);
     }
     return 0;
@@ -364,10 +368,6 @@
      * to check if original area exist, unregister centroid from previous area.
      * To simplify code, this is implemented so that centroid is always firs unregistered 
      * and if new area is found, it is registered again.
-     *
-     * This problem can be avoided altogether if properly attached centroids
-     * are skipped
-     * MM 2009
      */
 
     Vect_select_lines_by_box(Map, box, GV_CENTROID, List);
@@ -378,15 +378,14 @@
 	centr = List->value[i];
 	Line = plus->Line[centr];
 
-	/* only attach unregistered and duplicate centroids because 
-	 * 1) all properly attached centroids are properly attached, really! Don't touch.
-	 * 2) Vect_find_area() below does not always return the correct area
-	 * 3) it's faster
-	 */
-	if (Line->left > 0)
-	    continue; 
-
+	/* Unregister centroid */
 	orig_area = Line->left;
+	if (orig_area > 0) {
+	    if (plus->Area[orig_area] != NULL) {
+		plus->Area[orig_area]->centroid = 0;
+	    }
+	}
+	Line->left = 0;
 
 	sel_area = Vect_find_area(Map, Line->E, Line->N);
 	G_debug(3, "  centroid %d is in area %d", centr, sel_area);
@@ -410,6 +409,8 @@
 		    dig_line_add_updated(plus, centr);
 	    }
 	}
+	else if (orig_area != 0 && plus->do_uplist)
+	    dig_line_add_updated(plus, centr);
     }
 
     return 0;
@@ -510,7 +511,6 @@
 
 	/* register lines, create nodes */
 	Vect_rewind(Map);
-
 	G_message(_("Registering primitives..."));
 	i = 1;
 	npoints = 0;

Modified: grass/branches/develbranch_6/lib/vector/Vlib/header.c
===================================================================
--- grass/branches/develbranch_6/lib/vector/Vlib/header.c	2015-03-17 08:43:21 UTC (rev 64879)
+++ grass/branches/develbranch_6/lib/vector/Vlib/header.c	2015-03-17 08:43:33 UTC (rev 64880)
@@ -493,7 +493,7 @@
 
    \param Map vector map
 
-   \return poiter to projection name
+   \return pointer to projection name
  */
 
 const char *Vect_get_proj_name(struct Map_info *Map)

Modified: grass/branches/develbranch_6/lib/vector/Vlib/poly.c
===================================================================
--- grass/branches/develbranch_6/lib/vector/Vlib/poly.c	2015-03-17 08:43:21 UTC (rev 64879)
+++ grass/branches/develbranch_6/lib/vector/Vlib/poly.c	2015-03-17 08:43:33 UTC (rev 64880)
@@ -636,7 +636,7 @@
 	    x_inter = dig_x_intersect(x1, x2, y1, y2, Y);
 	    G_debug(3, "x_inter = %f", x_inter);
 	    if (x_inter == X)
-		return 1;
+		return -1;	/* point on segment, do not assume inside/outside */
 	    else if (x_inter > X)
 		n_intersects++;
 



More information about the grass-commit mailing list