Browse Source

rename SF_UNKNOWN to SF_GEOMETRY (SF_UNKNOWN defined in oaidl.h on Windows)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67040 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 9 years ago
parent
commit
f3de00f4b1

+ 1 - 1
include/vect/dig_defines.h

@@ -233,7 +233,7 @@ typedef enum overlay_operator OVERLAY_OPERATOR;
 */
 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 */

+ 1 - 1
lib/vector/Vlib/build_pg.c

@@ -71,7 +71,7 @@ int Vect_build_pg(struct Map_info *Map, int build)
         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)

+ 2 - 2
lib/vector/Vlib/open_pg.c

@@ -290,7 +290,7 @@ int V1_open_new_pg(struct Map_info *Map, const char *name, int with_z)
     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 @@ SF_FeatureType ftype_from_string(const char *type)
     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);
     

+ 6 - 6
lib/vector/Vlib/read_pg.c

@@ -478,7 +478,7 @@ int read_next_line_pg(struct Map_info *Map,
                 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 @@ unsigned char *hex_to_wkb(const char *hex_data, int *nbytes)
    \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 @@ SF_FeatureType Vect__cache_feature_pg(const char *data, int skip_polygon,
         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 @@ SF_FeatureType Vect__cache_feature_pg(const char *data, int skip_polygon,
         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 @@ SF_FeatureType Vect__cache_feature_pg(const char *data, int skip_polygon,
 
     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 @@ SF_FeatureType Vect__cache_feature_pg(const char *data, int skip_polygon,
 
     /* G_free(wkb_data); */
 
-    return ret > 0 ? ftype : SF_UNKNOWN;
+    return ret > 0 ? ftype : SF_GEOMETRY;
 }
 
 /*!

+ 6 - 6
lib/vector/Vlib/write_pg.c

@@ -104,7 +104,7 @@ off_t V1_write_line_pg(struct Map_info *Map, int type,
 
     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 @@ int create_table(struct Format_info_pg *pg_info)
     case (SF_POLYGON25D):
         geom_type = "POLYGONZ";
         break;
-    case (SF_UNKNOWN):
+    case (SF_GEOMETRY):
         geom_type = "GEOMETRY";
         break;
     default:
@@ -1098,7 +1098,7 @@ int create_pg_layer(struct Map_info *Map, int type)
         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 @@ char *get_sftype(SF_FeatureType sftype)
         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 @@ off_t write_line_sf(struct Map_info *Map, int type,
     }
 
     /* 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 @@ off_t write_line_tp(struct Map_info *Map, int type, int is_node,
     }
     
     /* 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;
     }