[GRASS-SVN] r62413 - in grass/branches/releasebranch_7_0: . lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Oct 27 01:43:42 PDT 2014


Author: martinl
Date: 2014-10-27 01:43:42 -0700 (Mon, 27 Oct 2014)
New Revision: 62413

Modified:
   grass/branches/releasebranch_7_0/
   grass/branches/releasebranch_7_0/lib/vector/Vlib/write_pg.c
Log:
fix #2436 (v.out.postgis: Unsupported geometry type / Unable to write feature in vector map)
    (merge r62360 from trunk)



Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Modified: svn:mergeinfo
   - /grass/trunk:61095,61788,61897,62141,62327,62346,62352,62354,62356,62364
   + /grass/trunk:61095,61788,61897,62141,62327,62346,62352,62354,62356,62360,62364

Modified: grass/branches/releasebranch_7_0/lib/vector/Vlib/write_pg.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/vector/Vlib/write_pg.c	2014-10-27 08:19:45 UTC (rev 62412)
+++ grass/branches/releasebranch_7_0/lib/vector/Vlib/write_pg.c	2014-10-27 08:43:42 UTC (rev 62413)
@@ -1081,6 +1081,7 @@
         pg_info->feature_type = SF_LINESTRING;
         break;
     case GV_BOUNDARY:
+    case GV_AREA:
         pg_info->feature_type = SF_POLYGON;
         break;
     case GV_FACE:
@@ -1215,8 +1216,13 @@
     /* get category & check for attributes */
     cat = -1;
     if (cats->n_cats > 0) {
-        int field = pg_info->fi->number;
+        int field;
         
+        if (pg_info->fi)
+            field = pg_info->fi->number;
+        else
+            field = 1;
+        
         if (!Vect_cat_get(cats, field, &cat))
             G_warning(_("No category defined for layer %d"), field);
         if (cats->n_cats > 1) {



More information about the grass-commit mailing list