Skip to content

Commit

Permalink
fix: converting poygon to multi polygon only if neccesarry
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivica Matic committed Nov 13, 2023
1 parent 5d2cc72 commit e294527
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e294527

Please sign in to comment.