瀏覽代碼

v.out.ogr

"Failed to create OGR feature": G_warning -> G_fatal_error

v.out.ogr should not finish successfully if exporting a feature failed because the output will not contain all the features it should contain
Markus Metz 5 年之前
父節點
當前提交
535ac07662
共有 2 個文件被更改,包括 6 次插入6 次删除
  1. 3 3
      vector/v.out.ogr/export_areas.c
  2. 3 3
      vector/v.out.ogr/export_lines.c

+ 3 - 3
vector/v.out.ogr/export_areas.c

@@ -123,7 +123,7 @@ int export_areas_single(struct Map_info *In, int field, int donocat,
             mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat,
             mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat,
                    Ogr_feature, n_noatt);
                    Ogr_feature, n_noatt);
             if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) {
             if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) {
-		G_warning(_("Failed to create OGR feature"));
+		G_fatal_error(_("Failed to create OGR feature"));
 	    }
 	    }
 	    else
 	    else
 		n_exported++;
 		n_exported++;
@@ -224,7 +224,7 @@ int export_areas_multi(struct Map_info *In, int field, int donocat,
             mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat,
             mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat,
                    Ogr_feature, n_noatt);
                    Ogr_feature, n_noatt);
             if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) {
             if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) {
-		G_warning(_("Failed to create OGR feature"));
+		G_fatal_error(_("Failed to create OGR feature"));
 	    }
 	    }
 	    else
 	    else
 		n_exported++;
 		n_exported++;
@@ -275,7 +275,7 @@ int export_areas_multi(struct Map_info *In, int field, int donocat,
         mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat,
         mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat,
                Ogr_feature, n_noatt);
                Ogr_feature, n_noatt);
 	if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) {
 	if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) {
-	    G_warning(_("Failed to create OGR feature"));
+	    G_fatal_error(_("Failed to create OGR feature"));
 	}
 	}
 	else
 	else
 	    n_exported++;
 	    n_exported++;

+ 3 - 3
vector/v.out.ogr/export_lines.c

@@ -132,7 +132,7 @@ int export_lines_single(struct Map_info *In, int field, int otype, int donocat,
             mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat,
             mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat,
                    Ogr_feature, n_noatt);
                    Ogr_feature, n_noatt);
             if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) {
             if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) {
-		G_warning(_("Failed to create OGR feature"));
+		G_fatal_error(_("Failed to create OGR feature"));
 	    }
 	    }
 	    else
 	    else
 		n_exported++;
 		n_exported++;
@@ -228,7 +228,7 @@ int export_lines_multi(struct Map_info *In, int field, int otype, int donocat, i
             mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat,
             mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat,
                    Ogr_feature, n_noatt);
                    Ogr_feature, n_noatt);
             if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) {
             if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) {
-		G_warning(_("Failed to create OGR feature"));
+		G_fatal_error(_("Failed to create OGR feature"));
 	    }
 	    }
 	    else
 	    else
 		n_exported++;
 		n_exported++;
@@ -277,7 +277,7 @@ int export_lines_multi(struct Map_info *In, int field, int otype, int donocat, i
         mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat,
         mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat,
                Ogr_feature, n_noatt);
                Ogr_feature, n_noatt);
 	if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) {
 	if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) {
-	    G_warning(_("Failed to create OGR feature"));
+	    G_fatal_error(_("Failed to create OGR feature"));
 	}
 	}
 	else
 	else
 	    n_exported++;
 	    n_exported++;