[GRASS-dev] [Temporal] Access a temporal dataset from another mapset

Laurent C. lrntct at gmail.com
Mon Aug 8 08:13:35 PDT 2016


Hello Veronica,

Thanks for your answer. Here is my version, under Ubuntu 16.4:

$ g.version -b
GRASS 7.0.4 (2016)
 ./configure  --build=x86_64-linux-gnu --prefix=/usr
'--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
'--infodir=${prefix}/share/info' --sysconfdir=/etc
--localstatedir=/var --disable-silent-rules
'--libdir=${prefix}/lib/x86_64-linux-gnu'
'--libexecdir=${prefix}/lib/x86_64-linux-gnu'
--disable-maintainer-mode --disable-dependency-tracking
--prefix=/usr/lib --enable-largefile --enable-socket --enable-shared
--with-blas --with-cairo --with-cxx --with-freetype
--with-freetype-includes=/usr/include/freetype2 --with-gdal
--with-geos --with-lapack --with-liblas=/usr/bin/liblas-config
--with-motif --with-mysql --with-mysql-includes=/usr/include/mysql
--with-netcdf --with-nls --with-odbc --with-postgres
--with-postgres-includes=/usr/include/postgresql
--with-proj-share=/usr/share/proj --with-python --with-readline
--with-sqlite --with-wxwidgets=/usr/bin/wx-config --with-x

According to g.mapset -l, the mapsets are in the search path. If I
make the mapset current, I can access the STRDS in that mapset, but
not from another mapset. I have one temporal DB for each mapset.
Below are the commands:

$ g.mapset -p
hull
$ g.mapset -l
PERMANENT hull_rain hull
$ t.rast.list radar_rain_5min at hull_rain
ERROR: Unable to execute sql statement. There is no temporal database
connection defined for mapset <hull_rain>
$ g.mapset mapset=hull_rain
$ g.mapset -p
hull_rain
$ t.rast.list radar_rain_5min at hull_rain
name|mapset|start_time|end_time
radar_rain_5min_0000|hull_rain|2007-06-24 00:00:00|None
radar_rain_5min_0001|hull_rain|2007-06-24 00:05:00|None
[...]
radar_rain_5min_0575|hull_rain|2007-06-25 23:55:00|None
$ t.connect -p
driver:sqlite
database:$GISDBASE/$LOCATION_NAME/$MAPSET/tgis/sqlite.db


Thanks again for your help.

Cheers,
Laurent


2016-08-05 18:10 GMT-05:00 Veronica Andreo <veroandreo at gmail.com>:
> Hello Laurent,
>
> AFAIK, you can access STRDS stored in other mapsets as long as those mapsets
> are in the search path (check with g.mapsets -p). If I'm in a certain mapset
> and I do:
>
> t.rast.list some_strds at other_mapset
>
> it lists the maps as expected... However, the error I get if I try to list
> maps in a STRDS that is in a mapset not in the search path, is different
> from yours. I get the following:
>
> ERROR: Unable to execute sql statement. You have no permission to access
> mapset <rrs_667>, or mapset <rrs_667> has no temporal database. Accessable
> mapsets are: <clorofila,pruebas>
>
> The error you get in both cases appears to be related to the database
> connection. I guess you run t.connect in those mapsets, right? What is the
> output of t.connect -p??
>
> IIUC, the ticket you mention #2110 [0] is related to registering maps from
> one mapset in a STRDS of some other mapset, that is not allowed unless you
> change the database connection of each mapset to point to a single one (See
> Soeren's explanation in ML:
> https://lists.osgeo.org/pipermail/grass-user/2016-April/074079.html).
> However, I don't think that's what you need, since, again IIUC, you would
> only need to access those STDRS in different mapsets but you would NOT need
> to register those same maps in a different STDRS in a different mapset,
> would you?
>
> Also, what version of grass you use and under which system? (here, i have
> freshly compiled grass73 in Linux)
>
> HTH,
> Vero
>
> [0] https://trac.osgeo.org/grass/ticket/2110
>
> 2016-08-05 18:38 GMT-03:00 Laurent C. <lrntct at gmail.com>:
>>
>> Hello all,
>>
>> I have several STRDS of rainfall covering a whole country, in a
>> specific mapset dedicated to rainfall data.
>> I'd like to run some hydraulic simulations in different regions of the
>> country, that output several STRDS as results.
>> For the sake of organizing the data, every study area has its own mapset.
>> The hydraulic model calls the STRDS from the other mapset return an error:
>>
>> ```
>> [...]
>>   File
>> "/home/jrodriguezri/.local/lib/python2.7/site-packages/itzi/gis.py",
>> line 138, in name_is_stds
>>     if tgis.SpaceTimeRasterDataset(name).is_in_db():
>>   File "/usr/lib/grass70/etc/python/grass/temporal/abstract_dataset.py",
>> line 370, in is_in_db
>>     return self.base.is_in_db(dbif)
>>   File "/usr/lib/grass70/etc/python/grass/temporal/base.py", line 314,
>> in is_in_db
>>     dbif.execute(sql, mapset=self.mapset)
>>   File "/usr/lib/grass70/etc/python/grass/temporal/core.py", line 956,
>> in execute
>>     "mapset <%(mapset)s>" % {"mapset": mapset}))
>>   File "/usr/lib/grass70/etc/python/grass/pygrass/messages/__init__.py",
>> line 269, in fatal
>>     raise FatalError(message)
>> grass.exceptions.FatalError: Unable to execute sql statement. There is
>> no temporal database connection defined for mapset <Lluvia>
>> ```
>>
>> I realize that if I try to open a strds from another mapset with
>> t.rst.list, I get a similar error:
>>
>> ```
>> ERROR: Unable to execute sql statement. There is no temporal database
>> connection defined for mapset
>> ```
>>
>> Searching for an open ticket about it, I encounter #2110 which seems
>> related, but it's quite old and it seems in the discussion that a
>> STRDS should behave like a map, which could be open from another
>> mapset.
>>
>> Is it a normal behaviour, and if it's the case, what is the workaround?
>>
>> Cheers,
>> Laurent
>> _______________________________________________
>> grass-dev mailing list
>> grass-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-dev
>
>


More information about the grass-dev mailing list