ソースを参照

activate OFTDate, OFTTime, OFTDateTime (treat as strings as in DBF driver)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@40378 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 15 年 前
コミット
e07b5711fd
2 ファイル変更8 行追加1 行削除
  1. 5 1
      db/drivers/ogr/describe.c
  2. 3 0
      db/drivers/ogr/fetch.c

+ 5 - 1
db/drivers/ogr/describe.c

@@ -111,7 +111,8 @@ int describe_table(OGRLayerH hLayer, dbTable **table, cursor *c)
 	fieldName = OGR_Fld_GetNameRef(hFieldDefn);
 
 	if (ogrType != OFTInteger && ogrType != OFTReal &&
-	    ogrType != OFTString) {
+	    ogrType != OFTString  && ogrType != OFTDate &&
+	    ogrType != OFTTime    && ogrType != OFTDateTime ) {
 	    G_warning(_("OGR driver: column '%s', OGR type %d is not supported"),
 		      fieldName, ogrType);
 	    cols[i] = 0;
@@ -186,6 +187,9 @@ int describe_table(OGRLayerH hLayer, dbTable **table, cursor *c)
 	    break;
 
 	case OFTString:
+	case OFTDate:
+	case OFTTime:
+	case OFTDateTime:
 	    sqlType = DB_SQL_TYPE_CHARACTER;
 	    size = OGR_Fld_GetWidth(hFieldDefn);
 	    if (size == 0) {

+ 3 - 0
db/drivers/ogr/fetch.c

@@ -152,6 +152,9 @@ int db__driver_fetch(dbCursor * cn, int position, int *more)
 	    break;
 
 	case OFTString:
+	case OFTDate:
+	case OFTTime:
+	case OFTDateTime:
 	    db_set_string(&(value->s),
 			  (char *)OGR_F_GetFieldAsString(c->hFeature, i));
 	    break;