[1]:
"""
started 6 nov 2023
A Grouazel, based on JR Miadana dev
"""
[1]:
'\nstarted 6 nov 2023\nA Grouazel, based on JR Miadana dev\n'
[2]:
import datetime
import shapely
import geopandas as gpd
import cdsodatacli

define a GeoDataFrame

[3]:
gdf = gpd.GeoDataFrame({
        "start_datetime" : [ datetime.datetime(2022,10,2,0) ,  datetime.datetime(2022,10,13,0) ],
        "end_datetime"   : [ datetime.datetime(2022,10,2,21),  datetime.datetime(2022,10,13,18) ],
        "geometry"   : [ shapely.wkt.loads("POINT (-7.5 53)"),  shapely.wkt.loads("POLYGON ((-12 35, -5 35, -5 45, -12 45, -12 35))")],
        "collection"  : [ "SENTINEL-1", "SENTINEL-2"],
        "name"        : [ None, None],
        "sensormode"  : [ None, None],
        "producttype" : [ None, None],
        "Attributes"  : [ None, None],
        "id_query"    : ['S1example','S2polygon'],
    })

collected_data_norm = cdsodatacli.query.fetch_data(gdf, min_sea_percent=20)
Downloading file 'ne_110m_land.zip' from 'https://naciscdn.org/naturalearth/110m/physical/ne_110m_land.zip' to '/home/runner/.cache/geodatasets'.
/home/runner/work/cdsodatacli/cdsodatacli/cdsodatacli/query.py:914: UserWarning: Geometry is in a geographic CRS. Results from 'area' are likely incorrect. Use 'GeoSeries.to_crs()' to re-project geometries to a projected CRS before this operation.

  collected_data.geometry.area
/home/runner/work/cdsodatacli/cdsodatacli/cdsodatacli/query.py:915: UserWarning: Geometry is in a geographic CRS. Results from 'area' are likely incorrect. Use 'GeoSeries.to_crs()' to re-project geometries to a projected CRS before this operation.

  - collected_data.geometry.intersection(earth.unary_union).area
/home/runner/work/cdsodatacli/cdsodatacli/cdsodatacli/query.py:917: UserWarning: Geometry is in a geographic CRS. Results from 'area' are likely incorrect. Use 'GeoSeries.to_crs()' to re-project geometries to a projected CRS before this operation.

  / collected_data.geometry.area
[4]:
collected_data_norm.head()
[4]:
@odata.mediaContentType Id Name ContentType ContentLength OriginDate PublicationDate ModificationDate Online EvictionDate S3Path Checksum ContentDate Footprint GeoFootprint Attributes id_original_query geometry sea_percent
93 application/octet-stream 036c7c34-dcd5-4e50-b1c1-c48a229dbc37 S2A_MSIL2A_20221013T111011_N0510_R137_T29SQU_2... application/octet-stream 1073335509 2025-03-21T20:48:29.526000Z 2025-04-05T21:12:29.865181Z 2025-04-05T21:12:29.865181Z True 9999-12-31T23:59:59.999999Z /eodata/Sentinel-2/MSI/L2A_N0500/2022/10/13/S2... [{'Value': 'e00637d4e1bf8b1b0ece0c3c80142e19',... {'Start': '2022-10-13T11:10:11.024000Z', 'End'... geography'SRID=4326;POLYGON ((-6.8028975671597... {'type': 'Polygon', 'coordinates': [[[-6.80289... [{'@odata.type': '#OData.CSC.StringAttribute',... S2polygon POLYGON ((-6.8029 35.22313, -6.82894 34.2337, ... 24.846154
91 application/octet-stream f5e9137d-2bc6-4c1b-b6d5-1a0e50444cc1 S2A_MSIL2A_20221013T111011_N0510_R137_T30TUP_2... application/octet-stream 853795556 2025-03-21T20:48:30.542000Z 2025-04-05T21:12:20.047719Z 2025-04-05T21:12:20.047719Z True 9999-12-31T23:59:59.999999Z /eodata/Sentinel-2/MSI/L2A_N0500/2022/10/13/S2... [{'Value': '5c470b724593095c62dfb8b37a0abd08',... {'Start': '2022-10-13T11:10:11.024000Z', 'End'... geography'SRID=4326;POLYGON ((-5.5040714070962... {'type': 'Polygon', 'coordinates': [[[-5.50407... [{'@odata.type': '#OData.CSC.StringAttribute',... S2polygon POLYGON ((-5.50407 44.22596, -5.46323 43.23826... 76.801415
92 application/octet-stream ce9592ff-6e87-46d7-82d9-ae4ac8a53b7f S2A_MSIL2A_20221013T111011_N0510_R137_T30TUQ_2... application/octet-stream 805327544 2025-03-21T20:48:30.573000Z 2025-04-05T21:11:22.035914Z 2025-04-05T21:11:22.035914Z True 9999-12-31T23:59:59.999999Z /eodata/Sentinel-2/MSI/L2A_N0500/2022/10/13/S2... [{'Value': '7d2ac3cd44f2a6adb1665e9fe609883c',... {'Start': '2022-10-13T11:10:11.024000Z', 'End'... geography'SRID=4326;POLYGON ((-5.5312609072621... {'type': 'Polygon', 'coordinates': [[[-5.53126... [{'@odata.type': '#OData.CSC.StringAttribute',... S2polygon POLYGON ((-5.53126 44.85138, -5.50035 44.138, ... 100.000000
83 application/octet-stream 51c6817b-bd79-4f51-8e52-494ed4133414 S2A_MSIL2A_20221013T111011_N0510_R137_T29TQK_2... application/octet-stream 327227168 2025-03-21T20:48:29.821000Z 2025-04-05T21:09:19.827827Z 2025-04-05T21:09:19.827827Z True 9999-12-31T23:59:59.999999Z /eodata/Sentinel-2/MSI/L2A_N0500/2022/10/13/S2... [{'Value': '0366fec8a1410e70f362d7e8603fd712',... {'Start': '2022-10-13T11:10:11.024000Z', 'End'... geography'SRID=4326;POLYGON ((-5.7777125094904... {'type': 'Polygon', 'coordinates': [[[-5.77771... [{'@odata.type': '#OData.CSC.StringAttribute',... S2polygon POLYGON ((-5.77771 44.11785, -5.13001 44.09977... 100.000000
90 application/octet-stream aabb05a6-f728-4ee8-baad-9865d7faa020 S2A_MSIL2A_20221013T111011_N0510_R137_T29SQA_2... application/octet-stream 1044396139 2025-03-21T20:48:29.314000Z 2025-04-05T21:09:19.354210Z 2025-04-05T21:09:19.354210Z True 9999-12-31T23:59:59.999999Z /eodata/Sentinel-2/MSI/L2A_N0500/2022/10/13/S2... [{'Value': 'dc68bc5266be6608f87c2ce2b0d44849',... {'Start': '2022-10-13T11:10:11.024000Z', 'End'... geography'SRID=4326;POLYGON ((-6.7520694569753... {'type': 'Polygon', 'coordinates': [[[-6.75206... [{'@odata.type': '#OData.CSC.StringAttribute',... S2polygon POLYGON ((-6.75207 37.02528, -6.78053 36.03618... 39.204398