[GRASS-SVN] r73473 - grass-addons/grass7/vector/v.stream.inbasin
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Oct 1 14:53:49 PDT 2018
Author: awickert
Date: 2018-10-01 14:53:48 -0700 (Mon, 01 Oct 2018)
New Revision: 73473
Modified:
grass-addons/grass7/vector/v.stream.inbasin/v.stream.inbasin.py
Log:
v.stream.inbasin: SQL cat IN (LIST,)
before I used too many "OR" statements, was the wrong way
Modified: grass-addons/grass7/vector/v.stream.inbasin/v.stream.inbasin.py
===================================================================
--- grass-addons/grass7/vector/v.stream.inbasin/v.stream.inbasin.py 2018-10-01 02:53:30 UTC (rev 73472)
+++ grass-addons/grass7/vector/v.stream.inbasin/v.stream.inbasin.py 2018-10-01 21:53:48 UTC (rev 73473)
@@ -187,7 +187,8 @@
# Many basins out -- need to use overwrite flag in future!
#SQL_OR = 'rnum = ' + ' OR rnum = '.join(map(str, basincats))
- SQL_OR = 'cat = ' + ' OR cat = '.join(map(str, basincats))
+ #SQL_OR = 'cat = ' + ' OR cat = '.join(map(str, basincats))
+ SQL_LIST = 'cat IN (' + ', '.join(map(str, basincats)) + ')'
if len(basins) > 0:
v.extract(input=basins, output=output_basins, where=SQL_OR, overwrite=gscript.overwrite(), quiet=True)
if len(streams) > 0:
More information about the grass-commit
mailing list