[GRASS-dev] [GRASS GIS] #3689: v.rast.stats: add where option

GRASS GIS trac at osgeo.org
Mon Nov 12 12:32:33 PST 2018


#3689: v.rast.stats: add where option
--------------------------+--------------------------
  Reporter:  veroandreo   |      Owner:  grass-dev@…
      Type:  enhancement  |     Status:  new
  Priority:  normal       |  Milestone:  7.8.0
 Component:  Vector       |    Version:  svn-trunk
Resolution:               |   Keywords:  v.rast.stats
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+--------------------------

Comment (by mmetz):

 Replying to [comment:5 veroandreo]:
 > I tested... it does not work. It keeps extracting only where="NAME ==
 'Raleigh'" even if I remove the column and do not set any where... I added
 this:
 >
 > {{{
 > if where == "" or where == " " or where == "\n":
 >               where = None
 > }}}
 >
 > but it does not work... There seems to be something I need to
 clean/remove from previous run, but do not know where nor how. Would you
 help me, please?

 See attached patch.

 Test commands for the NC sample dataset:

 {{{
 g.region rast=elev_state_500m
 g.copy vect=railroads,myrailroads

 v.rast.stats map=myrailroads raster=elev_state_500m column_prefix=ele
 method=average -d where="cat = 8802"
 v.db.select map=myrailroads

 v.db.update map=myrailroads col=ele_average val=NULL
 v.rast.stats map=myrailroads raster=elev_state_500m column_prefix=ele
 method=average -d
 v.db.select map=myrailroads

 v.db.update map=myrailroads col=ele_average val=NULL
 v.rast.stats map=myrailroads raster=elev_state_500m column_prefix=ele
 method=average
 v.db.select map=myrailroads

 v.db.update map=myrailroads col=ele_average val=NULL
 v.rast.stats map=myrailroads raster=elev_state_500m column_prefix=ele
 method=average -d where="cat = 8802"
 v.db.select map=myrailroads
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/3689#comment:6>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list