S2L1CWCSInput to WcsRequest or Other Method?

Hi everyone,

I was importing and creating EO Patches the following way.

Defined input_task as:
input_task = S2L1CWCSInput(layer = 'BANDS-S2-L1C',resx='10m', resy='10m', maxcc=1.0)

And then later used it in:

    # define workflow
    workflow=LinearWorkflow(input_task, true_color, add_ndvi, add_ndwi, add_fdi, cloud_classifier_task, water_detection, combine_mask, save)
    
    # run workflow
    result = workflow.execute({input_task: {'bbox': bbox, 'time_interval': time_interval},
            save: {'eopatch_folder': 'eopatch'}})
    patch = result.eopatch()
    return patch

Which was used in a loop to get many patches in an area, therefore providing a specific bbox each time.

I paused working on the project for a couple of weeks (didn’t change anything) and it feels like everything has fallen apart. S2L1CWCSInput no longer loads from eo-learn. I figured there’s also WcsRequest, so I changed my code to define input_task within my loop the following way:

# input task 
    # PROBLEM HAPPENS HERE!
    input_task = WcsRequest(data_collection=DataCollection.SENTINEL2_L1C, layer = 'BANDS-S2-L1C', bbox=bbox, resx='10m', resy='10m', maxcc=1.0, time=time_interval)
    print(bbox)   

    # define workflow
    workflow=LinearWorkflow(input_task, save)

    # run workflow
    result = workflow.execute({save: {'eopatch_folder': 'eopatch'}})
    patch = result.eopatch()
    return patch

However, this doesn’t seem to work. The problem definitely seems to be with input_task, since my loop quits there (doesn’t print anything after that), but I’m not quite sure as I’m not getting an error message.

Am I using this totally incorrectly? Apologies if this is a basic question. :frowning:

I’ve been banging my head against the wall on how exactly to modify and fix this… thought I would ask. Any helpful pointers would be much appreciated!!

Thank you very much in advance!!

Anna

Hi @papprika,

You might have been unlucky, and restarted with eo-learn after a rather large change. We’ve (for quite some time) deprecated the OGC input tasks, and recently completely removed them. We have replaced them with the tasks that use Processing API of the Sentinel Hub.

In short, with the latest eo-learn you should replace your input task with:

input_task = SentinelHubInputTask(
    data_collection=DataCollection.SENTINEL2_L1C,
    bands=['B01','B02','B03','B04','B05','B06','B07','B08','B8A','B09','B10','B11','B12'],
    bands_feature=(FeatureType.DATA, 'L1C_data'),
    additional_data=[(FeatureType.MASK, 'dataMask')],
    resolution=resolution,
    maxcc=maxcc,
    time_difference=time_difference,
    config=config,
    max_threads=3
)

Please have a look at the example in our docs.

Best of luck,
Matej

Thank you so much, this was very helpful! I figured out how to make a bunch of the updates that were needed as I was using some other deprecated tasks. :slight_smile: Thanks again, appreciate the quick response!