[GRASS-dev] G79: working with image collections and Sentinel-2

Markus Neteler neteler at osgeo.org
Thu Nov 21 23:37:31 PST 2019


On Fri, Nov 22, 2019 at 1:01 AM Veronica Andreo <veroandreo at gmail.com> wrote:
> El jue., 21 nov. 2019 18:40, Markus Neteler <neteler at osgeo.org> escribió:
>>
>> Hi,
>>
>> I have successfully imported a series of Sentinel-2 scenes using
>> i.sentinel.download and i.sentinel.import (with the recent fixes yet
>> manually patched into it).
>>
>> Now I want to register them:
>>
>> t.create type=strds temporaltype=absolute \
>>          output=openeo_bolzano_S2 \
>>          title="Sentinel-2 scenes Bolzano" \
>>          description="Dataset with Sentinel-2 scenes covering Bolzano"
>>
>> # created by i.sentinel.import
>> head /mnt/geodata/openeo_bolzano/s2_t_register.csv
>> T32TPS_20180618T101021_B12|2018-06-18 10:17:33.781000|S2_12
>> T32TPS_20180618T101021_B04|2018-06-18 10:17:33.781000|S2_4
>> T32TPS_20180618T101021_B09|2018-06-18 10:17:33.781000|S2_9
>> T32TPS_20180618T101021_B08|2018-06-18 10:17:33.781000|S2_8
>> T32TPS_20180618T101021_B8A|2018-06-18 10:17:33.781000|S2_8A
>> T32TPS_20180618T101021_B06|2018-06-18 10:17:33.781000|S2_6
>> T32TPS_20180618T101021_B01|2018-06-18 10:17:33.781000|S2_1
>> T32TPS_20180618T101021_B03|2018-06-18 10:17:33.781000|S2_3
>> T32TPS_20180618T101021_B11|2018-06-18 10:17:33.781000|S2_11
>> T32TPS_20180618T101021_B07|2018-06-18 10:17:33.781000|S2_7
>>
>> # here I updated successfully the existing TGRASS DB with the yet unmerged
>> # t.upgrade script (https://github.com/OSGeo/grass/pull/130)
>> t.register input=openeo_bolzano_S2
>> file=/mnt/geodata/openeo_bolzano/s2_t_register.csv
>>
>> So far so nice, but:
>>
>> t.rast.list openeo_bolzano_S2
>> name|mapset|start_time|end_time
>> T32TPS_20180606T102019_B01|openeo_bolzano|2018-06-06 10:25:12.692000|None
>> T32TPS_20180606T102019_B02|openeo_bolzano|2018-06-06 10:25:12.692000|None
>> T32TPS_20180606T102019_B03|openeo_bolzano|2018-06-06 10:25:12.692000|None
>> ...
>>
>> ... the band names are gone - can anyone confirm?
>> I am using a recent G79.
>
>
> I haven't tested, but are you sure t.rast.list now lists band references by default if they exist? Because that looks like a normal t.rast.list output to me
>
> What if you use:
>
> t.rast.list openeo_bolzano_S2 columns=name,band_reference,start_time
>
> Does that work?

Unfortunately not:

GRASS 7.9.dev (utm32n_32632):~ > t.rast.list openeo_bolzano_S2
columns=name,band_reference,start_time
...
ERROR: Value <band_reference> out of range for parameter <columns>
    Legal range:
id,name,creator,mapset,temporal_type,creation_time,start_time,end_time,north,south,west,east,nsres,ewres,cols,rows,number_of_cells,min,max

Indeed, that column isn't foreseen as an answer to columns:
https://grass.osgeo.org/grass79/manuals/t.rast.list.html

> And what does t.info openeo_bolzano_S2 give?

t.info openeo_bolzano_S2
 +-------------------- Space Time Raster Dataset -----------------------------+
 |                                                                            |
 +-------------------- Basic information -------------------------------------+
 | Id: ........................ openeo_bolzano_S2 at openeo_bolzano
 | Name: ...................... openeo_bolzano_S2
 | Mapset: .................... openeo_bolzano
 | Creator: ................... root
 | Temporal type: ............. absolute
 | Creation time: ............. 2019-11-21 21:24:17.024278
 | Modification time:.......... 2019-11-21 21:25:05.446855
 | Semantic type:.............. mean
 +-------------------- Absolute time -----------------------------------------+
 | Start time:................. 2018-06-06 10:25:12.692000
 | End time:................... 2018-06-21 10:23:16.629000
 | Granularity:................ 1 second
 | Temporal type of maps:...... point
 +-------------------- Spatial extent ----------------------------------------+
 | North:...................... 5200020.0
 | South:...................... 5090220.0
 | East:.. .................... 709800.0
 | West:....................... 600000.0
 | Top:........................ 0.0
 | Bottom:..................... 0.0
 +-------------------- Metadata information ----------------------------------+
 | Raster register table:......
raster_map_register_b9c38e48a9074528a0c5d928ccd9c8aa
 | North-South resolution min:. 10.0
 | North-South resolution max:. 60.0
 | East-west resolution min:... 10.0
 | East-west resolution max:... 60.0
 | Minimum value min:.......... 0.0
 | Minimum value max:.......... 1929.0
 | Maximum value min:.......... 1600.0
 | Maximum value max:.......... 28002.0
 | Aggregation type:........... None
 | Number of registered bands:. 13
 | Number of registered maps:.. 91
 |
 | Title:
 | Sentinel-2 scenes Bolzano
 | Description:
 | Dataset with Sentinel-2 scenes covering Bolzano
 | Command history:
 | # 2019-11-21 21:24:17
 | t.create type="strds" temporaltype="absolute"
 |     output="openeo_bolzano_S2" title="Sentinel-2 scenes Bolzano"
 |     description="Dataset with Sentinel-2 scenes covering Bolzano"
 | # 2019-11-21 21:25:05
 | t.register input="openeo_bolzano_S2"
 |     file="/mnt/geodata/openeo_bolzano/s2_t_register.csv"
 |
 +----------------------------------------------------------------------------+

-->  Number of registered bands:. 13!

So, adding the "band_reference" to the option makes it work:

t.rast.list openeo_bolzano_S2 columns=name,band_reference,start_time
name|band_reference|start_time
T32TPS_20180606T102019_B01|S2_1|2018-06-06 10:25:12.692000
T32TPS_20180606T102019_B02|S2_2|2018-06-06 10:25:12.692000
T32TPS_20180606T102019_B03|S2_3|2018-06-06 10:25:12.692000
T32TPS_20180606T102019_B04|S2_4|2018-06-06 10:25:12.692000
...

I addressed the issue in
https://github.com/OSGeo/grass/pull/206

Thanks for pointing that out :-)

Probably we should also change the default output to

old:  #% answer: name,mapset,start_time,end_time

suggestion: #% answer: name,band_reference,mapset,start_time,end_time
?

Best,
Markus


More information about the grass-dev mailing list