瀏覽代碼

v.in.ogr: Support int64 for key column too, see https://trac.osgeo.org/grass/ticket/2769
(merge https://trac.osgeo.org/grass/changeset/66726, https://trac.osgeo.org/grass/changeset/66729 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@67742 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 9 年之前
父節點
當前提交
8a42818d56
共有 1 個文件被更改,包括 11 次插入2 次删除
  1. 11 2
      vector/v.in.ogr/main.c

+ 11 - 2
vector/v.in.ogr/main.c

@@ -1000,8 +1000,13 @@ int main(int argc, char *argv[])
                 /* check if the field is integer */
                 Ogr_field = OGR_FD_GetFieldDefn(Ogr_featuredefn, key_idx);
                 Ogr_ftype = OGR_Fld_GetType(Ogr_field);
-                if (Ogr_ftype != OFTInteger)
+                if (!(Ogr_ftype == OFTInteger
+#if GDAL_VERSION_NUM >= 2000000
+                      || Ogr_ftype == OFTInteger64
+#endif
+		      )) {
                     G_fatal_error(_("Key column '%s' is not integer"), param.key->answer);
+                }
                 key_column = G_store(OGR_Fld_GetNameRef(Ogr_field));
             }
         }
@@ -1248,7 +1253,11 @@ int main(int argc, char *argv[])
 		    }
 		    else {
 			/* G_warning (_("Column value not set" )); */
-			if (Ogr_ftype == OFTInteger || Ogr_ftype == OFTReal) {
+			if (Ogr_ftype == OFTInteger ||
+#if GDAL_VERSION_NUM >= 2000000
+                            Ogr_ftype == OFTInteger64 ||
+#endif
+                            Ogr_ftype == OFTReal) {
 			    sprintf(buf, ", NULL");
 			}
 #if GDAL_VERSION_NUM >= 1320