[GRASS-user] t.rast.what does not accept utf8 in "where" field

Hello,

I'm running into a problem with t.rast.what when trying to select a
specific point with the "where" option:

/usr/lib/grass72/scripts/t.rast.what points=stations@chiapas
strds=boqueron_60m_qy@chiapas_results where=name=='Boquerón'
Traceback (most recent call last):
  File "/usr/lib/grass72/scripts/t.rast.what", line 531, in
<module>
    main(options, flags)
  File "/usr/lib/grass72/scripts/t.rast.what", line 169, in
main
    dbif=dbif)
  File "/usr/lib/grass72/etc/python/grass/temporal/abstract_
space_time_dataset.py", line 1411, in
get_registered_maps_as_objects
    rows = self.get_registered_maps(columns, where, order,
dbif)
  File "/usr/lib/grass72/etc/python/grass/temporal/abstract_
space_time_dataset.py", line 1479, in get_registered_maps
    sql += " AND (%s)" % (where.split(";")[0])
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
position 20: ordinal not in range(128)

If I'm not setting "where", it works fine.
When using the "where" option with v.db.select, I do not have this
problem neither:
v.db.select map=stations@chiapas where=name=='Boquerón'
cat|name|rain_rate
9|Boquerón|0

Should I open an issue?

Best regards,
Laurent

Hi Laurent,

I might be mistaken, but I think the where is for the strds, so you should use one of the variables allowed/available in the twmporal framework… and one more thing, I would use double quotes after the where (where=“name==‘something’” or, if temporal, where=“start_time ==‘2001-01-01’”)? Have you tried that?

Best,
Vero

···

El 14 jun. 2017 5:03 p.m., “Laurent C.” <lrntct@gmail.com> escribió:

Hello,

I’m running into a problem with t.rast.what when trying to select a
specific point with the “where” option:

/usr/lib/grass72/scripts/t.rast.what points=stations@chiapas
strds=boqueron_60m_qy@chiapas_results where=name==‘Boquerón’
Traceback (most recent call last):
File “/usr/lib/grass72/scripts/t.rast.what”, line 531, in

main(options, flags)
File “/usr/lib/grass72/scripts/t.rast.what”, line 169, in
main
dbif=dbif)
File “/usr/lib/grass72/etc/python/grass/temporal/abstract_
space_time_dataset.py”, line 1411, in
get_registered_maps_as_objects
rows = self.get_registered_maps(columns, where, order,
dbif)
File “/usr/lib/grass72/etc/python/grass/temporal/abstract_
space_time_dataset.py”, line 1479, in get_registered_maps
sql += " AND (%s)" % (where.split(“;”)[0])
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc3 in
position 20: ordinal not in range(128)

If I’m not setting “where”, it works fine.
When using the “where” option with v.db.select, I do not have this
problem neither:
v.db.select map=stations@chiapas where=name==‘Boquerón’
cat|name|rain_rate
9|Boquerón|0

Should I open an issue?

Best regards,
Laurent


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Hi Veronica,

2017-06-14 15:32 GMT-05:00 Veronica Andreo <veroandreo@gmail.com>:

Hi Laurent,

I might be mistaken, but I think the where is for the strds, so you should
use one of the variables allowed/available in the twmporal framework...

You're right, It seems tobe related to the temporal DB. I thought it
was the spatial DB.
It could be an interesting addition, though.
However, it still have a problem with UTF8.

and one more thing, I would use double quotes after the where
(where="name=='something'" or, if temporal, where="start_time
=='2001-01-01'")? Have you tried that?

I did, without success. Actually, I wrote it the exact same way as in
v.db.select, and it worked.

Regards,
Laurent

Best,
Vero

El 14 jun. 2017 5:03 p.m., "Laurent C." <lrntct@gmail.com> escribió:

Hello,

I'm running into a problem with t.rast.what when trying to select a
specific point with the "where" option:

/usr/lib/grass72/scripts/t.rast.what points=stations@chiapas
strds=boqueron_60m_qy@chiapas_results where=name=='Boquerón'
Traceback (most recent call last):
  File "/usr/lib/grass72/scripts/t.rast.what", line 531, in
<module>
    main(options, flags)
  File "/usr/lib/grass72/scripts/t.rast.what", line 169, in
main
    dbif=dbif)
  File "/usr/lib/grass72/etc/python/grass/temporal/abstract_
space_time_dataset.py", line 1411, in
get_registered_maps_as_objects
    rows = self.get_registered_maps(columns, where, order,
dbif)
  File "/usr/lib/grass72/etc/python/grass/temporal/abstract_
space_time_dataset.py", line 1479, in get_registered_maps
    sql += " AND (%s)" % (where.split(";")[0])
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
position 20: ordinal not in range(128)

If I'm not setting "where", it works fine.
When using the "where" option with v.db.select, I do not have this
problem neither:
v.db.select map=stations@chiapas where=name=='Boquerón'
cat|name|rain_rate
9|Boquerón|0

Should I open an issue?

Best regards,
Laurent
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user