Hi all,
I’m testing the new t.stac addons and I found some problems, I don’t
know if they are bugs (some for sure yes) or problems according to the
parameters I’m using.
running this command:
t.stac.item -d url=https://earth-search.aws.element84.com/v1/
collection_id=sentinel-2-l2a datetime=2024-04-01/2024-09-30
asset_keys=red,nir query=‘{“eo:cloud_cover”:{“lt”
:10}}’
Search Matched: 3 items
Downloading Asset: {‘href’:
‘https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/32/T/PS/2024/8/S2B_32TPS_20240810_1_L2A/B08.tif’,
‘type’: ‘image/tiff; application=geotiff; profile=cloud-optimized’,
‘title’: ‘NIR 1 (band 8) - 10m’, ‘eo:bands’: [{‘name’: ‘nir’,
‘common_name’: ‘nir’, ‘description’: ‘NIR 1 (band 8)’,
‘center_wavelength’: 0.842, ‘full_width_half_max’: 0.145}], ‘gsd’: 10,
‘proj:shape’: [10980, 10980], ‘proj:transform’: [10, 0, 600000, 0,
-10, 5200020], ‘raster:bands’: [{‘nodata’: 0, ‘data_type’: ‘uint16’,
‘bits_per_sample’: 15, ‘spatial_resolution’: 10, ‘scale’: 0.0001,
‘offset’: -0.1}], ‘roles’: [‘data’, ‘reflectance’], ‘collection_id’:
‘sentinel-2-l2a’, ‘item_id’: ‘S2B_32TPS_20240810_1_L2A’, ‘file_name’:
‘sentinel-2-l2a.S2B_32TPS_20240810_1_L2A.nir’, ‘datetime’:
‘2024-08-10T10:18:03.425000Z’}
Import Url: /vsicurl/https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/32/T/PS/2024/8/S2B_32TPS_20240810_1_L2A/B08.tif
Importing: sentinel-2-l2a.S2B_32TPS_20240810_1_L2A.nir
Downloading Asset: {‘href’:
‘https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/32/T/PS/2024/7/S2B_32TPS_20240731_0_L2A/B08.tif’,
‘type’: ‘image/tiff; application=geotiff; profile=cloud-optimized’,
‘title’: ‘NIR 1 (band 8) - 10m’, ‘eo:bands’: [{‘name’: ‘nir’,
‘common_name’: ‘nir’, ‘description’: ‘NIR 1 (band 8)’,
‘center_wavelength’: 0.842, ‘full_width_half_max’: 0.145}], ‘gsd’: 10,
‘proj:shape’: [10980, 10980], ‘proj:transform’: [10, 0, 600000, 0,
-10, 5200020], ‘raster:bands’: [{‘nodata’: 0, ‘data_type’: ‘uint16’,
‘bits_per_sample’: 15, ‘spatial_resolution’: 10, ‘scale’: 0.0001,
‘offset’: -0.1}], ‘roles’: [‘data’, ‘reflectance’], ‘collection_id’:
‘sentinel-2-l2a’, ‘item_id’: ‘S2B_32TPS_20240731_0_L2A’, ‘file_name’:
‘sentinel-2-l2a.S2B_32TPS_20240731_0_L2A.nir’, ‘datetime’:
‘2024-07-31T10:18:00.089000Z’}
Import Url: /vsicurl/https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/32/T/PS/2024/7/S2B_32TPS_20240731_0_L2A/B08.tif
Importing: sentinel-2-l2a.S2B_32TPS_20240731_0_L2A.nir
Downloading Asset: {‘href’:
‘https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/32/T/PS/2024/4/S2B_32TPS_20240412_0_L2A/B08.tif’,
‘type’: ‘image/tiff; application=geotiff; profile=cloud-optimized’,
‘title’: ‘NIR 1 (band 8) - 10m’, ‘eo:bands’: [{‘name’: ‘nir’,
‘common_name’: ‘nir’, ‘description’: ‘NIR 1 (band 8)’,
‘center_wavelength’: 0.842, ‘full_width_half_max’: 0.145}], ‘gsd’: 10,
‘proj:shape’: [10980, 10980], ‘proj:transform’: [10, 0, 600000, 0,
-10, 5200020], ‘raster:bands’: [{‘nodata’: 0, ‘data_type’: ‘uint16’,
‘bits_per_sample’: 15, ‘spatial_resolution’: 10, ‘scale’: 0.0001,
‘offset’: -0.1}], ‘roles’: [‘data’, ‘reflectance’], ‘collection_id’:
‘sentinel-2-l2a’, ‘item_id’: ‘S2B_32TPS_20240412_0_L2A’, ‘file_name’:
‘sentinel-2-l2a.S2B_32TPS_20240412_0_L2A.nir’, ‘datetime’:
‘2024-04-12T10:17:59.686000Z’}
Import Url: /vsicurl/https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/32/T/PS/2024/4/S2B_32TPS_20240412_0_L2A/B08.tif
Importing: sentinel-2-l2a.S2B_32TPS_20240412_0_L2A.nir
Downloading assets: 100%|
I supposed to download red and nir band but only the nir one was downloaded
g.list raster
sentinel-2-l2a.S2B_32TPS_20240412_0_L2A.nir
sentinel-2-l2a.S2B_32TPS_20240731_0_L2A.nir
sentinel-2-l2a.S2B_32TPS_20240810_1_L2A.nir
I was thinking to download only the raster of my computational region
since I’m using the COG layer but the entire raster was downloaded
g.region -g
projection=3
zone=0
n=46.3611938055556
s=46.3604270025
w=11.0399801655556
e=11.0412577830556
nsres=9.58503819443735e-05
ewres=9.82782692308713e-05
rows=8
cols=13
cells=104
r.info -g sentinel-2-l2a.S2B_32TPS_20240412_0_L2A.nir
north=46.9461682536111
south=45.9334965044444
east=11.7555849161111
west=10.2904840686111
nsres=0.000105530611626372
ewres=0.000105532006590795
rows=9596
cols=13883
cells=133221268
datatype=CELL
ncats=0
second command try to use intersect option (maybe I need to use it to
clip the raster)
t.stac.item -d url=https://earth-search.aws.element84.com/v1/
collection_id=sentinel-2-l2a datetime=2024-04-01/2024-09-30
asset_keys=red intersect=maiano_region
query=‘{“eo:cloud_cover”:{“lt”:10}}’
WARNING: No attribute table found → using only category numbers as
attributes
Exporting 1 area (may take some time)…
100%
v.out.ogr complete. 1 feature (Polygon type) written to <maiano_region>
(GeoJSON format).
ERROR: Error searching STAC API: could not convert string to float: ‘’
third command try to create strds_output, data downloaded but no strds
is created
t.stac.item -d url=https://earth-search.aws.element84.com/v1/
collection_id=sentinel-2-l2a datetime=2024-04-01/2024-09-30
asset_keys=red strds_output=s2_red
query=‘{“eo:cloud_cover”:{“lt”:10}}’
t.list
Let me know if I need to open issues (one with all the problems or one
for each problem).
I would like to understand because it is downloading the entire
raster, I used pystac_client and it worked properly to download only a
specific area.
Thanks a lot
–
ciao
Luca