PyDrive Support¶
As demonstrated in the example notebook, zonal statistics can be submitted as tasks using Earth Engine's ee.batch.Export.table.toDrive
feature. This is generally preferred when running large computations, or trying to batch several tasks in parallel.
The ZonalStats
object contains a function getZonalStats()
to retrieve the resulting table directly from Google Drive using pydrive.
This requires additional configuration to provide access to Google Drive. First, the pydrive package needs to be installed.
1 |
|
Setup¶
Follow the instructions to obtain a client configuration file client_secrets.json
.
One additional step required is go to Audience and add your email as a test user. Otherwise, you will have to publish the application.
Place the client_secrets.json
file in a folder such that the authenticateGoogleDrive()
function can find it. By default the function looks for the file in ~/.config/creds/client_secrets.json
. You can change this by passing the creds_dir
argument to the function.
Usage¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|