瀏覽代碼

vlib/pg: faces are exported as 3D polygons (simple features)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@56399 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 年之前
父節點
當前提交
ce8e3c82d3
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      lib/vector/Vlib/write_pg.c

+ 7 - 1
lib/vector/Vlib/write_pg.c

@@ -648,6 +648,9 @@ int create_table(struct Format_info_pg *pg_info, const struct field_info *Fi)
     case (SF_POLYGON):
         geom_type = "POLYGON";
         break;
+    case (SF_POLYGON25D):
+        geom_type = "POLYGONZ";
+        break;
     default:
         G_warning(_("Unsupported feature type %d"), pg_info->feature_type);
         Vect__execute_pg(pg_info->conn, "ROLLBACK");
@@ -906,6 +909,9 @@ int create_pg_layer(struct Map_info *Map, int type)
     case GV_BOUNDARY:
         pg_info->feature_type = SF_POLYGON;
         break;
+    case GV_FACE:
+        pg_info->feature_type = SF_POLYGON25D;
+        break;
     default:
         G_warning(_("Unsupported geometry type (%d)"), type);
         return -1;
@@ -1552,7 +1558,7 @@ char *line_to_wkb(struct Format_info_pg *pg_info,
         wkb_data = point_to_wkb(byte_order, points[0], with_z, &nbytes);
     else if (type == GV_LINE)
         wkb_data = linestring_to_wkb(byte_order, points[0], with_z, &nbytes);
-    else if (type == GV_BOUNDARY) {
+    else if (type & (GV_BOUNDARY | GV_FACE)) {
         if (!pg_info->toposchema_name) {
             /* PostGIS simple feature access */
             wkb_data = polygon_to_wkb(byte_order, points, nparts,