[GRASS-SVN] r67040 - in grass/trunk: include/vect lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 8 15:54:18 PST 2015


Author: martinl
Date: 2015-12-08 15:54:17 -0800 (Tue, 08 Dec 2015)
New Revision: 67040

Modified:
   grass/trunk/include/vect/dig_defines.h
   grass/trunk/lib/vector/Vlib/build_pg.c
   grass/trunk/lib/vector/Vlib/open_pg.c
   grass/trunk/lib/vector/Vlib/read_pg.c
   grass/trunk/lib/vector/Vlib/write_pg.c
Log:
rename SF_UNKNOWN to SF_GEOMETRY (SF_UNKNOWN defined in oaidl.h on Windows)


Modified: grass/trunk/include/vect/dig_defines.h
===================================================================
--- grass/trunk/include/vect/dig_defines.h	2015-12-08 23:37:07 UTC (rev 67039)
+++ grass/trunk/include/vect/dig_defines.h	2015-12-08 23:54:17 UTC (rev 67040)
@@ -233,7 +233,7 @@
 */
 typedef enum
 {
-    SF_UNKNOWN = 0,                       /* unknown type, non-standard */
+    SF_GEOMETRY = 0,                      /* unknown type, non-standard */
     SF_POINT = 1,                         /* 0-dimensional geometric object */
     SF_LINESTRING = 2,                    /* 1-dimensional geometric object with linear
 					     interpolation between Points */

Modified: grass/trunk/lib/vector/Vlib/build_pg.c
===================================================================
--- grass/trunk/lib/vector/Vlib/build_pg.c	2015-12-08 23:37:07 UTC (rev 67039)
+++ grass/trunk/lib/vector/Vlib/build_pg.c	2015-12-08 23:54:17 UTC (rev 67040)
@@ -71,7 +71,7 @@
         return 0;
     pg_info->inTransaction = FALSE;
     
-    if (pg_info->feature_type == SF_UNKNOWN)
+    if (pg_info->feature_type == SF_GEOMETRY)
         return 1;
     
     if (build == plus->built)

Modified: grass/trunk/lib/vector/Vlib/open_pg.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open_pg.c	2015-12-08 23:37:07 UTC (rev 67039)
+++ grass/trunk/lib/vector/Vlib/open_pg.c	2015-12-08 23:54:17 UTC (rev 67040)
@@ -290,7 +290,7 @@
     pg_info->cache.fid = -1;
 
     /* unknown feature type */
-    pg_info->feature_type = SF_UNKNOWN;
+    pg_info->feature_type = SF_GEOMETRY;
 
     PQclear(res);
 
@@ -425,7 +425,7 @@
     else if (G_strcasecmp(type, "GEOMETRYCOLLECTION") == 0)
         return SF_GEOMETRYCOLLECTION;
     else
-        return SF_UNKNOWN;
+        return SF_GEOMETRY;
     
     G_debug(3, "ftype_from_string(): type='%s' -> %d", type, sf_type);
     

Modified: grass/trunk/lib/vector/Vlib/read_pg.c
===================================================================
--- grass/trunk/lib/vector/Vlib/read_pg.c	2015-12-08 23:37:07 UTC (rev 67039)
+++ grass/trunk/lib/vector/Vlib/read_pg.c	2015-12-08 23:54:17 UTC (rev 67040)
@@ -478,7 +478,7 @@
                 return (int)sf_type;
             }
 
-            if (sf_type == SF_UNKNOWN || sf_type == SF_NONE) {
+            if (sf_type == SF_GEOMETRY || sf_type == SF_NONE) {
                 G_warning(_("Feature without geometry. Skipped."));
                 pg_info->cache.lines_next = pg_info->cache.lines_num = 0;
                 continue;
@@ -752,7 +752,7 @@
    \param[out] fparts used for building pseudo-topology (or NULL)
 
    \return simple feature type
-   \return SF_UNKNOWN on error
+   \return SF_GEOMETRY on error
  */
 SF_FeatureType Vect__cache_feature_pg(const char *data, int skip_polygon,
                                       int force_type,
@@ -785,7 +785,7 @@
         if (nbytes > 0) {
             G_debug(3, "Vect__cache_feature_pg(): invalid geometry");
             G_warning(_("Invalid WKB content: %d bytes"), nbytes);
-            return SF_UNKNOWN;
+            return SF_GEOMETRY;
         }
         else {
             G_debug(3, "Vect__cache_feature_pg(): no geometry");
@@ -803,7 +803,7 @@
         G_warning(_("Reading EWKB with 4-dimensional coordinates (XYZM) "
                     "is not supported"));
         /* G_free(wkb_data); */
-        return SF_UNKNOWN;
+        return SF_GEOMETRY;
     }
 
     /* PostGIS EWKB format includes an  SRID, but this won't be       
@@ -823,7 +823,7 @@
 
     if (nbytes < 9 && nbytes != -1) {
         /* G_free(wkb_data); */
-        return SF_UNKNOWN;
+        return SF_GEOMETRY;
     }
 
     /* Get the geometry feature type. For now we assume that geometry
@@ -891,7 +891,7 @@
 
     /* G_free(wkb_data); */
 
-    return ret > 0 ? ftype : SF_UNKNOWN;
+    return ret > 0 ? ftype : SF_GEOMETRY;
 }
 
 /*!

Modified: grass/trunk/lib/vector/Vlib/write_pg.c
===================================================================
--- grass/trunk/lib/vector/Vlib/write_pg.c	2015-12-08 23:37:07 UTC (rev 67039)
+++ grass/trunk/lib/vector/Vlib/write_pg.c	2015-12-08 23:54:17 UTC (rev 67040)
@@ -104,7 +104,7 @@
 
     pg_info = &(Map->fInfo.pg);
     
-    if (pg_info->feature_type == SF_UNKNOWN) {
+    if (pg_info->feature_type == SF_GEOMETRY) {
         /* create PostGIS table if doesn't exist */
         if (create_pg_layer(Map, type) < 0)
             return -1;
@@ -730,7 +730,7 @@
     case (SF_POLYGON25D):
         geom_type = "POLYGONZ";
         break;
-    case (SF_UNKNOWN):
+    case (SF_GEOMETRY):
         geom_type = "GEOMETRY";
         break;
     default:
@@ -1098,7 +1098,7 @@
         pg_info->feature_type = SF_POLYGON25D;
         break;
     case -2:
-        pg_info->feature_type = SF_UNKNOWN;
+        pg_info->feature_type = SF_GEOMETRY;
         break;
     default: 
         G_warning(_("Unsupported geometry type (%d)"), type);
@@ -1169,7 +1169,7 @@
         return "LINE";
     else if (sftype == SF_POLYGON)
         return "POLYGON";
-    else if (sftype == SF_UNKNOWN || sftype == SF_GEOMETRYCOLLECTION)
+    else if (sftype == SF_GEOMETRY || sftype == SF_GEOMETRYCOLLECTION)
         return "COLLECTION";
     else
         G_warning(_("Unsupported feature type %d"), sftype);
@@ -1218,7 +1218,7 @@
     }
 
     /* create PostGIS table if doesn't exist */
-    if (pg_info->feature_type == SF_UNKNOWN) {
+    if (pg_info->feature_type == SF_GEOMETRY) {
         if (create_pg_layer(Map, type) < 0)
             return -1;
     }
@@ -1374,7 +1374,7 @@
     }
     
     /* create PostGIS table if doesn't exist */
-    if (pg_info->feature_type == SF_UNKNOWN) {
+    if (pg_info->feature_type == SF_GEOMETRY) {
         if (create_pg_layer(Map, type) < 0)
             return -1;
     }



More information about the grass-commit mailing list