Opened 11 years ago

Closed 11 years ago

Last modified 11 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 by annakrat, 11 years ago

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?

in reply to:  1 comment:2 by martinl, 11 years ago

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 by huhabla, 11 years ago

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 by huhabla, 11 years ago

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

in reply to:  4 comment:5 by martinl, 11 years ago

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 by huhabla, 11 years ago

Ooops ... please try r60026.

in reply to:  6 ; comment:7 by martinl, 11 years ago

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.

in reply to:  7 comment:8 by martinl, 11 years ago

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 by annakrat, 11 years ago

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.