DigitalGlobe / CloudServices

Cloud Services
16 stars 16 forks source link

Unable to download SkySat imagery using get_full_res_image #35

Open Godsinred opened 6 days ago

Godsinred commented 6 days ago

https://github.com/DigitalGlobe/CloudServices/blob/6c30ab43e38ea84a4fca9ac2dda52a5f8256f799/ogc-sdk/src/Maxar_OGC/interface.py#L400

Unable to find featureid in get_full_res_image search without specifying bbox in search on lines 400 and 495 in interface.py. This issue appears for SkySat imagery and not Maxar

example featureid: ea9c4b0ca7e2adb076215782cfac0ae179cb1c3cd4b9cc754663acba0622df0c

Godsinred commented 6 days ago

Minimal reproducible code

from Maxar_OGC import Interface
from Maxar_OGC.auth import Auth

sw_ogc = Interface()
auth = Auth()

search_filter = "(acquisitionDate>='2022-11-21')AND(acquisitionDate<='2026-11-20')AND((source='SkySat'))AND(cloudCover<0.1)"
bbox = "11.97359971457871, 38.96869878226671, 11.97640009468649, 38.991300302205985"

response = sw_ogc.wfs.search(
    bypass_cql_checking=True,
    filter=search_filter,
    bbox=bbox,
    version="2.0.0",
    startIndex=0,
    count=10_000,
)

results = response.json()
first_feature = results["features"][0]
print(first_feature['id'])

feat_id = first_feature["id"]
outdir = "."
sw_ogc.get_full_res_image(
    featureid=feat_id,
    mosaic=True,
    outputdirectory=outdir,
    image_format="geotiff",
    bbox=bbox,
)