[GRASS-SVN] r74026 - grass/trunk/scripts/v.report

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jan 26 10:33:05 PST 2019


Author: hcho
Date: 2019-01-26 10:33:04 -0800 (Sat, 26 Jan 2019)
New Revision: 74026

Modified:
   grass/trunk/scripts/v.report/v.report.py
Log:
v.report: Add -d flag for gemetries with no database recrods

Modified: grass/trunk/scripts/v.report/v.report.py
===================================================================
--- grass/trunk/scripts/v.report/v.report.py	2019-01-26 12:58:47 UTC (rev 74025)
+++ grass/trunk/scripts/v.report/v.report.py	2019-01-26 18:33:04 UTC (rev 74026)
@@ -46,6 +46,10 @@
 #% key: c
 #% description: Do not include column names in output
 #%end
+#%flag
+#% key: d
+#% description: Report for geometries with no database records
+#%end
 
 import sys
 import os
@@ -154,8 +158,10 @@
             rec = list(filter(lambda r1: r1[catcol] == r2[0], records1))
             if len(rec) > 0:
                 res = rec[0] + r2[1:]
+            elif flags['d']:
+                res = [r2[0]] + [''] * (ncols - 1) + r2[1:]
             else:
-                res = [r2[0]] + [''] * (ncols - 1) + r2[1:]
+                continue
             records3.append(res)
     else:
         catcol = 0



More information about the grass-commit mailing list