QGIS plug in error for BYOC data

I attempted to display some BYOC data (ordered Pleiades data) using the QGIS SentinelHub plugin. I get the following error:

KeyError: ‘CUSTOM’
Traceback (most recent call last):
File “C:/Users/<>/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SentinelHub\SentinelHub.py”, line 679, in add_qgis_layer
self.update_parameters()
File “C:/Users/<>/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SentinelHub\SentinelHub.py”, line 805, in update_parameters
self.update_selected_layer()
File “C:/Users/<>/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SentinelHub\SentinelHub.py”, line 836, in update_selected_layer
self.base_url = Settings.data_source_props[self.data_source][‘url’]
KeyError: ‘CUSTOM’

I assume custom/BYOC layers do not work through the plug in?
Will this be addressed?

Cheers
Sam

I also notice that trying to download a BYOC image in EO Browser doesn’t work:
The following request is generated but fails:
https://services.sentinel-hub.com/ogc/wms/3dac5205-5038-xxxxxxxx?SERVICE=WMS&REQUEST=GetMap&SHOWLOGO=false&MAXCC=100&TIME=2018-07-21%2F2018-07-21&CRS=EPSG%3A3857&FORMAT=image%2Ftiff%3Bdepth%3D16&BBOX=xxxxxxxx&evalscriptoverrides=&LAYERS=PLEIADES_PTCI&WIDTH=3583&HEIGHT=2126&NICENAME=Pleiades+from+2018-07-21.tiff&COVERAGE

message:

The EO Browser error is due to Sentinel Hub’s new limits of the largest request size to 2500x2500 px (yours is 3583), which are not yet properly propagated as an error, nor is this new limit implemented in EO Browser yet. Both is being worked on.
If you reduce the size, you should get results.

We do have in plans (mid-term) to have a dedicated support for such large requests.

QGIS Plugin was not yet updated to support BYOC layers, sorry about that.
We have to omany components now and they cannot all be developed fast enough to be available in parallel. But it will come.

Thanks for the quick response as always.
re: QGIS plugin - no problem, for me its not a priority - I just noticed it.
re: EO Browser - understood, I will try it.

In the end what I was trying to do is simply get a tiff file of the whole Pleiades image I had ordered - is it possible to do that some other way?

There are several ways to do that:

  • you can use the “Draw area of interest” tool to outline your image so that you download only the relevant part, not the full window extent (which is larger than an image)
  • use “Large area facilities” in our Python package
  • send us an e-mail and we will send you the original JP2 file (it’s yours so you can have it)

Ok, I will use the large area python approach in future, but I’ll send you an email this time.
Thanks again

Back to QGIS and BYOC:

By putting in an instance id linked to a BYOC dataset, I successfully broke the plugin:
Each time I tried to open the plug-in, it would crash (“CUSTOM” key not in the settings "data_source_props " dictionary). As the instance id is stored somewhere (I couldn’t find where), it would crash any time I tried to start the plugin. Re-installing didn’t fix it either.

I fixed it by simply adding the following lines to the Settings.py, data_source_props dictionary:
‘CUSTOM’: {‘url’: services_base_url,
‘wfs_name’: ‘DSS10’,
‘pretty_name’: ‘BYOC’}
Now it not only doesn’t crash when trying to start the plug in, but it also successfully shows BYOC data using the plugin!
If the fix is that simple, perhaps it can be added to the plugin properly?

Cheers
Sam

Hi @barrett,

Thank you for reporting the experienced error and your quick fix. This is always really helpful and appreciated!

Fixing the QGIS plugin is unfortunately not our top priority at the moment. Even though we would want to and noted your finding for later, we cannot commit right now. However, contributions in form of pull requests are more than welcome!

Best, Max

Hi @barrett,

This issue has now been solved in the newly released plugin version 2.0.0.

At the end, we decided to take a bit different solution. Switching to authentication with OAuth client enabled us to query a configuration API which provides information about data sources. This way we don’t have to hardcode such information in th plugin anymore. Hopefully this solution will be more sustainable in the future when more data sources are added.

1 Like