[GRASS-SVN] r57539 - in grass/trunk: lib/vector/Vlib vector/v.in.ogr

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Aug 29 04:19:46 PDT 2013


Author: martinl
Date: 2013-08-29 04:19:45 -0700 (Thu, 29 Aug 2013)
New Revision: 57539

Modified:
   grass/trunk/lib/vector/Vlib/build_sfa.c
   grass/trunk/vector/v.in.ogr/main.c
Log:
vlib/ogr: empty geometry message cosmetics

Modified: grass/trunk/lib/vector/Vlib/build_sfa.c
===================================================================
--- grass/trunk/lib/vector/Vlib/build_sfa.c	2013-08-29 09:48:09 UTC (rev 57538)
+++ grass/trunk/lib/vector/Vlib/build_sfa.c	2013-08-29 11:19:45 UTC (rev 57539)
@@ -609,7 +609,7 @@
 
 void build_ogr(struct Map_info *Map, int build)
 {
-    int iFeature, FID, npoints;
+    int iFeature, FID, npoints, nskipped;
     
     struct Format_info_ogr *ogr_info;
     
@@ -625,7 +625,7 @@
 
     /* Note: Do not use OGR_L_GetFeatureCount (it may scan all features) */
     OGR_L_ResetReading(ogr_info->layer);
-    npoints = iFeature = 0;
+    npoints = iFeature = nskipped = 0;
     G_message(_("Registering primitives..."));
     while ((hFeature = OGR_L_GetNextFeature(ogr_info->layer)) != NULL) {
 	G_debug(3, "   Feature %d", iFeature);
@@ -634,15 +634,17 @@
 	
 	hGeom = OGR_F_GetGeometryRef(hFeature);
 	if (hGeom == NULL) {
-	    G_warning(_("Feature %d without geometry skipped"), iFeature);
+	    G_debug(3, "Feature %d without geometry skipped", iFeature);
 	    OGR_F_Destroy(hFeature);
+            nskipped++;
 	    continue;
 	}
 	
 	FID = (int) OGR_F_GetFID(hFeature);
 	if (FID == OGRNullFID) {
-	    G_warning(_("OGR feature %d without ID skipped"), iFeature);
+	    G_debug(3, "OGR feature %d without ID skipped", iFeature);
 	    OGR_F_Destroy(hFeature);
+            nskipped++;
 	    continue;
 	}
 	G_debug(4, "    FID = %d", FID);
@@ -659,6 +661,10 @@
     G_message(_("%d primitives registered"), Map->plus.n_lines);
     G_message(_("%d vertices registered"), npoints);
     
+    if (nskipped > 0)
+        G_warning(_("%d %s without geometry skipped"), nskipped,
+                  nskipped == 1 ? "feature" : "features");
+        
     Map->plus.built = GV_BUILD_BASE;
     
     free_parts(&parts);

Modified: grass/trunk/vector/v.in.ogr/main.c
===================================================================
--- grass/trunk/vector/v.in.ogr/main.c	2013-08-29 09:48:09 UTC (rev 57538)
+++ grass/trunk/vector/v.in.ogr/main.c	2013-08-29 11:19:45 UTC (rev 57539)
@@ -1098,7 +1098,7 @@
 	}
 
 	if (nogeom > 0)
-	    G_warning(_("%d %s without geometry"), nogeom,
+	    G_warning(_("%d %s without geometry skipped"), nogeom,
 		      nogeom == 1 ? "feature" : "features");
     }
 



More information about the grass-commit mailing list