Skip to content

Commit 170b0f9

Browse files
Add STAC item and test script for alternate S3 URLs
- Created a new STAC item JSON file for Sentinel-2 data with alternate S3 URLs. - Implemented a test script to demonstrate the addition of alternate S3 URLs to STAC items. - The script includes functionality to convert HTTPS URLs to S3 format and add relevant metadata. - Added necessary STAC extensions for alternate assets and storage.
1 parent abe209c commit 170b0f9

4 files changed

+1242
-4
lines changed
Lines changed: 397 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,397 @@
1+
{
2+
"id": "S2A_MSIL2A_20250831T103701_N0511_R008_T31TFL_20250831T145420",
3+
"bbox": [
4+
4.270075671777485, 45.034190140253024, 5.710544147597723, 46.046265456303395
5+
],
6+
"type": "Feature",
7+
"links": [
8+
{
9+
"rel": "collection",
10+
"type": "application/json",
11+
"href": "https://api.explorer.eopf.copernicus.eu/stac/collections/sentinel-2-l2a-staging"
12+
},
13+
{
14+
"rel": "parent",
15+
"type": "application/json",
16+
"href": "https://api.explorer.eopf.copernicus.eu/stac/collections/sentinel-2-l2a-staging"
17+
},
18+
{
19+
"rel": "root",
20+
"type": "application/json",
21+
"href": "https://api.explorer.eopf.copernicus.eu/stac/"
22+
},
23+
{
24+
"rel": "self",
25+
"type": "application/geo+json",
26+
"href": "https://api.explorer.eopf.copernicus.eu/stac/collections/sentinel-2-l2a-staging/items/S2A_MSIL2A_20250831T103701_N0511_R008_T31TFL_20250831T145420"
27+
},
28+
{ "rel": "cite-as", "href": "https://doi.org/10.5270/S2_-znk9xsj" },
29+
{
30+
"rel": "license",
31+
"href": "https://sentinel.esa.int/documents/247904/690755/Sentinel_Data_Legal_Notice",
32+
"type": "application/pdf",
33+
"title": "Legal notice on the use of Copernicus Sentinel Data and Service Information"
34+
},
35+
{
36+
"rel": "store",
37+
"href": "https://esa-zarr-sentinel-explorer-fra.s3.de.io.cloud.ovh.net/tests-output/sentinel-2-l2a-staging/S2A_MSIL2A_20250831T103701_N0511_R008_T31TFL_20250831T145420.zarr",
38+
"type": "application/octet-stream",
39+
"title": "Zarr Store"
40+
},
41+
{
42+
"rel": "viewer",
43+
"href": "https://api.explorer.eopf.copernicus.eu/raster/collections/sentinel-2-l2a-staging/items/S2A_MSIL2A_20250831T103701_N0511_R008_T31TFL_20250831T145420/viewer",
44+
"type": "text/html",
45+
"title": "Viewer for S2A_MSIL2A_20250831T103701_N0511_R008_T31TFL_20250831T145420"
46+
},
47+
{
48+
"rel": "xyz",
49+
"href": "https://api.explorer.eopf.copernicus.eu/raster/collections/sentinel-2-l2a-staging/items/S2A_MSIL2A_20250831T103701_N0511_R008_T31TFL_20250831T145420/tiles/WebMercatorQuad/{z}/{x}/{y}.png?rescale=0%2C1&color_formula=gamma+rgb+1.3%2C+sigmoidal+rgb+6+0.1%2C+saturation+1.2&variables=%2Fmeasurements%2Freflectance%2Fr60m%3Ab04&variables=%2Fmeasurements%2Freflectance%2Fr60m%3Ab03&variables=%2Fmeasurements%2Freflectance%2Fr60m%3Ab02&bidx=1",
50+
"type": "image/png",
51+
"title": "Sentinel-2 L2A True Color (60m)"
52+
},
53+
{
54+
"rel": "tilejson",
55+
"href": "https://api.explorer.eopf.copernicus.eu/raster/collections/sentinel-2-l2a-staging/items/S2A_MSIL2A_20250831T103701_N0511_R008_T31TFL_20250831T145420/WebMercatorQuad/tilejson.json?rescale=0%2C1&color_formula=gamma+rgb+1.3%2C+sigmoidal+rgb+6+0.1%2C+saturation+1.2&variables=%2Fmeasurements%2Freflectance%2Fr60m%3Ab04&variables=%2Fmeasurements%2Freflectance%2Fr60m%3Ab03&variables=%2Fmeasurements%2Freflectance%2Fr60m%3Ab02&bidx=1",
56+
"type": "application/json",
57+
"title": "TileJSON for S2A_MSIL2A_20250831T103701_N0511_R008_T31TFL_20250831T145420"
58+
},
59+
{
60+
"rel": "via",
61+
"href": "https://explorer.eopf.copernicus.eu/collections/sentinel-2-l2a-staging/items/S2A_MSIL2A_20250831T103701_N0511_R008_T31TFL_20250831T145420",
62+
"title": "EOPF Explorer"
63+
},
64+
{
65+
"rel": "derived_from",
66+
"href": "https://stac.core.eopf.eodc.eu/collections/sentinel-2-l2a/items/S2A_MSIL2A_20250831T103701_N0511_R008_T31TFL_20250831T145420",
67+
"type": "application/json",
68+
"title": "Derived from original Zarr STAC item"
69+
}
70+
],
71+
"assets": {
72+
"AOT_10m": {
73+
"gsd": 10,
74+
"href": "https://esa-zarr-sentinel-explorer-fra.s3.de.io.cloud.ovh.net/tests-output/sentinel-2-l2a-staging/S2A_MSIL2A_20250831T103701_N0511_R008_T31TFL_20250831T145420.zarr/quality/atmosphere/r10m/aot",
75+
"type": "application/vnd+zarr",
76+
"roles": ["data"],
77+
"title": "Aerosol optical thickness (AOT)",
78+
"proj:bbox": [600000.0, 4990200.0, 709800.0, 5100000.0],
79+
"proj:code": "EPSG:32631",
80+
"proj:shape": [10980, 10980],
81+
"proj:transform": [
82+
10.0, 0.0, 600000.0, 0.0, -10.0, 5100000.0, 0.0, 0.0, 1.0
83+
]
84+
},
85+
"SCL_20m": {
86+
"gsd": 20,
87+
"href": "https://esa-zarr-sentinel-explorer-fra.s3.de.io.cloud.ovh.net/tests-output/sentinel-2-l2a-staging/S2A_MSIL2A_20250831T103701_N0511_R008_T31TFL_20250831T145420.zarr/conditions/mask/l2a_classification/r20m/scl",
88+
"type": "application/vnd+zarr",
89+
"roles": ["data"],
90+
"title": "Scene classification map (SCL)",
91+
"proj:bbox": [600000.0, 4990200.0, 709800.0, 5100000.0],
92+
"proj:code": "EPSG:32631",
93+
"proj:shape": [5490, 5490],
94+
"proj:transform": [
95+
20.0, 0.0, 600000.0, 0.0, -20.0, 5100000.0, 0.0, 0.0, 1.0
96+
]
97+
},
98+
"WVP_10m": {
99+
"gsd": 10,
100+
"href": "https://esa-zarr-sentinel-explorer-fra.s3.de.io.cloud.ovh.net/tests-output/sentinel-2-l2a-staging/S2A_MSIL2A_20250831T103701_N0511_R008_T31TFL_20250831T145420.zarr/quality/atmosphere/r10m/wvp",
101+
"type": "application/vnd+zarr",
102+
"roles": ["data"],
103+
"title": "Water vapour (WVP)",
104+
"proj:bbox": [600000.0, 4990200.0, 709800.0, 5100000.0],
105+
"proj:code": "EPSG:32631",
106+
"proj:shape": [10980, 10980],
107+
"proj:transform": [
108+
10.0, 0.0, 600000.0, 0.0, -10.0, 5100000.0, 0.0, 0.0, 1.0
109+
]
110+
},
111+
"thumbnail": {
112+
"href": "https://api.explorer.eopf.copernicus.eu/raster/collections/sentinel-2-l2a-staging/items/S2A_MSIL2A_20250831T103701_N0511_R008_T31TFL_20250831T145420/preview?format=png&rescale=0%2C1&color_formula=gamma+rgb+1.3%2C+sigmoidal+rgb+6+0.1%2C+saturation+1.2&variables=%2Fmeasurements%2Freflectance%2Fr60m%3Ab04&variables=%2Fmeasurements%2Freflectance%2Fr60m%3Ab03&variables=%2Fmeasurements%2Freflectance%2Fr60m%3Ab02&bidx=1",
113+
"type": "image/png",
114+
"roles": ["thumbnail"],
115+
"title": "Sentinel-2 L2A True Color (60m)"
116+
},
117+
"reflectance": {
118+
"gsd": 10,
119+
"href": "https://esa-zarr-sentinel-explorer-fra.s3.de.io.cloud.ovh.net/tests-output/sentinel-2-l2a-staging/S2A_MSIL2A_20250831T103701_N0511_R008_T31TFL_20250831T145420.zarr/measurements/reflectance",
120+
"type": "application/vnd+zarr; version=2; profile=multiscales",
121+
"bands": [
122+
{
123+
"gsd": 20,
124+
"name": "b01",
125+
"proj:shape": [5490, 5490],
126+
"common_name": "coastal",
127+
"description": "Coastal aerosol (band 1)",
128+
"center_wavelength": 0.443,
129+
"full_width_half_max": 0.027
130+
},
131+
{
132+
"gsd": 10,
133+
"name": "b02",
134+
"proj:shape": [10980, 10980],
135+
"common_name": "blue",
136+
"description": "Blue (band 2)",
137+
"center_wavelength": 0.49,
138+
"full_width_half_max": 0.098
139+
},
140+
{
141+
"gsd": 10,
142+
"name": "b03",
143+
"proj:shape": [10980, 10980],
144+
"common_name": "green",
145+
"description": "Green (band 3)",
146+
"center_wavelength": 0.56,
147+
"full_width_half_max": 0.045
148+
},
149+
{
150+
"gsd": 10,
151+
"name": "b04",
152+
"proj:shape": [10980, 10980],
153+
"common_name": "red",
154+
"description": "Red (band 4)",
155+
"center_wavelength": 0.665,
156+
"full_width_half_max": 0.038
157+
},
158+
{
159+
"gsd": 20,
160+
"name": "b05",
161+
"proj:shape": [5490, 5490],
162+
"common_name": "rededge",
163+
"description": "Red edge 1 (band 5)",
164+
"center_wavelength": 0.704,
165+
"full_width_half_max": 0.019
166+
},
167+
{
168+
"gsd": 20,
169+
"name": "b06",
170+
"proj:shape": [5490, 5490],
171+
"common_name": "rededge",
172+
"description": "Red edge 2 (band 6)",
173+
"center_wavelength": 0.74,
174+
"full_width_half_max": 0.018
175+
},
176+
{
177+
"gsd": 20,
178+
"name": "b07",
179+
"proj:shape": [5490, 5490],
180+
"common_name": "rededge",
181+
"description": "Red edge 3 (band 7)",
182+
"center_wavelength": 0.783,
183+
"full_width_half_max": 0.028
184+
},
185+
{
186+
"gsd": 10,
187+
"name": "b08",
188+
"proj:shape": [10980, 10980],
189+
"common_name": "nir",
190+
"description": "NIR 1 (band 8)",
191+
"center_wavelength": 0.842,
192+
"full_width_half_max": 0.145
193+
},
194+
{
195+
"gsd": 60,
196+
"name": "b09",
197+
"proj:shape": [1830, 1830],
198+
"common_name": "nir09",
199+
"description": "NIR 3 (band 9)",
200+
"center_wavelength": 0.945,
201+
"full_width_half_max": 0.026
202+
},
203+
{
204+
"gsd": 20,
205+
"name": "b11",
206+
"proj:shape": [5490, 5490],
207+
"common_name": "swir16",
208+
"description": "SWIR 1 (band 11)",
209+
"center_wavelength": 1.61,
210+
"full_width_half_max": 0.143
211+
},
212+
{
213+
"gsd": 20,
214+
"name": "b12",
215+
"proj:shape": [5490, 5490],
216+
"common_name": "swir22",
217+
"description": "SWIR 2 (band 12)",
218+
"center_wavelength": 2.19,
219+
"full_width_half_max": 0.242
220+
},
221+
{
222+
"gsd": 20,
223+
"name": "b8a",
224+
"proj:shape": [5490, 5490],
225+
"common_name": "nir08",
226+
"description": "NIR 2 (band 8A)",
227+
"center_wavelength": 0.865,
228+
"full_width_half_max": 0.033
229+
}
230+
],
231+
"roles": ["data", "reflectance"],
232+
"title": "Surface Reflectance",
233+
"proj:code": "EPSG:32631",
234+
"proj:shape": [10980, 10980],
235+
"cube:variables": {
236+
"b01": {
237+
"type": "data",
238+
"dimensions": ["y", "x"],
239+
"description": "Coastal aerosol (band 1)"
240+
},
241+
"b02": {
242+
"type": "data",
243+
"dimensions": ["y", "x"],
244+
"description": "Blue (band 2)"
245+
},
246+
"b03": {
247+
"type": "data",
248+
"dimensions": ["y", "x"],
249+
"description": "Green (band 3)"
250+
},
251+
"b04": {
252+
"type": "data",
253+
"dimensions": ["y", "x"],
254+
"description": "Red (band 4)"
255+
},
256+
"b05": {
257+
"type": "data",
258+
"dimensions": ["y", "x"],
259+
"description": "Red edge 1 (band 5)"
260+
},
261+
"b06": {
262+
"type": "data",
263+
"dimensions": ["y", "x"],
264+
"description": "Red edge 2 (band 6)"
265+
},
266+
"b07": {
267+
"type": "data",
268+
"dimensions": ["y", "x"],
269+
"description": "Red edge 3 (band 7)"
270+
},
271+
"b08": {
272+
"type": "data",
273+
"dimensions": ["y", "x"],
274+
"description": "NIR 1 (band 8)"
275+
},
276+
"b09": {
277+
"type": "data",
278+
"dimensions": ["y", "x"],
279+
"description": "NIR 3 (band 9)"
280+
},
281+
"b11": {
282+
"type": "data",
283+
"dimensions": ["y", "x"],
284+
"description": "SWIR 1 (band 11)"
285+
},
286+
"b12": {
287+
"type": "data",
288+
"dimensions": ["y", "x"],
289+
"description": "SWIR 2 (band 12)"
290+
},
291+
"b8a": {
292+
"type": "data",
293+
"dimensions": ["y", "x"],
294+
"description": "NIR 2 (band 8A)"
295+
}
296+
},
297+
"cube:dimensions": {
298+
"x": {
299+
"axis": "x",
300+
"type": "spatial",
301+
"reference_system": "EPSG:32631"
302+
},
303+
"y": {
304+
"axis": "y",
305+
"type": "spatial",
306+
"reference_system": "EPSG:32631"
307+
}
308+
}
309+
}
310+
},
311+
"geometry": {
312+
"type": "Polygon",
313+
"coordinates": [
314+
[
315+
[4.292532035833302, 46.046265456303395],
316+
[5.710544147597723, 46.02142174250963],
317+
[5.663504207768548, 45.034190140253024],
318+
[4.270075671777485, 45.05819732058294],
319+
[4.292532035833302, 46.046265456303395]
320+
]
321+
]
322+
},
323+
"collection": "sentinel-2-l2a-staging",
324+
"properties": {
325+
"gsd": 10.0,
326+
"created": "2025-08-31T14:54:20Z",
327+
"mission": "copernicus",
328+
"sci:doi": "10.5270/S2_-znk9xsj",
329+
"updated": "2025-08-31T14:54:20Z",
330+
"datetime": "2025-08-31T10:37:01.024000Z",
331+
"platform": "sentinel-2a",
332+
"grid:code": "MGRS-31TFL",
333+
"proj:bbox": [
334+
4.270075671777485, 45.034190140253024, 5.710544147597723,
335+
46.046265456303395
336+
],
337+
"proj:code": "EPSG:32631",
338+
"providers": [
339+
{
340+
"url": "https://commission.europa.eu/",
341+
"name": "European Commission",
342+
"roles": ["licensor"]
343+
},
344+
{
345+
"url": "https://sentinel.esa.int/web/sentinel/missions/copernicus",
346+
"name": "ESA",
347+
"roles": ["producer", "processor"]
348+
},
349+
{
350+
"url": "https://zarr.eopf.copernicus.eu/",
351+
"name": "EOPF Sentinel Zarr Samples Service",
352+
"roles": ["host", "processor"]
353+
}
354+
],
355+
"published": "2025-08-31T14:54:20Z",
356+
"instruments": ["msi"],
357+
"end_datetime": "2025-08-31T10:37:01.024000Z",
358+
"product:type": "S02MSIL2A",
359+
"constellation": "sentinel-2",
360+
"eo:snow_cover": 0.0,
361+
"mgrs:utm_zone": 31,
362+
"proj:centroid": { "lat": 45.54146, "lon": 4.98417 },
363+
"eo:cloud_cover": 2.060995,
364+
"start_datetime": "2025-08-31T10:37:01.024000Z",
365+
"sat:orbit_state": "descending",
366+
"eopf:datatake_id": "GS2A_20250831T103701_053230_N05.11",
367+
"mgrs:grid_square": "FL",
368+
"processing:level": "L2A",
369+
"view:sun_azimuth": 159.282875869271,
370+
"mgrs:latitude_band": "T",
371+
"processing:lineage": "IPF L2A processor",
372+
"product:timeliness": "PT3H",
373+
"sat:absolute_orbit": 53230,
374+
"sat:relative_orbit": 8,
375+
"view:sun_elevation": 38.7257833374723,
376+
"processing:facility": "ESA",
377+
"processing:software": { "Sentinel-2 IPF": " " },
378+
"eopf:instrument_mode": "INS-NOBS",
379+
"product:timeliness_category": "NRT",
380+
"sat:platform_international_designator": "2015-028A"
381+
},
382+
"stac_version": "1.1.0",
383+
"stac_extensions": [
384+
"https://stac-extensions.github.io/timestamps/v1.1.0/schema.json",
385+
"https://stac-extensions.github.io/eo/v1.1.0/schema.json",
386+
"https://stac-extensions.github.io/sat/v1.0.0/schema.json",
387+
"https://stac-extensions.github.io/projection/v2.0.0/schema.json",
388+
"https://stac-extensions.github.io/mgrs/v1.0.0/schema.json",
389+
"https://stac-extensions.github.io/grid/v1.1.0/schema.json",
390+
"https://stac-extensions.github.io/view/v1.0.0/schema.json",
391+
"https://stac-extensions.github.io/processing/v1.2.0/schema.json",
392+
"https://stac-extensions.github.io/product/v0.1.0/schema.json",
393+
"https://stac-extensions.github.io/scientific/v1.0.0/schema.json",
394+
"https://cs-si.github.io/eopf-stac-extension/v1.2.0/schema.json",
395+
"https://stac-extensions.github.io/raster/v1.1.0/schema.json"
396+
]
397+
}

0 commit comments

Comments
 (0)