[GRASS-dev] [GRASS GIS] #3392: t.register: encoding error

GRASS GIS trac at osgeo.org
Fri Aug 11 09:26:04 PDT 2017


#3392: t.register: encoding error
--------------------------+---------------------------------
  Reporter:  mlennert     |      Owner:  grass-dev@…
      Type:  defect       |     Status:  new
  Priority:  normal       |  Milestone:  7.2.2
 Component:  Temporal     |    Version:  svn-trunk
Resolution:               |   Keywords:  t.register encoding
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+---------------------------------

Comment (by mlennert):

 Replying to [comment:5 zarch]:
 > I'm not able to reproduce these errors in: `t.create`, `t.register`,
 `t.unregister`, `t.remove`.

 Ok, here I go again (leaving the stdrs desciption issue aside for the
 moment, so t.create is not an issue), with a completely fresh svn checkout
 of trunk, applied your two patches, 'temporal_encoding.diff​' and
 'temporal_script_utils_encoding.diff​', compiled.

 Get the [http://fatra.cnr.ncsu.edu/temporal-grass-
 workshop/NC_spm_temporal_workshop.zip demo location] from the [http
 ://ncsu-geoforall-lab.github.io/grass-temporal-workshop/ FOSS4G 2014
 workshop site]. Use the climate_2000_2012 mapset.


 {{{
 GRASS 7.3.svn (NC_spm_temporal_workshop):~ > g.version -g
 version=7.3.svn
 date=2017
 revision=r71392M
 build_date=2017-08-11
 build_platform=x86_64-pc-linux-gnu
 build_off_t_size=8
 }}}


 {{{
 GRASS 7.3.svn (NC_spm_temporal_workshop):~ > locale
 LANG=fr_BE
 LANGUAGE=fr_BE
 LC_CTYPE=fr_BE.UTF-8
 LC_NUMERIC=C
 LC_TIME=fr_BE.UTF-8
 LC_COLLATE=fr_BE.UTF-8
 LC_MONETARY=fr_BE.UTF-8
 LC_MESSAGES=fr_BE.UTF-8
 LC_PAPER=fr_BE.UTF-8
 LC_NAME=fr_BE.UTF-8
 LC_ADDRESS=fr_BE.UTF-8
 LC_TELEPHONE=fr_BE.UTF-8
 LC_MEASUREMENT=fr_BE.UTF-8
 LC_IDENTIFICATION=fr_BE.UTF-8
 LC_ALL=
 }}}

 Then follow the steps described there (with light modifications for ease):


 {{{
 t.create output=tempmean type=strds temporaltype=absolute title="Average
 temperature" description="Monthly temperature average in NC [deg C]"
 g.list type=raster pattern="*tempmean" > rasters_tempmean.list
 t.register -i input=tempmean type=raster start=2000-01-01 increment="1
 months" file=rasters_tempmean.list
 Collecte des informations sur la carte ...
  100%
 Enregistrement des cartes dans la base temporelle ...
 Enregistrement des cartes dans le jeu de données temporel ...
 Mise à jour du jeu de données temporel ...
 ERREUR :ascii,Mettre à jour les métadonnées, l'emprise spatiale et
         temporelle de toutes les cartes enregistrées de <,7,8,ordinal not
         in range(128)
 }}}

 t.list and t.list raster seem to show that everything is alright, but IIUC
 the output of t.info and t.topology seems to indicate that something went
 wrong:


 {{{
 t.info tempmean at climate_2000_2012
  +-------------------- Space Time Raster Dataset
 -----------------------------+
  |
 |
  +-------------------- Basic information
 -------------------------------------+
  | Id: ........................ tempmean at climate_2000_2012
  | Name: ...................... tempmean
  | Mapset: .................... climate_2000_2012
  | Creator: ................... mlennert
  | Temporal type: ............. absolute
  | Creation time: ............. 2017-08-11 18:12:14.819514
  | Modification time:.......... 2017-08-11 18:12:14.819546
  | Semantic type:.............. mean
  +-------------------- Absolute time
 -----------------------------------------+
  | Start time:................. None
  | End time:................... None
  | Granularity:................ None
  | Temporal type of maps:...... None
  +-------------------- Spatial extent
 ----------------------------------------+
  | North:...................... None
  | South:...................... None
  | East:.. .................... None
  | West:....................... None
  | Top:........................ None
  | Bottom:..................... None
  +-------------------- Metadata information
 ----------------------------------+
  | Raster register table:......
 raster_map_register_031cdb28ede04a64b03d115101b86c0b
  | North-South resolution min:. None
  | North-South resolution max:. None
  | East-west resolution min:... None
  | East-west resolution max:... None
  | Minimum value min:.......... None
  | Minimum value max:.......... None
  | Maximum value min:.......... None
  | Maximum value max:.......... None
  | Aggregation type:........... None
  | Number of registered maps:.. None
  |
  | Title:
  | Average temperature
  | Description:
  | Monthly temperature average in NC [deg C]
  | Command history:
  | # 2017-08-11 18:12:14
  | t.create output="tempmean" type="strds"
  |     temporaltype="absolute" title="Average temperature"
  |     description="Monthly temperature average in NC [deg C]"
  |
 +----------------------------------------------------------------------------+
 }}}

 {{{
 t.topology tempmean at climate_2000_2012
  +-------------------- Basic information
 -------------------------------------+
  | Id: ........................ tempmean at climate_2000_2012
  | Name: ...................... tempmean
  | Mapset: .................... climate_2000_2012
  | Creator: ................... mlennert
  | Temporal type: ............. absolute
  | Creation time: ............. 2017-08-11 18:12:14.819514
  | Modification time:.......... 2017-08-11 18:12:14.819546
  | Semantic type:.............. mean
  +-------------------- Temporal topology
 -------------------------------------+
  | Is subset of dataset: ...... False
  | Temporal topology is: ...... invalid
  | Number of intervals: ....... 156
  | Invalid time stamps: ....... 0
  | Number of points: .......... 0
  | Number of gaps: ............ 0
  | Granularity: ............... 1 month
  +-------------------- Topological relations
 ---------------------------------+
  | Overlaps: .................. 0
  | Overlapped: ................ 0
  | Finishes: .................. 0
  | Started: ................... 0
  | Follows: ................... 155
  | Contains: .................. 0
  | Equal:...................... 0
  | Finished: .................. 0
  | Precedes: .................. 155
  | Starts: .................... 0
  | During: .................... 0
 +----------------------------------------------------------------------------+
 }}}


 {{{
 t.remove -f tempmean at climate_2000_2012
 Note: registered maps themselves have not been removed, only the strds
 Traceback (most recent call last):
   File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-
 gnu/scripts/t.remove", line 171, in <module>
     tgis.profile_function(main)
   File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-
 gnu/etc/python/grass/temporal/core.py", line 85, in profile_function
     func()
   File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-
 gnu/scripts/t.remove", line 157, in main
     statement += sp.delete(dbif=dbif, execute=False)
   File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-
 gnu/etc/python/grass/temporal/abstract_space_time_dataset.py", line 1959,
 in delete
     self.get_id()))
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 23:
 ordinal not in range(128)
 }}}


 {{{
 t.unregister file=rasters_tempmean.list
 Unregister maps
  100%
 Unregister maps from the temporal database
 Traceback (most recent call last):
   File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-
 gnu/scripts/t.unregister", line 183, in <module>
     tgis.profile_function(main)
   File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-
 gnu/etc/python/grass/temporal/core.py", line 85, in profile_function
     func()
   File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-
 gnu/scripts/t.unregister", line 169, in main
     sp.update_from_registered_maps(dbif)
   File "/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-linux-
 gnu/etc/python/grass/temporal/abstract_space_time_dataset.py", line 2295,
 in update_from_registered_maps
     " all registered maps of <%s>") % (self.get_id()))
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 7:
 ordinal not in range(128)
 }}}

 So, I still have exactly the same issues. My guess is that most of them
 come from the fact that the message strings are flagged as translatable
 and that in the French translation there are accents... The t.register one
 I find more difficult to understand.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3392#comment:7>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list