[GRASS-dev] [GRASS GIS] #3168: Behavior of t.register when r.timestamp was used

GRASS GIS trac at osgeo.org
Tue Sep 27 07:12:18 PDT 2016


#3168: Behavior of t.register when r.timestamp was used
-------------------------------------------------+-------------------------
 Reporter:  wenzeslaus                           |      Owner:  grass-dev@…
     Type:  defect                               |     Status:  new
 Priority:  normal                               |  Milestone:  7.2.0
Component:  Temporal                             |    Version:  svn-trunk
 Keywords:  t.create, t.register, r.timestamp,   |        CPU:  Unspecified
  G_write_raster_timestamp                       |
 Platform:  Unspecified                          |
-------------------------------------------------+-------------------------
 I'm trying to figure out what is the right behavior and usage of
 t.register in case when the raster map already has a "simple GRASS" time
 stamp (managed e.g. by `r.timestamp`).

 For example, `r.sim.water` with `-t` produces time series which has time
 stamps from `G_write_raster_timestamp()`. The time stamps are relative.

 Later, when you create a temporal dataset using t.create and set absolute
 time and use `t.register` to register the map or maps providing the start
 time and increment, you get an error saying that the time and date
 provided as start cannot be converted to integer.

 Here is the code to reproduce it:

 {{{
 #!bash
 g.region s=0 w=0 n=100 e=100 -p res=10
 r.surf.fractal elevation
 r.slope.aspect elevation=elevation dx=dx dy=dy
 r.sim.water el=elevation dx=dx dy=dy depth=depth -t
 t.create output=depth type=strds temporaltype=absolute title="Depths"
 description="Time series of depths from r.sim.water
 t.register input=depth maps=depth.02 start="2015-01-01 00:01:00"
 }}}

 And this is the error:

 {{{
 ERROR: invalid literal for int() with base 10: '2015-01-01 00:01:00'
 }}}

 It comes from:

 {{{
 #!python
 if ttype == "absolute":
     ...
 else:
     start_time = int(start)  # here
 }}}

 The time stamp is read from the spatial database in
 [source:grass/trunk/lib/python/temporal/register.py#L284 register.py]:

 {{{
 #!python
 if not is_in_db:
     map.read_timestamp_from_grass()
 }}}

 The condition doesn't depend on the input parameters to `t.register` and
 the behavior seems to be unexpected from the user point of view (plus of
 course there should be no low-level error like this one).

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/3168>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list