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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 7 09:36:41 PDT 2012


Author: martinl
Date: 2012-08-07 09:36:40 -0700 (Tue, 07 Aug 2012)
New Revision: 52584

Modified:
   grass/trunk/lib/vector/Vlib/copy.c
Log:
vlib: document static fns in copy.c
      Vect_copy_map_lines(): return error code when writing new feature fails


Modified: grass/trunk/lib/vector/Vlib/copy.c
===================================================================
--- grass/trunk/lib/vector/Vlib/copy.c	2012-08-07 16:28:53 UTC (rev 52583)
+++ grass/trunk/lib/vector/Vlib/copy.c	2012-08-07 16:36:40 UTC (rev 52584)
@@ -96,6 +96,16 @@
     return ret;
 }
 
+/*!
+  \brief Copy vector features on level 1
+
+  \param In input vector map
+  \param field layer number (-1 for all layers)
+  \param Out output vector map
+  
+  \return 0 on success
+  \return 1 on error
+*/
 int copy_lines_1(struct Map_info *In, int field, struct Map_info *Out)
 {
     int ret, type;
@@ -138,6 +148,16 @@
     return ret;
 }
 
+/*!
+  \brief Copy vector features on level 2
+
+  \param In input vector map
+  \param field layer number (-1 for all layers)
+  \param Out output vector map
+  
+  \return 0 on success
+  \return 1 on error
+*/
 int copy_lines_2(struct Map_info *In, int field, int native, struct Map_info *Out)
 {
     int i, type, nlines;
@@ -217,7 +237,10 @@
                 continue;   /* different layer */
         }
         
-        Vect_write_line(Out, type, Points, Cats);
+        if (-1 == Vect_write_line(Out, type, Points, Cats)) {
+            G_warning(_("Writing new feature failed"));
+            return 1;
+        }
     }
 
     Vect_destroy_line_struct(Points);
@@ -228,6 +251,15 @@
     return ret;
 }
 
+/*!
+  \brief Copy nodes as points (PostGIS Topology only)
+
+  \param In input vector map
+  \param Out output vector map
+  
+  \return 0 on success
+  \return 1 on error
+*/
 int copy_nodes(const struct Map_info *In, struct Map_info *Out)
 {
     int nnodes, node, with_z;
@@ -260,6 +292,16 @@
     return nnodes;
 }
 
+/*!
+  \brief Copy areas as polygons (OGR/PostGIS simple features access only)
+
+  \param In input vector map
+  \param field layer number (> 0)
+  \param Out output vector map
+  
+  \return 0 on success
+  \return 1 on error
+*/
 int copy_areas(const struct Map_info *In, int field, struct Map_info *Out)
 {
     int i, area, nareas, cat, isle, nisles, nisles_alloc;



More information about the grass-commit mailing list