Sfoglia il codice sorgente

v.out.postgis doesn't export attribute table (see https://trac.osgeo.org/grass/ticket/2460)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@69672 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 8 anni fa
parent
commit
1eca4810b7
1 ha cambiato i file con 7 aggiunte e 6 eliminazioni
  1. 7 6
      vector/v.out.postgis/main.c

+ 7 - 6
vector/v.out.postgis/main.c

@@ -134,18 +134,19 @@ int main(int argc, char *argv[])
         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"));