From e29452757c1b4729da24c764d410592755953ca3 Mon Sep 17 00:00:00 2001 From: Ivica Matic Date: Mon, 13 Nov 2023 15:41:41 +0000 Subject: [PATCH] fix: converting poygon to multi polygon only if neccesarry --- scrape.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scrape.py b/scrape.py index 4cfff20..dd223d4 100644 --- a/scrape.py +++ b/scrape.py @@ -202,10 +202,12 @@ def check_if_sas_token_is_present_for_collection_on_mpc(_collection_id: str) -> mpc_token_obtaining_url = token_url - # convert shapely_multipolygon_envelope to MultiPolygon - shapely_multipolygon_envelope = shapely.geometry.multipolygon.MultiPolygon( - [shapely_multipolygon_envelope] - ) + # convert shapely_multipolygon_envelope to MultiPolygon if it is not multipolygon + if not isinstance(shapely_multipolygon_envelope, shapely.geometry.multipolygon.MultiPolygon): + shapely_multipolygon_envelope = shapely.geometry.multipolygon.MultiPolygon( + [shapely_multipolygon_envelope] + ) + store_collection_in_database( results_catalog_url, results_collection_id,