[GRASS-SVN] r37512 - grass-addons/ps/ps.output

svn_grass at osgeo.org svn_grass at osgeo.org
Tue May 26 12:55:46 EDT 2009


Author: ejtizado
Date: 2009-05-26 12:55:46 -0400 (Tue, 26 May 2009)
New Revision: 37512

Modified:
   grass-addons/ps/ps.output/set_vector.c
Log:
Corrected error drawn islands


Modified: grass-addons/ps/ps.output/set_vector.c
===================================================================
--- grass-addons/ps/ps.output/set_vector.c	2009-05-26 16:55:12 UTC (rev 37511)
+++ grass-addons/ps/ps.output/set_vector.c	2009-05-26 16:55:46 UTC (rev 37512)
@@ -222,7 +222,7 @@
 int set_vareas(VECTOR vec, VAREAS *va)
 {
     int k, ret, cat;
-    int area, nareas, island, nislands;
+    int area, nareas, island, nislands, centroid;
     struct line_cats *lcats;
     struct line_pnts *lpoints;
     BOUND_BOX box;
@@ -264,6 +264,11 @@
         if (vec.Varray != NULL && vec.Varray->c[area] == 0) {
             continue;
         }
+
+        centroid = Vect_get_area_centroid(&(vec.Map), area);
+        if (centroid < 1)  /* area is an island */
+            continue;
+
         /* check if in window */
         Vect_get_area_box(&(vec.Map), area, &box);
         if (box.N < PS.map.south || box.S > PS.map.north ||
@@ -282,7 +287,7 @@
         {
             k = Vect_get_area_isle(&(vec.Map), area, island);
             if (Vect_get_isle_points(&(vec.Map), k, lpoints) < 0)
-                return -1;
+                return -1; /* ? break; */
 
             vector_line(lpoints);
             fprintf(PS.fp, "CP\n");



More information about the grass-commit mailing list