[GRASS-user] GRASS, ordinal not in range(128)

Andres Solarte e.andres.solartec at gmail.com
Wed Mar 22 12:21:33 PDT 2017


Hello,

I made two changes for this issue.

1. In the file ...etc/python/grass/temporal/register.py (line 422 for me),
I added the marked in red

else:
   msgr.debug(1, _*(*("Set absolute valid time for map <%s> to %s - %s")
                       % (map.get_map_id(), str(start_time), str(end_time))
*)*.encode('utf8'))

There is a similar issue after that, so I added the marked in red in the
file
...etc/python/grass/temporal/abstract_space_time_dataset.py (line 2282)

self.msgr.verbose(_*(*("Update metadata, spatial and temporal extent from"
                            " all registered maps of <%s>") %
(self.get_id())*)*.encode('utf8'))

Now, I don't have problems with accents

t.info input=ndvi_andres at regresion
 +-------------------- Space Time Raster Dataset
-----------------------------+
 |
   |
 +-------------------- Basic information
-------------------------------------+
 | Id: ........................ ndvi_andres at regresion
 | Name: ...................... ndvi_andres
 | Mapset: .................... regresion
 | Creator: ................... andres
 | Temporal type: ............. absolute
 | Creation time: ............. 2017-03-22 15:58:33.237769
 | Modification time:.......... 2017-03-22 15:58:40.516887
 | Semantic type:.............. mean
 +-------------------- Absolute time
-----------------------------------------+
 | Start time:................. 2015-09-07 00:00:00
 | End time:................... 2015-09-12 00:00:00
 | Granularity:................ 1 day
 | Temporal type of maps:...... interval
 +-------------------- Spatial extent
----------------------------------------+
 | North:...................... 1.0
 | South:...................... -41.0
 | East:.. .................... 1.6756
 | West:....................... -78.3244
 | Top:........................ 0.0
 | Bottom:..................... 0.0
 +-------------------- Metadata information
----------------------------------+
 | Raster register table:......
raster_map_register_6229cacdbcfd42b8ac533b4c6280516a
 | North-South resolution min:. 1.0
 | North-South resolution max:. 1.0
 | East-west resolution min:... 1.0
 | East-west resolution max:... 1.0
 | Minimum value min:.......... 3.0
 | Minimum value max:.......... 3.0
 | Maximum value min:.......... 3.0
 | Maximum value max:.......... 3.0
 | Aggregation type:........... None
 | Number of registered maps:.. 5
 |
 | Title:
 | NDVI prueba tesis
 | Description:
 | prueba tesis
 | Command history:
 | # 2017-03-22 15:58:33
 | t.create type="strds" temporaltype="absolute"
 |     output="ndvi_andres" title="NDVI prueba tesis"
 |     description="prueba tesis" semantictype="mean"
 | # 2017-03-22 15:58:40
 | t.register -i type="raster" input="ndvi_andres"
 |
maps="prueba_andres1,prueba_andres2,prueba_andres3,prueba_andres4,prueba_andres5"
 |     start="2015-09-07" increment="1 days" --o
 |
 +----------------------------------------------------------------------------+

I hope it helps

Regards

Andrés.

2017-03-22 14:47 GMT-03:00 Andres Solarte <e.andres.solartec at gmail.com>:

> Hello,
>
> I'm working with grass72, I modified the /usr/lib/grass72/locale/es/LC_MESSAGES/grasslibs.mo
> file by deleting the accents and it works, so, maybe is a Python issue as
> you say.
>
>
>
> 2017-03-21 18:05 GMT-03:00 Markus Neteler <neteler at osgeo.org>:
>
>> Hi,
>>
>> On Tue, Mar 21, 2017 at 3:13 PM, Andres Solarte
>> <e.andres.solartec at gmail.com> wrote:
>> > Hello,
>> >
>> > I changed the debug level as Markus suggested
>> >
>> > g.gisenv set=DEBUG=1
>> >
>> > this is the result
>>
>> good, we are getting closer...:
>>
>> > t.register -i type=raster input=ndvi_andres maps=`g.list raster
>> > pattern=MODIS* separator=comma` start="2015-09-07" increment="1 days"
>>
>> ...
>> > D1/1: G_find_raster2(): name=MODIS_2015250_h12v12_1km_NDVI
>> mapset=prueba
>> > D1/1: grass.script.core.start_command(): g.message -e
>> message=ascii,Definir
>> > tiempo absoluto válido para mapa <,25,26,ordinal not in range(128)
>> > D1/1: G_set_program_name(): g.message
>> > ERROR: ascii,Definir tiempo absoluto válido para mapa <,25,26,ordinal
>> not
>> >        in range(128)
>>
>> In the locale/po/grasslibs_es.po file there is the mention of the
>> corresponding source code lines:
>>
>> #: ../lib/python/temporal/register.py:422
>> #, python-format
>> msgid ""
>> "Set absolute valid time for map <%(id)s> with layer %(layer)s to
>> %(start)s - "
>> "%(end)s"
>> msgstr ""
>> "Definir tiempo absoluto válido para mapa <%(id)s> con capa %(layer)s en "
>> "%(start)s - %(end)s"
>>
>> #: ../lib/python/temporal/register.py:427
>> #, python-format
>> msgid "Set absolute valid time for map <%s> to %s - %s"
>> msgstr "Definir tiempo absoluto válido para mapa <%s> en %s - %s"
>>
>> Probably a Python issue there in reading the "á" of "válido"?
>>
>> Markus
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170322/19b7bb25/attachment.html>


More information about the grass-user mailing list