Selaa lähdekoodia

v.out.ogr: fix export areas without category as one multi-feature (backport trunk https://trac.osgeo.org/grass/changeset/69551)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@69560 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 8 vuotta sitten
vanhempi
commit
484264ee99
1 muutettua tiedostoa jossa 3 lisäystä ja 17 poistoa
  1. 3 17
      vector/v.out.ogr/export_areas.c

+ 3 - 17
vector/v.out.ogr/export_areas.c

@@ -216,18 +216,10 @@ int export_areas_multi(struct Map_info *In, int field, int donocat,
     /* 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 @@ int export_areas_multi(struct Map_info *In, int field, int donocat,
                        * 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);