Skip to content

Conversation

joferkington
Copy link
Contributor

Permission for mosaic quad download often varies spatially for a given user. It's common for someone to have access to some quads within an AOI but not all. Currently, when a user tries to download quads they don't have access to the client raises an unexpected error:

ERROR - unexpected error in <planet.api.downloader._MosaicDownloadStage object at 0x10d87b240> Traceback (most recent call last):   File
"~/pl/planet-client-python/planet/api/downloader.py", line 159, in _process_task     self._do(self._doing)   File "/~/pl/planet-client-
python/planet/api/downloader.py", line 471, in _do     self._client.download_quad(task, writer)))   File "~/pl/planet-client-python/planet/api/client.py", line
363, in download_quad     download_url = quad['_links']['download'] KeyError: 'download'

This PR changes client.download_quad to raise a NoPermission error when that occurs and changes the planet mosaics download command (and associated downloader infrastructure) to skip mosaic quads that a user does not have permission for during downloading.

@sarasafavi
Copy link
Contributor

thanks @joferkington !

@sarasafavi sarasafavi merged commit ef8a271 into master Apr 1, 2021
@jreiberkyle jreiberkyle deleted the skip_quads_with_no_download_access branch April 25, 2022 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants