Commit a5d4d557 authored by Irving David's avatar Irving David

filtro de L2A y L1C en busqueda de front end

parent 7a1d7f42
......@@ -109,14 +109,31 @@ def productList(request):
## getting the bounding box of the polygon
pol_bbox = polygonToBox.getWKTPolygonBoundingBox(area, True)
##producttype:
type = " "
print(process)
if process == str(1):
type = "S2MSI1C"
if process == str(2):
type = "S2MSI2A"
## requesting producto to sentinel api
##products = sentinel.getProducts(pol_bbox, date, params)
products = sentinel.getProducts(pol_bbox, date,
{"platformname": "Sentinel-2", "cloudcoverpercentage": cloud_percentage},
"Contains") ##intenta obtener los productos que contienen el polígono
{"platformname": "Sentinel-2", "producttype": type, "cloudcoverpercentage": cloud_percentage},"Contains") ##intenta obtener los productos que contienen el polígono
if len(products) <= 0:
products = sentinel.getProducts(pol_bbox, date, {"platformname": "Sentinel-2",
"cloudcoverpercentage": cloud_percentage}) ## si no hay que contengan el polígono busca los que lo intersecan
products = sentinel.getProducts(pol_bbox, date, {"platformname": "Sentinel-2", "producttype": type,"cloudcoverpercentage": cloud_percentage}) ## si no hay que contengan el polígono busca los que lo intersecan
##--
## requesting producto to sentinel api
##products = sentinel.getProducts(pol_bbox, date, params)
#~ products = sentinel.getProducts(pol_bbox, date,
#~ {"platformname": "Sentinel-2", "cloudcoverpercentage": cloud_percentage},
#~ "Contains") ##intenta obtener los productos que contienen el polígono
#~ if len(products) <= 0:
#~ products = sentinel.getProducts(pol_bbox, date, {"platformname": "Sentinel-2",
#~ "cloudcoverpercentage": cloud_percentage}) ## si no hay que contengan el polígono busca los que lo intersecan
## path from image preview storage location
img_preview = '/static/images/sat_preview/sat_test.jpg'
......@@ -551,7 +568,7 @@ def Pay(request):
fidProductsFile.write(json_data)
fidProductsFile.close()
os.system(SENTINEL_PATH + "/tools/L2ASCL_AreaProcessing.sh " + purchase_dir + "/ 1 > " + purchase_dir + "/L2ASCL_AreaProcessing.log") ###ejecuta el proceso
os.system(SENTINEL_PATH + "/tools/L2ASCL_AreaProcessing.sh " + purchase_dir + "/ 0 > " + purchase_dir + "/L2ASCL_AreaProcessing.log") ###ejecuta el proceso
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment