From 4baddd9bfa03b6d945ef8da0d9d0595911267d1c Mon Sep 17 00:00:00 2001 From: Lozac'h Loic <loic.lozach@irstea.fr> Date: Fri, 3 Sep 2021 14:27:03 +0200 Subject: [PATCH] geomsearch --- frozenapp/eodags1.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/frozenapp/eodags1.py b/frozenapp/eodags1.py index 025fb4b..1306654 100644 --- a/frozenapp/eodags1.py +++ b/frozenapp/eodags1.py @@ -54,8 +54,11 @@ class EodagS1(): # geomwgs84 = Transform(qs_tile[0].geom, 4326) logger.info(qs_tile[0].wgs84) - mpolywkt= str(qs_tile[0].wgs84.ewkt).split(";") - #print(mpolywkt[1]) + if prodtypenum == 0: + geomsearch = str(qs_tile[0].wgs84.ewkt).split(";")[1] + elif prodtypenum in [1,2]: + geomsearch = str(qs_tile[0].wgs84.centroid.ewkt).split(";")[1] + product_types = ['S1_SAR_GRD','S2_MSI_L2A','S2_MSI_L3A_WASP'] @@ -69,7 +72,7 @@ class EodagS1(): productType=product_types[prodtypenum], start=startdate, end=enddate, - geom=mpolywkt[1] + geom=geomsearch ) logger.info( @@ -82,7 +85,7 @@ class EodagS1(): productType=product_types[prodtypenum], start=startdate, end=enddate, - geom=mpolywkt[1] + geom=geomsearch ) logger.info( @@ -130,13 +133,12 @@ class EodagS1(): elif prodtypenum == 2: logger.info("Search on Theia...") self.mEODataAccessGateway.set_preferred_provider("theia") - mcentrowkt= str(qs_tile[0].wgs84.centroid.ewkt).split(";") products_theia, estimated_theia_of_results = self.mEODataAccessGateway.search( productType=product_types[prodtypenum], start=startdate, end=enddate, - geom=mcentrowkt[1] + geom=geomsearch ) logger.info( f"The THEIA search has found an estimated number of {estimated_theia_of_results} products matching your criteria " -- GitLab