[GRASS-dev] [GRASS GIS] #2267: t.list doesn't respect search path

#2267: t.list doesn't respect search path
---------------------------------+------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Temporal | Version: svn-trunk
Keywords: t.list, search path | Platform: Unspecified
      Cpu: Unspecified |
---------------------------------+------------------------------------------
{{{
g.mapset -p
modis2002lst_yfsg
}}}

{{{
t.list

modis@landamar
modis@modis2002lst_yfsg
modis_m@modis2002lst_yfsg
}}}

When launching `g.gui.animation` it takes `modis@landamar` and not the
dataset from the current mapset.

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

#2267: t.list doesn't respect search path
---------------------------------+------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Temporal | Version: svn-trunk
Keywords: t.list, search path | Platform: Unspecified
      Cpu: Unspecified |
---------------------------------+------------------------------------------

Comment(by annakrat):

In animation tool, when you don't provide the name without mapset, I try
to guess the mapset and the first would be the `modis@landamar`. So I am
not sure if this
[http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/animation/utils.py#L58
function] is wrong or if the output of t.list is wrong. t.list just gives
back the result of a SELECT in a database ordered alphabetically. Should
t.list return the results based on the search path if user doesn't specify
order? Or we perhaps need a function in the temporal API which would
behave like g.findfile? How is this solved in the temporal modules?

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

#2267: t.list doesn't respect search path
---------------------------------+------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Temporal | Version: svn-trunk
Keywords: t.list, search path | Platform: Unspecified
      Cpu: Unspecified |
---------------------------------+------------------------------------------

Comment(by martinl):

Replying to [comment:1 annakrat]:
> In animation tool, when you don't provide the name without mapset, I try
to guess the mapset and the first would be the `modis@landamar`. So I am
not sure if this

BTW, `g.gui.timeline` shows a dialog where the user can choose which
dataset he/she wants to use.

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

#2267: t.list doesn't respect search path
---------------------------------+------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Temporal | Version: svn-trunk
Keywords: t.list, search path | Platform: Unspecified
      Cpu: Unspecified |
---------------------------------+------------------------------------------

Comment(by huhabla):

I need to implement a TGRASS API function that takes the user accessible
mapsets into account and sorts them as g.list does. Hence emulating the
mapset access right management. This function will then be used in t.list
and can be used in other modules.

I have put this on my TODO list.

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

#2267: t.list doesn't respect search path
---------------------------------+------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Temporal | Version: svn-trunk
Keywords: t.list, search path | Platform: Unspecified
      Cpu: Unspecified |
---------------------------------+------------------------------------------

Comment(by huhabla):

Please try r60018.

I have implemented a new TGIS function (get_dataset_list[1]) that is able
to return a list of space time datasets or time stamped maps sensitive to
the users mapset access permissions. It uses the GRASS C-library functions
G_available_mapsets() via the TGIS RPC interface.

This function can be used in g.gui.timeline as well.

[1]
https://trac.osgeo.org/grass/browser/grass/trunk/lib/python/temporal/list_stds.py#L31

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

#2267: t.list doesn't respect search path
---------------------------------+------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Temporal | Version: svn-trunk
Keywords: t.list, search path | Platform: Unspecified
      Cpu: Unspecified |
---------------------------------+------------------------------------------

Comment(by martinl):

Replying to [comment:4 huhabla]:

> I have implemented a new TGIS function (get_dataset_list[1]) that is
able to return a list of space time datasets or time stamped maps
sensitive to the users mapset access permissions. It uses the GRASS
C-library functions G_available_mapsets() via the TGIS RPC interface.

great, but the order of mapsets should respect search path, right?

{{{
g.mapset -p
modis2002lst_yfsg

Space time raster datasets with absolute time available in mapset
<landamar>:
modis@landamar
Space time raster datasets with absolute time available in mapset
<modis2002lst_yfsg>:
modis@modis2002lst_yfsg
modis_autumn@modis2002lst_yfsg
modis_m@modis2002lst_yfsg
modis_spring@modis2002lst_yfsg
modis_summer@modis2002lst_yfsg
modis_winter@modis2002lst_yfsg
s@modis2002lst_yfsg
}}}

The current mapset is listed as the second in this case.

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

#2267: t.list doesn't respect search path
---------------------------------+------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Temporal | Version: svn-trunk
Keywords: t.list, search path | Platform: Unspecified
      Cpu: Unspecified |
---------------------------------+------------------------------------------

Comment(by huhabla):

Ooops ... please try r60026.

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

#2267: t.list doesn't respect search path
--------------------------+-------------------------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Temporal | Version: svn-trunk
Resolution: fixed | Keywords: t.list, search path
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by martinl):

  * status: new => closed
  * resolution: => fixed

Comment:

Replying to [comment:6 huhabla]:
> Ooops ... please try r60026.

perfect, now it's OK, thanks. See related tickets #2273 a #2274. Closing
this one.

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

#2267: t.list doesn't respect search path
--------------------------+-------------------------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Temporal | Version: svn-trunk
Resolution: fixed | Keywords: t.list, search path
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------

Comment(by martinl):

Replying to [comment:7 martinl]:
> Replying to [comment:6 huhabla]:
> > Ooops ... please try r60026.
>
> perfect, now it's OK, thanks. See related tickets #2273 a #2274. Closing
this one.

forget about #2274, #2275 was correct.

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

#2267: t.list doesn't respect search path
--------------------------+-------------------------------------------------
  Reporter: martinl | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Temporal | Version: svn-trunk
Resolution: fixed | Keywords: t.list, search path
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------

Comment(by annakrat):

I got confused from all the different functions for listing datasets.
There are currently also
[http://trac.osgeo.org/grass/browser/grass/trunk/lib/python/temporal/gui_support.py#L21
tgis.tlist_grouped] and
[http://trac.osgeo.org/grass/browser/grass/trunk/lib/python/temporal/gui_support.py#L81
tgis.tlist]. These don't respect search path.

Function `get_dataset_list` does not give you the right order of mapsets
because it returns unordered dictionary. Perhaps ordered dict (I think
it's in pygrass) or some tuples would be better? This function could also
give you the option not to respect the search path (maybe useful for data
catalog). `tgis.tlist` could then be a higher level wrapper, call
`get_dataset_list` and return the dataset names instead of sql rows. I
would then use it in g.gui.animation/timeline. `tgis.tlist_grouped` would
then call `tgis.tlist` and group names by mapsets which is used in the
selection widget. Does it sound too complicated?

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