[GRASS-SVN] r40378 - grass/trunk/db/drivers/ogr

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 12 03:19:06 EST 2010


Author: neteler
Date: 2010-01-12 03:19:05 -0500 (Tue, 12 Jan 2010)
New Revision: 40378

Modified:
   grass/trunk/db/drivers/ogr/describe.c
   grass/trunk/db/drivers/ogr/fetch.c
Log:
activate OFTDate, OFTTime, OFTDateTime (treat as strings as in DBF driver)

Modified: grass/trunk/db/drivers/ogr/describe.c
===================================================================
--- grass/trunk/db/drivers/ogr/describe.c	2010-01-12 08:17:34 UTC (rev 40377)
+++ grass/trunk/db/drivers/ogr/describe.c	2010-01-12 08:19:05 UTC (rev 40378)
@@ -111,7 +111,8 @@
 	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 @@
 	    break;
 
 	case OFTString:
+	case OFTDate:
+	case OFTTime:
+	case OFTDateTime:
 	    sqlType = DB_SQL_TYPE_CHARACTER;
 	    size = OGR_Fld_GetWidth(hFieldDefn);
 	    if (size == 0) {

Modified: grass/trunk/db/drivers/ogr/fetch.c
===================================================================
--- grass/trunk/db/drivers/ogr/fetch.c	2010-01-12 08:17:34 UTC (rev 40377)
+++ grass/trunk/db/drivers/ogr/fetch.c	2010-01-12 08:19:05 UTC (rev 40378)
@@ -152,6 +152,9 @@
 	    break;
 
 	case OFTString:
+	case OFTDate:
+	case OFTTime:
+	case OFTDateTime:
 	    db_set_string(&(value->s),
 			  (char *)OGR_F_GetFieldAsString(c->hFeature, i));
 	    break;



More information about the grass-commit mailing list