Closed ChHarding closed 4 years ago
Use the .unmask()
function after clipping. It should be able to export the image clipped to the polygon.
clipped_image = image.clip(roi).unmask()
yes, that works! Thank you very much!
If I can ask a followup question: Is there a way to set the “outside” polygon value to a specific value. 0 works for me most of the time but there’s a tiny chance that some valid inside pixels also have a 0 value, so it’d be nice to be able to use say -999999 for outside instead of 0
Cheers
Chris
On Jun 18, 2020, at 20:28, Qiusheng Wu notifications@github.com wrote:
Use the .unmask() function after clipping. It should be able to export the image clipped to the polygon.
clipped_image = image.clip(roi).unmask() https://camo.githubusercontent.com/d144625bf7bd53e48903646b99985802a63fdcc0/68747470733a2f2f692e696d6775722e636f6d2f784475594a6c672e676966 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/giswqs/geemap/issues/96#issuecomment-646385309, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYDF5JPNCEWIWQOYHDYI3LRXK5MZANCNFSM4OAAMQYQ.
Chris Harding Associate Professor Department of Geological & Atmospheric Sciences
TouchTerrain.geol.iastate.edu
You can try the unmask()
function by setting the value parameter and export a rectangular area.
yes, unmask(-9999, False) worked, thank you very much!
On Jun 19, 2020, at 15:20, Qiusheng Wu notifications@github.com wrote:
You can try the unmask() function by setting the value parameter and export a rectangular area.
https://camo.githubusercontent.com/62bee05b00e9e1731b0928325251a495c0b9fbd7/68747470733a2f2f692e696d6775722e636f6d2f52514c4f5848612e706e67 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/giswqs/geemap/issues/96#issuecomment-646846400, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYDF5K2STQSDIIFIX7R2FDRXPCA7ANCNFSM4OAAMQYQ.
Chris Harding Associate Professor Department of Geological & Atmospheric Sciences
TouchTerrain.geol.iastate.edu
Description
Starting with https://github.com/giswqs/geemap/blob/master/examples/notebooks/11_export_image.ipynb , I tried to first clip an image with a polygon and then export it.
The clipped image shows up properly clipped and the download works.
However, the downloaded tif files are not clipped, i.e. the "outside" pixels are not 0 or invisible.
What I Did
The notebook, screenshots of the clipped image inside the online map and the un-clipped downloaded tiffs are here: https://iastate.box.com/s/6j7gk7uzn3mhi7nocmphfzmndbaewoot
I've not used ee a lot and expect that I'm missing something (obvious). Could you tell me what I'm doing wrong?