diff --git a/src/openeo_gfmap/utils/catalogue.py b/src/openeo_gfmap/utils/catalogue.py index 8199de1..d20648b 100644 --- a/src/openeo_gfmap/utils/catalogue.py +++ b/src/openeo_gfmap/utils/catalogue.py @@ -1,7 +1,6 @@ """Functionalities to interract with product catalogues.""" - +import geojson import requests -from geojson import GeoJSON from pyproj.crs import CRS from rasterio.warp import transform_bounds from shapely import unary_union @@ -131,10 +130,14 @@ def s1_area_per_orbitstate( Keys containing the orbit state and values containing the total area of intersection in km^2 """ - if isinstance(spatial_extent, GeoJSON): + if isinstance(spatial_extent, geojson.FeatureCollection): # Transform geojson into shapely geometry and compute bounds - bounds = shape(spatial_extent).bounds - epsg = 4362 + shapely_geometries = [ + shape(feature["geometry"]) for feature in spatial_extent["features"] + ] + geometry = unary_union(shapely_geometries) + bounds = geometry.bounds + epsg = 4326 elif isinstance(spatial_extent, BoundingBoxExtent): bounds = [ spatial_extent.west,