[GRASS-dev] [GRASS GIS] #2219: wish: all modules that create a new map should put the module call into history

#2219: wish: all modules that create a new map should put the module call into
history
---------------------------------+------------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: history module call | Platform: Unspecified
      Cpu: Unspecified |
---------------------------------+------------------------------------------
Most raster modules do this already, but many vector modules don't, but I
think it would be very helpful if all newly created map could contain the
module call that created it in its history/support file.

Is this something that needs to be done module by module, or is there a
possibility to +/- automate this ?

Moritz

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2219&gt;
GRASS GIS <http://grass.osgeo.org>

#2219: wish: all modules that create a new map should put the module call into
history
---------------------------------+------------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: history module call | Platform: All
      Cpu: Unspecified |
---------------------------------+------------------------------------------
Changes (by neteler):

  * platform: Unspecified => All
  * component: Default => Vector

Comment:

This is the unfiltered list of vector commands potentially lacking
Vect_hist_command():

{{{
find vector/ -name "main.c" | xargs fgrep --files-without-match Vect_hist
| grep -v v.out
vector/v.convert/main.c
vector/v.label/main.c
vector/v.colors.out/main.c
vector/v.to.rast/main.c
vector/v.colors/main.c
vector/v.vect.stats/main.c
vector/v.what/main.c
vector/v.lrs/v.lrs.where/main.c
vector/v.lrs/v.lrs.label/main.c
vector/v.lrs/v.lrs.create/main.c
vector/v.lrs/v.lrs.segment/main.c
vector/v.external.out/main.c
vector/v.db.select/main.c
vector/v.net.visibility/main.c
vector/v.to.db/main.c
vector/v.univar/main.c
vector/v.kcv/main.c
vector/v.label.sa/main.c
vector/v.normal/main.c
vector/v.surf.idw/main.c
vector/v.neighbors/main.c
vector/v.to.rast3/main.c
vector/v.timestamp/main.c
vector/v.class/main.c
vector/v.build/main.c
}}}

For some of them it will not be useful, reducing the remaining modules to
a few.

Which is most important for you?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2219#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#2219: wish: all modules that create a new map should put the module call into
history
---------------------------------+------------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: history module call | Platform: All
      Cpu: Unspecified |
---------------------------------+------------------------------------------

Comment(by mlennert):

Actually, I notice that my understanding was wrong: command history is
often written, but it is not displayed when you use v.info (aka Metadata
in the wxGUI), you have to explicitly as for v.info -h.

This is not the case for most raster modules, where you see the command
history with r.info, without the need for the -h flag.

Any reason for that difference ?

I think that creation command history is important enough to be part of
the "base" package of information delivered by the r/v.info commands.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2219#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#2219: wish: all modules that create a new map should put the module call into
history
---------------------------------+------------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: history module call | Platform: All
      Cpu: Unspecified |
---------------------------------+------------------------------------------

Comment(by mlennert):

Replying to [comment:1 neteler]:
> This is the unfiltered list of vector commands potentially lacking
Vect_hist_command():
> Which is most important for you?

I would say all that create information for which it is important to
remember how it was created. So, in a quick scan of the list:

{{{
> vector/v.to.rast/main.c
> vector/v.vect.stats/main.c
> vector/v.lrs/v.lrs.label/main.c
> vector/v.lrs/v.lrs.create/main.c
> vector/v.lrs/v.lrs.segment/main.c
> vector/v.net.visibility/main.c
> vector/v.kcv/main.c
> vector/v.surf.idw/main.c
> vector/v.neighbors/main.c
> vector/v.to.rast3/main.c
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2219#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#2219: wish: all modules that create a new map should put the module call into
history
---------------------------------+------------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: history module call | Platform: All
      Cpu: Unspecified |
---------------------------------+------------------------------------------

Comment(by neteler):

Replying to [comment:3 mlennert]:
  * vector/v.to.rast/main.c
    * already there: Rast_command_history()
  * vector/v.vect.stats/main.c
    * not generating a map
  * vector/v.lrs/v.lrs.label/main.c
    * done in r59251
  * vector/v.lrs/v.lrs.create/main.c
    * done in r59252
  * vector/v.lrs/v.lrs.segment/main.c
    * done in r59253
  * vector/v.net.visibility/main.c
    * done in r59247; additionally r59248
  * vector/v.kcv/main.c
    * not generating a map

TODO: Here is would be nice to "inject" the vector cmd history into the
raster history function (no idea how?) in order to write it out for the
raster output:
  * vector/v.surf.idw/main.c
  * vector/v.neighbors/main.c
  * vector/v.to.rast3/main.c

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2219#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#2219: wish: all modules that create a new map should put the module call into
history
---------------------------------+------------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: history module call | Platform: All
      Cpu: Unspecified |
---------------------------------+------------------------------------------

Comment(by mlennert):

Replying to [comment:4 neteler]:
> Replying to [comment:3 mlennert]:
> * vector/v.vect.stats/main.c
> * not generating a map

No, but having the command history to see which command call was used to
fill the attribute column could be useful...

> * vector/v.lrs/v.lrs.label/main.c
> * done in r59251
> * vector/v.lrs/v.lrs.create/main.c
> * done in r59252
> * vector/v.lrs/v.lrs.segment/main.c
> * done in r59253
> * vector/v.net.visibility/main.c
> * done in r59247; additionally r59248

Thanks !

> * vector/v.kcv/main.c
> * not generating a map

Agreed that it's not really useful here.

> TODO: Here is would be nice to "inject" the vector cmd history into the
> raster history function (no idea how?) in order to write it out for the
> raster output:
> * vector/v.surf.idw/main.c
> * vector/v.neighbors/main.c
> * vector/v.to.rast3/main.c

This should be the same as v.to.rast, no ?

How about the other way around: raster->vector modules ?

But again, my main issue is actually that to see that history you have to
use the -h flag for vectors, but not for rasters...

Moritz

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2219#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>