intake-stac
intake-stac copied to clipboard
rasterio driver - authentication
I really like intake-stac and together with xpublish it becomes a very powerful solution :-)
- Open Assets
The example shown in the notebook using Landsat data @AWS is great. The assets are freely available and thus rasterio simply accesses those resources using the href
- Assets requiring authentication
I've got a use-case where the assets require a simple authentication mechanism. With such cases, I usually update the href for rasterio with:
def get_vsi_url(enclosure, username, api_key):
parsed_url = urlparse(enclosure)
url = '/vsicurl/%s://%s:%s@%s/api%s' % (list(parsed_url)[0],
username,
api_key,
list(parsed_url)[1],
list(parsed_url)[2])
return url
Would such an approach be possible with intake-stac ?
We should definitely be able to make this happen. How would you access one of these assets using rasterio
directly. The call stack in intake-stac goes like this: intake-stac
-> intake-xarray
-> xarray
-> rasterio
. We'll just need to make sure we can pass the required authentication parameters all the way through that stack.