[GRASS-SVN] r70179 - grass/branches/releasebranch_7_2/vector/v.out.postgis

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Dec 31 14:06:28 PST 2016


Author: martinl
Date: 2016-12-31 14:06:28 -0800 (Sat, 31 Dec 2016)
New Revision: 70179

Modified:
   grass/branches/releasebranch_7_2/vector/v.out.postgis/main.c
Log:
v.out.postgis doesn't export attribute table (see #2460)
              (relbr72: merge r69672 from trunk)


Modified: grass/branches/releasebranch_7_2/vector/v.out.postgis/main.c
===================================================================
--- grass/branches/releasebranch_7_2/vector/v.out.postgis/main.c	2016-12-31 21:59:38 UTC (rev 70178)
+++ grass/branches/releasebranch_7_2/vector/v.out.postgis/main.c	2016-12-31 22:06:28 UTC (rev 70179)
@@ -134,18 +134,19 @@
         G_fatal_error(_("Unable to create PostGIS layer <%s>"),
                       olayer);
     G_add_error_handler(output_handler, &Out);
-    
+
+    /* copy attributes (must be done before checking output type
+       otherwise attributes are not copied) */
+    field = Vect_get_field_number(&In, params.layer->answer);
+    if (!flags.table->answer)
+        Vect_copy_map_dblinks(&In, &Out, TRUE);
+
     /* check output type */
     if (otype > 0) { /* type is not 'auto' */
         if (Vect_write_line(&Out, otype, NULL, NULL) < 0)
             G_fatal_error(_("Feature type %d is not supported"), otype);
     }
 
-    /* copy attributes */
-    field = Vect_get_field_number(&In, params.layer->answer);
-    if (!flags.table->answer)
-        Vect_copy_map_dblinks(&In, &Out, TRUE);
-
     /* copy vector features & create PostGIS table */
     if (Vect_copy_map_lines_field(&In, field, &Out) != 0)
         G_fatal_error(_("Copying features failed"));



More information about the grass-commit mailing list