{"id":16778065,"url":"https://github.com/lopezvoliver/eetasks-examples","last_synced_at":"2025-03-16T19:25:47.769Z","repository":{"id":209455777,"uuid":"724082696","full_name":"lopezvoliver/eetasks-examples","owner":"lopezvoliver","description":"Sample GEE scripts for the vscode EE tasks extension","archived":false,"fork":false,"pushed_at":"2024-11-29T08:47:35.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T06:11:23.860Z","etag":null,"topics":["earthengine","eetasks","google-earth-engine"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lopezvoliver.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-27T11:10:22.000Z","updated_at":"2024-12-06T21:06:53.000Z","dependencies_parsed_at":"2023-11-30T13:51:25.618Z","dependency_job_id":null,"html_url":"https://github.com/lopezvoliver/eetasks-examples","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"9c07550a9950ddb33fb5e25cc273db1b458b63d1"},"previous_names":["lopezvoliver/eetasks-examples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lopezvoliver%2Feetasks-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lopezvoliver%2Feetasks-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lopezvoliver%2Feetasks-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lopezvoliver%2Feetasks-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lopezvoliver","download_url":"https://codeload.github.com/lopezvoliver/eetasks-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243918643,"owners_count":20368746,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["earthengine","eetasks","google-earth-engine"],"created_at":"2024-10-13T07:26:44.629Z","updated_at":"2025-03-16T19:25:47.749Z","avatar_url":"https://github.com/lopezvoliver.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sample GEE test scripts for the vscode [EE Tasks](https://github.com/gee-community/eetasks) extension\n\nThis repository contains sample GEE scripts that have been tested to work with the vscode [EE Tasks](https://marketplace.visualstudio.com/items?itemName=gee-community.eetasks) extension. \n\nRead more about how to use the `EE Tasks: run GEE script` command [here](https://github.com/gee-community/eetasks/blob/main/docs/runGEEscripts.md).\n\nIn addition, it contains some small related node scripts, including one that demonstrates the authentication and initialization of the earthengine JavaScript API.\n\nHere's a demonstration of the extension capabilities: \n\n![eetasks-readme](https://raw.githubusercontent.com/gee-community/eetasks/main/docs/assets/geerunExample.gif)\n\n## Sample GEE scripts\n\nTo run these scripts in vscode, first install the [EE Tasks vscode extension](https://marketplace.visualstudio.com/items?itemName=gee-community.eetasks) and follow the [sign in instructions](https://github.com/lopezvoliver/eetasks/tree/auth#sign-in-options).\n\nFinally, open the script to run, press `F1` and type `EE Tasks: run GEE script`. \n\n1. [helloGEE](./helloGEE.js): demonstrates the use of `print` either directly or as a callback function in `.getInfo()`\n2. [ExportTableToDrive](./ExportTabletoDrive.js): demonstrates a simple [Export.table.toDrive](https://developers.google.com/earth-engine/apidocs/export-table-todrive) with a call to [Map.addLayer](https://developers.google.com/earth-engine/apidocs/map-addlayer) ignored. \n3. [ExportImageToDrive](./ExportImagetoDrive.js): demonstrates a simple [Export.Image.toDrive](https://developers.google.com/earth-engine/apidocs/export-image-todrive).\n4. [MapAddLayer](./MapAddLayer.js): demonstrates the new capability for opening an interactive Map, adding ee layers, and exporting a single image in the same script. \n\n## Node scripts \n\n### Hello world \n\nThe [helloNodeGEE.js](./helloNodeGEE.js) is a minimal node script demonstrating the authentication and initialization of the EE library with one asynchronous and one synchronous request. It requires a valid [access_token](https://developers.google.com/identity/protocols/oauth2/javascript-implicit-flow#callinganapi). \n\nIf you have stored credentials generated by the [python Earth Engine client](https://developers.google.com/earth-engine/guides/python_install#authentication) (`~/.config/earthengine/credentials`), then you can generate a token (valid for one hour) using the `printToken.js` node script. \n\n\u003e The following instructions are **not** required to run the [sample GEE scripts](#sample-gee-scripts) within the vscode EE Tasks extension. \n\nYou will need to use [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) to install the [google/earthengine](https://developers.google.com/earth-engine/guides/npm_install) JavaScript API. \n\n```bash\nnpm install @google/earthengine\n```\n\nNext, generate the token:\n\n```bash\nnode printToken.js\n```\n\nIf a valid token is generated, the output should look like this:\n\n```bash\n{\n  access_token: 'ya29...\u003cVERY LONG STRING HERE\u003e...',\n  expires_in: 3599,\n  scope: 'https://www.googleapis.com/auth/earthengine https://www.googleapis.com/auth/devstorage.full_control',\n  token_type: 'Bearer'\n}\n```\n\nCopy the `access_token` string and export the `EETOKEN` environment variable:\n\n```bash\nexport EETOKEN=\"ya29...\u003cVERY LONG STRING HERE\u003e...\"\n```\n\nFinally, run the example:\n\n```bash\nnode helloNodeGEE.js\n```\n\nThe output should look like this:\n\n```bash\n$ node helloNodeGEE.js \nHello from synchronous request\nHello from callback\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flopezvoliver%2Feetasks-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flopezvoliver%2Feetasks-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flopezvoliver%2Feetasks-examples/lists"}