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

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

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

GRASS GIS
#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
 Keywords:  v.rast.stats  |        CPU:  Unspecified
 Platform:  Unspecified   |
--------------------------+-------------------------
 Would you agree to add `where` option in G7:v.rast.stats? I find it useful
 in some occasions where user is interested in querying only some features
 meeting a certain category. I attach the diff

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


_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

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

GRASS GIS
#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
--------------------------+--------------------------
Changes (by veroandreo):

 * Attachment "v_rast_stats_add_where.diff" added.

 add where option in v.rast.stats

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


_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

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

GRASS GIS
In reply to this post by GRASS GIS
#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 [ticket:3689 veroandreo]:
 > Would you agree to add `where` option in G7:v.rast.stats? I find it
 useful in some occasions where user is interested in querying only some
 features meeting a certain category. I attach the diff

 A `where` option would make sense. You need to add this `where` option to
 the call to G7:v.to.rast in G7:v.rast.stats.

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


_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

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

GRASS GIS
In reply to this post by GRASS GIS
#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 veroandreo):

 Replying to [comment:1 mmetz]:
 > Replying to [ticket:3689 veroandreo]:
 > > Would you agree to add `where` option in G7:v.rast.stats? I find it
 useful in some occasions where user is interested in querying only some
 features meeting a certain category. I attach the diff
 >
 > A `where` option would make sense. You need to add this `where` option
 to the call to G7:v.to.rast in G7:v.rast.stats.

 Right! See new patch attached. I tested with:

 {{{
 v.rast.stats map=urbanarea@PERMANENT where="NAME == 'Raleigh'"
 raster=aspect@PERMANENT column_prefix=aspect method=number
 }}}

 and got expected results and no errors :)

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


_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

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

GRASS GIS
In reply to this post by GRASS GIS
#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
--------------------------+--------------------------
Changes (by veroandreo):

 * Attachment "v_rast_stats_add_where.diff" added.

 new patch adding where option in v.rast.stats

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


_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

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

GRASS GIS
In reply to this post by GRASS GIS
#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 veroandreo):

 MarkusM, do you think I can commit it now?

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


_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

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

GRASS GIS
In reply to this post by GRASS GIS
#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:3 veroandreo]:
 > MarkusM, do you think I can commit it now?

 Have you tested your patch also if the new where option is not given? If
 this succeeds you can commit.

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


_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

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

GRASS GIS
In reply to this post by GRASS GIS
#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 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?

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


_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

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

GRASS GIS
In reply to this post by GRASS GIS
#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>


_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

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

GRASS GIS
In reply to this post by GRASS GIS
#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
--------------------------+--------------------------
Changes (by mmetz):

 * Attachment "v_rast_stats_add_where_2.diff" added.

 patch to add where option o v.rast.stats, working with and without where
 option used

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


_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

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

GRASS GIS
In reply to this post by GRASS GIS
#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 veroandreo):

 Thanks so much, MarkusM! Committed in r73666. Milestone was set to 7.8,
 but is it worth a backport to next 7.6 release?

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


_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

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

GRASS GIS
In reply to this post by GRASS GIS
#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:7 veroandreo]:
 > Thanks so much, MarkusM! Committed in r73666. Milestone was set to 7.8,
 but is it worth a backport to next 7.6 release?

 I think it's ok if you backport to 7.6

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


_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

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

GRASS GIS
In reply to this post by GRASS GIS
#3689: v.rast.stats: add where option
--------------------------+--------------------------
  Reporter:  veroandreo   |      Owner:  grass-dev@…
      Type:  enhancement  |     Status:  closed
  Priority:  normal       |  Milestone:  7.6.0
 Component:  Vector       |    Version:  svn-trunk
Resolution:  fixed        |   Keywords:  v.rast.stats
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+--------------------------
Changes (by veroandreo):

 * status:  new => closed
 * resolution:   => fixed
 * milestone:  7.8.0 => 7.6.0


Comment:

 Milestone changed to 76 and change backported. Closing.

 Thanks again, markusM :)

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


_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev