Getting a georeferenced tiff from python api

Hi all,
I’m trying to download a geotiff (rather than using the arrayed output of SentinelHubRequest.get_data() ) , but this doesn’t seem to be possible?

I have set data_folder in my SentinelHubRequest function, but all that’s downloaded is a .tiff file with no coordinates. Does anybody know a way to do this?

Hi Robbie,

In the SentinelHub python package, there is a function to directly download the data: SentinelHubRequest.save_data() (see here). As you correctly noted, the data_folder parameter needs to be passed to the request.

You can also do: SentinelHubRequest.get_data(save_data=True), which is what I guess you have been trying? I’m surprised to hear that you have a non-georeferenced tiff returned. Have you specified the following in your request (as shown here)?

responses=[SentinelHubRequest.output_response('default', MimeType.TIFF)]

Maxim

Hi Maxim,
I am reading the forum for a project I am associated with (as part of Omdena), and I just would like to know if the example you referenced (to the example pages) is only working when you have an API client id and key; I presume it does.

The project is still in the data exploration phase, and they might want to use Sentinel 2 data or Landsat over selected areas (using a BBox function before saving the bands).

Would the API be the best way of doing this, or can this also be done with a V3 script? I understand this is slightly off-topic, but still related to transferring selected data from the server to a local drive.

Thanks in advance for your time looking at this.
Gijs

Hi Gijs,

I am reading the forum for a project I am associated with (as part of Omdena), and I just would like to know if the example you referenced (to the example pages) is only working when you have an API client id and key; I presume it does

Indeed, you need API credentials to run the examples on the Sentinel Hub Python documentation page. The configuration page explains how to set up the system. To obtain credentials, you can sign up for a free trial or take a look at the pricing page. If you project is research oriented, you could also consider applying for a sponsored account through ESA’s NoR program.

Would the API be the best way of doing this, or can this also be done with a V3 script?

I would say it depends what you want to do and what tools you are using. The API (using Python or REST commands) is going to be efficient to fetch data in a flexible, scalable programmatic way. If you only need a few images, you can download them manually through EO Browser, but you will be quickly limited.

Thanks, Maxim,
I was thinking along the same lines, that an API would be the most efficient; unfortunately, the development time is too short of applying for an ESA license, and while this is a volunteering project, the end-user is a commercial entity, so using the trial version is not an option (because we would be enforcing a service and introducing a dependency).

I will see what the workload is, test/demo some images through the scripting facility - under ten is not too bad - and see if I can do something with the RGB channels.

Thanks again for confirming, and I hope we can work together on the next project.
Gijs

Note that if you are using EO Browser for commercial purposes, you should as well subscribe to Sentinel Hub, i.e. Basic or Enterprise license.

Thanks for the warning Grega,
I am aware of the conditions, and I don’t think that I am violating the terms while working on this volunteering (not-for-profit) project.

However, I was going to bring this up, with the team, when working with the scripting service becomes an integral part of the research work, and definitely when the project is over and we present our findings. The project has no control over the next steps, and we can only advise how to proceed, that’s why I don’t think integrating the API (with a trial version) is a good idea because this will force a dependency on the project.

More than happy to continue this conversation outside of the thread because it’s slightly off-topic.

Cool, we trust you making the right decisions. No need for further conversation on this, we prefer to focus on what can be done not “under which conditions…”.