Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#2267 closed defect (fixed)

t.list doesn't respect search path

Reported by: martinl Owned by: grass-dev@…
Priority: normal Milestone: 7.0.0
Component: Temporal Version: svn-trunk
Keywords: t.list, search path Cc:
CPU: Unspecified Platform: Unspecified

Description

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.

Change History (9)

comment:1 Changed 4 years ago 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 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?

comment:2 in reply to:  1 Changed 4 years ago by martinl

Replying to 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.

comment:3 Changed 4 years ago 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.

comment:4 Changed 4 years ago 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

comment:5 in reply to:  4 Changed 4 years ago by martinl

Replying to 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.

comment:6 Changed 4 years ago by huhabla

Ooops ... please try r60026.

comment:7 in reply to:  6 ; Changed 4 years ago by martinl

Resolution: fixed
Status: newclosed

Replying to huhabla:

Ooops ... please try r60026.

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

comment:8 in reply to:  7 Changed 4 years ago by martinl

Replying to martinl:

Replying to 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.

comment:9 Changed 4 years ago by annakrat

I got confused from all the different functions for listing datasets. There are currently also tgis.tlist_grouped and 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?

Note: See TracTickets for help on using tickets.