'How to download image data ? #138
Replies: 2 comments
-
Don't work in GIS, but isn't GEE and planetary computer all about promoting a different kind of workflow where you don't download huge datasets and do your analysis in the cloud instead? But if for whatever reason you have to do it this way and download all the data, maybe the code below will work? (Haven't tested it though. Also would you hit planetary computer's storage limit by downloading the whole dataset?)
|
Beta Was this translation helpful? Give feedback.
-
In general, we recommend accessing the data from where it's at in Blob Storage. This approach works well regardless of the size of the dataset (you likely can't download / store all of sentinel-2, for example). That said, once you have the HREFs to the data you can do whatever you want with the data, including downloading it to a local disk: In [1]: import planetary_computer, pystac_client
In [2]: catalog = pystac_client.Client.open("https://planetarycomputer.microsoft.com/api/stac/v1/", modifier=planetary_computer.sign_inplace)
In [3]: chloris = catalog.get_collection("chloris-biomass")
In [4]: items = chloris.get_all_items()
In [5]: item = next(items) # or use a for loop
In [6]: import urllib.request
In [7]: filename, _ = urllib.request.urlretrieve(item.assets["biomass"].href) That's an example getting a single file from a single item. You can iterate over all the assets of all the items if necessary (but again, we generally recommend just accessing the data from our blob storage). |
Beta Was this translation helpful? Give feedback.
-
dear guys,
see that you have posted a lot of case tutorials for Microsoft Planet, but there are no downloadable cases.
Now, I would like to download this data( Chloris Global Biomass 2003–2019 dataset). Can you give me some simple download examples?
https://planetarycomputer.microsoft.com/dataset/chloris-biomass
thanks
Beta Was this translation helpful? Give feedback.
All reactions