[GRASS-SVN] r41954 - grass/trunk/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 21 11:51:23 EDT 2010


Author: martinl
Date: 2010-04-21 11:51:22 -0400 (Wed, 21 Apr 2010)
New Revision: 41954

Modified:
   grass/trunk/lib/vector/Vlib/read_ogr.c
Log:
vlib: fix reading areas from OGR sources


Modified: grass/trunk/lib/vector/Vlib/read_ogr.c
===================================================================
--- grass/trunk/lib/vector/Vlib/read_ogr.c	2010-04-21 15:27:36 UTC (rev 41953)
+++ grass/trunk/lib/vector/Vlib/read_ogr.c	2010-04-21 15:51:22 UTC (rev 41954)
@@ -399,25 +399,6 @@
     if (line_c != NULL)
 	Vect_reset_cats(line_c);
 
-    /*
-    if (Line->type == GV_CENTROID) {
-	G_debug(4, "Centroid");
-	node = Line->N1;
-	Node = Map->plus.Node[node];
-
-	if (line_p != NULL) {
-	    Vect_append_point(line_p, Node->x, Node->y, 0.0);
-	}
-
-	if (line_c != NULL) {
-	cat = FID and offset = FID for centroid
-	    Vect_cat_set(line_c, 1, (int)offset);
-	}
-
-	return (GV_CENTROID);
-    }
-    */
-
     FID = Map->fInfo.ogr.offset[offset];
     G_debug(4, "  FID = %ld", FID);
     
@@ -474,7 +455,6 @@
 		     struct line_cats *line_c, int line)
 {
     struct P_line *Line;
-    
     G_debug(4, "V2_read_line_ogr() line = %d", line);
     
     Line = Map->plus.Line[line];
@@ -483,6 +463,26 @@
 	G_fatal_error("V2_read_line_ogr(): %s %d",
 		      _("Attempt to read dead line"), line);
 
+    if (Line->type == GV_CENTROID) {
+	plus_t         node;
+	struct P_node *Node;
+	
+	G_debug(4, "Centroid");
+	node = Line->N1;
+	Node = Map->plus.Node[node];
+
+	if (line_p != NULL) {
+	    Vect_append_point(line_p, Node->x, Node->y, 0.0);
+	}
+
+	if (line_c != NULL) {
+	  /* cat = FID and offset = FID for centroid */
+	  Vect_cat_set(line_c, 1, (int) Line->offset);
+	}
+	
+	return GV_CENTROID;
+    }
+    
     return V1_read_line_ogr(Map, line_p, line_c, Line->offset);
 }
 



More information about the grass-commit mailing list