sentinel-hub / sentinelhub-py

Download and process satellite imagery in Python using Sentinel Hub services.
http://sentinelhub-py.readthedocs.io/en/latest/
MIT License
798 stars 243 forks source link

[HELP] Downloading full resolution for entire US State #503

Closed melgor closed 7 months ago

melgor commented 7 months ago

Question I struggle with migrating to SentinelHub API for downloading satellite images. My use case:

Additional context

1st attempt

I just used the migration guide. It was working perfectly. But as I encountered many images like those below, I decided to download specific products and check the nb of NaNs. If too much NaNs, download them next. But the 100-session limit makes it not usable for me ( as I check one by one each tile from US state, don't want to download all product from state and then check them)

Screenshot 2023-12-01 at 10 03 30

2nd attempt

I decided to check the newer API, without calling it by request. There are so many new APIs there, tried to figure our pipeline for myself. I mainly followed Catalog API + Process API Here it is:

  1. Use TileSplitter to get BBoxes per tile.
  2. Use SentinelHubCatalog to find products for given BBoxes and time-interval
  3. Use SentinelHubRequest + SentinelHubDownloadClient

Issues:

  1. I'm not able to specify a resolution of 10m/px per BBox as it will result in 10980x10980 where max is 2500
  2. Even if I would download it, I'm not sure how it relates to product names. I would like to have them also

Summary

The question is: how to download full-resolution satellite images, best with their product names? Is S3-bucker the way to go?

willrayeo commented 7 months ago

Hi, I'm not sure which migration guide you're referring to? Perhaps this one? If so, I recommend asking your question in the community forum which you can find here

melgor commented 7 months ago

Yes, exactly this one migration guide. But I have no issue with migration, just a limit of 100 sessions stops me from running batch queries. I just wanted to present whole story.

The main question in this issue is: How to download full-resolution satellite images (10kx10k, 10m/px resolution), using sentinelhub-py?

gmilcinski commented 7 months ago

Have you tried large area utilities example? https://sentinelhub-py.readthedocs.io/en/latest/examples/large_area_utilities.html/v1/catalog/1.0.0/search

melgor commented 7 months ago

I tried https://github.com/sentinel-hub/sentinelhub-py/blob/master/examples/large_area_utilities.ipynb But still, it does not allow to download 10k x 10k products. Still, I could hop single product to multiple images and merge them on my side but I'm just curious if there is any other method. Now I'm testing just getting products directly from S3 and works fine for me.


return SentinelHubRequest(
        evalscript=ndvi_eval,
        input_data=[
            SentinelHubRequest.input_data(
                data_collection=DataCollection.SENTINEL2_L2A,
                time_interval=("2020-10-01", "2022-10-13"),
                mosaicking_order=MosaickingOrder.LEAST_CC,
            )
        ],
        responses=[SentinelHubRequest.output_response("default", MimeType.TIFF)],
        bbox=bbox,
        size=(1250, 1250),  #-> here I want to 10k x 10k 
        data_folder=tempfile.gettempdir(),
        config=config,
    )```
gmilcinski commented 7 months ago

Depends what you want to do. If you just want a full scene, then downloading it from S3 is probably easiest. If you need something more advanced, then you will have to stich the images together.

melgor commented 7 months ago

Thanks for help. I'm really pleased with help from you guys and descent code documents.