[GRASS-SVN] r69551 - grass/trunk/vector/v.out.ogr

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Sep 22 05:21:03 PDT 2016


Author: mmetz
Date: 2016-09-22 05:21:03 -0700 (Thu, 22 Sep 2016)
New Revision: 69551

Modified:
   grass/trunk/vector/v.out.ogr/export_areas.c
Log:
v.out.ogr: fix export areas without category as one multi-feature

Modified: grass/trunk/vector/v.out.ogr/export_areas.c
===================================================================
--- grass/trunk/vector/v.out.ogr/export_areas.c	2016-09-22 12:17:01 UTC (rev 69550)
+++ grass/trunk/vector/v.out.ogr/export_areas.c	2016-09-22 12:21:03 UTC (rev 69551)
@@ -216,18 +216,10 @@
     /* check lines without category, if -c flag is given write them as
      * one multi-feature */
     Ogr_geometry = OGR_G_CreateGeometry(wkbtype);
-    
-    /* TODO: if donocat, also export areas without centroid
-     * -> loop over areas, not centroids */
 
-    Vect_rewind(In);
-    Vect_set_constraint_type(In, GV_CENTROID);
-    while(TRUE) {
-        type = Vect_read_next_line(In, NULL, Cats);
-        if (type < 0)
-            break;
-
-        /* get centroid's category */
+    for (area = 1; area <= Vect_get_num_areas(In); area++) {
+        /* get areas's category */
+	Vect_get_area_cats(In, area, Cats);
         Vect_cat_get(Cats, field, &cat);
         if (cat > 0)
             continue; /* skip features with category */
@@ -237,12 +229,6 @@
                        * not labeled */
         }
 
-        /* find corresponding area */
-	line = Vect_get_next_line_id(In);
-        area = Vect_get_centroid_area(In, line);
-        if (area <= 0)
-            continue;
-                
         /* create polygon from area */
         Ogr_geometry_part = create_polygon(In, area, Points);
         



More information about the grass-commit mailing list