Commit f1dd45d5 authored by Gaetano Raffaele's avatar Gaetano Raffaele
Browse files

MOD: api_key no longer available in Planetary

parent 1421a770
No related merge requests found
Showing with 6 additions and 4 deletions
+6 -4
......@@ -11,9 +11,10 @@ import otbApplication as otb
import json
from Common.geotools import get_query_bbox
def fetch(shp, dt, output_fld, api_key, direction=None):
def fetch(shp, dt, output_fld, api_key=None, direction=None):
os.environ['PC_SDK_SUBSCRIPTION_KEY'] = api_key
if api_key is not None:
os.environ['PC_SDK_SUBSCRIPTION_KEY'] = api_key
bbox, i_bbox, shp_srs = get_query_bbox(shp, return_all=True)
api = Client.open('https://planetarycomputer.microsoft.com/api/stac/v1', modifier=PC.sign_inplace)
......
......@@ -106,8 +106,9 @@ def preprocess_s1(in_fld, roi, out_fld, dem_fld=None, geoid=None, direction=None
def fetch(imagery, shp, out_fld, dt=None, auth=None, only_tiles=None):
assert(imagery in ['s2theia', 's2planetary', 's1grd', 's1rtc', 'planetmosaics', 'cop-dem-glo-30', 'nasadem', 'landsatplanetary'])
if imagery not in ['s2planetary', 'cop-dem-glo-30', 'nasadem'] and auth is None:
raise ValueError("Please provide authentication information.")
# Seems that Planetary don't need api _keys anymore
#if imagery not in ['s2planetary', 'cop-dem-glo-30', 'nasadem'] and auth is None:
# raise ValueError("Please provide authentication information.")
if imagery not in ['cop-dem-glo-30', 'nasadem'] and dt is None:
raise ValueError("Please provide date range option.")
if imagery == 's2theia':
......
Supports Markdown
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