[GRASS-SVN] r69560 - grass/branches/releasebranch_7_0/vector/v.out.ogr

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Sep 23 06:03:12 PDT 2016


Author: mmetz
Date: 2016-09-23 06:03:12 -0700 (Fri, 23 Sep 2016)
New Revision: 69560

Modified:
   grass/branches/releasebranch_7_0/vector/v.out.ogr/export_areas.c
Log:
v.out.ogr: fix export areas without category as one multi-feature (backport trunk r69551)

Modified: grass/branches/releasebranch_7_0/vector/v.out.ogr/export_areas.c
===================================================================
--- grass/branches/releasebranch_7_0/vector/v.out.ogr/export_areas.c	2016-09-23 13:02:50 UTC (rev 69559)
+++ grass/branches/releasebranch_7_0/vector/v.out.ogr/export_areas.c	2016-09-23 13:03:12 UTC (rev 69560)
@@ -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