OSGeo / grass

GRASS GIS - free and open-source geospatial processing engine
https://grass.osgeo.org
Other
823 stars 301 forks source link

[Bug] t.info fails for single registered raster #4182

Open petrasovaa opened 4 weeks ago

petrasovaa commented 4 weeks ago

Describe the bug

Printing metadata for raster registered in temporal database fails:

t.info type=raster input=lst_2014.005_avg
 +-------------------- Raster Dataset ----------------------------------------+
 |                                                                            |
 +-------------------- Basic information -------------------------------------+
 | Id: ........................ lst_2014.005_avg@italy_LST_daily
 | Name: ...................... lst_2014.005_avg
 | Mapset: .................... italy_LST_daily
 | Creator: ................... mundialis
 | Temporal type: ............. absolute
 | Creation time: ............. 2019-09-05 12:57:57
 +-------------------- Absolute time -----------------------------------------+
 | Start time:................. 2014-01-05 00:00:00
 | End time:................... 2014-01-06 00:00:00
 +-------------------- Spatial extent ----------------------------------------+
 | North:...................... 2666000.0
 | South:...................... 2228000.0
 | East:.. .................... 4635000.0
 | West:....................... 4053000.0
 | Top:........................ 0.0
 | Bottom:..................... 0.0
Traceback (most recent call last):
  File "/home/akratoc/dev/grass/grass_main/dist.x86_64-pc-linux-gnu/scripts/t.info", line 134, in <module>
    main()
  File "/home/akratoc/dev/grass/grass_main/dist.x86_64-pc-linux-gnu/scripts/t.info", line 129, in main
    dataset.print_info()
  File "/home/akratoc/dev/grass/grass_main/dist.x86_64-pc-linux-gnu/etc/python/grass/temporal/abstract_map_dataset.py", line 308, in print_info
    self.metadata.print_info()
    ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'RasterMetadata' object has no attribute 'print_info'

Expected behavior

Metadata should work not only for STDS, but also for registered maps.

Additional context

Broken in 7df1a7e.

echoix commented 4 weeks ago

I remember trying to take a look at something very similar...

Isn't it very similar to #4076?

veroandreo commented 3 weeks ago

How to reproduce:

for i in $(seq 1 5) ; do 
r.mapcalc expression="map_${i} = ${i}" 
done

t.create type=strds temporaltype=absolute output=test title="test" description="test"

t.register input=test maps=`g.list rast pat=map* sep=comma` start="2024-07-14" increment="1 days" -i

t.info map_1 type=raster
veroandreo commented 3 weeks ago

Isn't it very similar to #4076?

It's the same thing, I copied the how to reproduce part here, and will now close the other.