[GRASS-SVN] r70280 - grass/trunk/db/drivers/ogr
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jan 6 09:41:22 PST 2017
Author: martinl
Date: 2017-01-06 09:41:21 -0800 (Fri, 06 Jan 2017)
New Revision: 70280
Modified:
grass/trunk/db/drivers/ogr/describe.c
Log:
fix r70259 for GDAL 1.x
Modified: grass/trunk/db/drivers/ogr/describe.c
===================================================================
--- grass/trunk/db/drivers/ogr/describe.c 2017-01-06 17:35:44 UTC (rev 70279)
+++ grass/trunk/db/drivers/ogr/describe.c 2017-01-06 17:41:21 UTC (rev 70280)
@@ -106,7 +106,11 @@
ogrType = OGR_Fld_GetType(hFieldDefn);
fieldName = OGR_Fld_GetNameRef(hFieldDefn);
- if (ogrType != OFTInteger && ogrType != OFTInteger64 && ogrType != OFTReal &&
+ if (ogrType != OFTInteger &&
+#if GDAL_VERSION_NUM >= 2000000
+ ogrType != OFTInteger64 &&
+#endif
+ ogrType != OFTReal &&
ogrType != OFTString && ogrType != OFTDate &&
ogrType != OFTTime && ogrType != OFTDateTime ) {
G_warning(_("OGR driver: column '%s', OGR type %d is not supported"),
@@ -171,13 +175,17 @@
switch (ogrType) {
case OFTInteger:
+#if GDAL_VERSION_NUM >= 2000000
case OFTInteger64:
+#endif
sqlType = DB_SQL_TYPE_INTEGER;
size = OGR_Fld_GetWidth(hFieldDefn); /* OK ? */
precision = 0;
+#if GDAL_VERSION_NUM >= 2000000
if (ogrType == OFTInteger64)
G_warning(_("Column '%s' : type int8 (bigint) is stored as integer (4 bytes) "
"some data may be damaged"), fieldName);
+#endif
break;
case OFTReal:
More information about the grass-commit
mailing list