Jump to Content
Data Analytics

Introducing Ask, a new Google Earth Engine feature to accelerate geospatial coding

September 28, 2026
Joel Conkling

Product Lead

Katie Friis

Software Engineer

Try Gemini Enterprise today

The front door to AI in the workplace

Try now

Whether you are mapping global forest cover, detecting changes in the built environment, or monitoring agricultural yields, writing scripts in Google Earth Engine is a powerful way to develop these insights. This platform is part of Google Earth AI, our collection of geospatial models and datasets designed to help you transform planetary information into actionable intelligence, and we’ve launched a new feature, Ask, that makes accessing that planetary intelligence even easier. 

We know that translating complex geospatial logic into code takes time, and memorizing specific Google Earth Engine API functions, searching documentation, and debugging syntax or memory errors can interrupt your flow. Ask is designed to help you get to actionable insights faster, by integrating Gemini capabilities directly into the Google Earth Engine Code Editor.

Starting today, you can use your own Gemini API key to write, debug, understand, and optimize geospatial queries without ever leaving the Code Editor.

https://storage.googleapis.com/gweb-cloudblog-publish/images/1_hhaY4vo.max-1900x1900.jpg

Figure 1: The new Ask panel resides on the right side of the Code Editor, providing chat-based AI assistance tailored to your active script.

How it works: Context-aware assistance

You can ask a question directly in the Code Editor, and get a response based on context from your workspace, such as:

  • The full text of your active script

  • Your imported assets and geometries

  • Your active session chat history

Because Gemini capabilities in Google Earth Engine automatically understand your work, you don’t have to add code or explain your datasets. It already knows these details, so it can provide more relevant, helpful answers. Additionally, you can automatically view the diff and merge it into your script. No more copy and pasting!

You can also personalize Ask to make responses more comprehensive and suited to your needs:

  • Access the latest Gemini models: Choose the Gemini model that meets your needs — at launch, the available models are Gemini 3 Flash Preview, Gemini 3.1 Pro Preview, and Gemini 3.5 Flash.

  • Docs search: Use AI to search the official documentation for up-to-date syntax and functions.

  • Dataset search: Allow AI to search the Earth Engine Data Catalog to find and reference the exact datasets you need.

  • Google Search: Grounds response in the latest public web results using Grounding with Google Search (mutually exclusive with docs search and dataset search).

Quick-start examples

Not sure where to start? Here are four ways you can use Ask in your workflows:

1. Generate code from natural language

Need to calculate NDVI (“Normalized Difference Vegetation Index”), perform a cloud mask, or build a chart, but can't remember the exact syntax? Just ask and Earth Engine can generate JavaScript code for you. You can review the code directly in the chat and click Insert to add it to your script, or Copy it to your clipboard. If your editor is not empty, inserting code displays a side-by-side diff view so you can review changes before accepting them.

Prompt example: "Write a script to load Sentinel-2 imagery for 2025 over Boulder, CO, apply a cloud mask, calculate NDVI, and add the median composite to the map."

2. Explain complex code

If you’re working with a script written by a colleague or adapting an example from the community, you can use Gemini capabilities to explain it. Simply ask, "Explain what this script does," and receive a step-by-step breakdown of the logic and Earth Engine functions being used.

3.  Perform one-click troubleshooting and debugging

Debugging is an inevitable part of coding. When your script throws an error in Google Earth Engine, the Console displays an error message. Now, those messages include a "Troubleshoot" button. Clicking it automatically populates the Ask panel with a prompt that contains the error message and a request for help to diagnose the issue and suggest a fix.

https://storage.googleapis.com/gweb-cloudblog-publish/images/2_qed5vZZ.max-1900x1900.jpg

Figure 2: The "Troubleshoot" button in the Console makes debugging errors fast and frictionless.

4. Optimize queries

If your script is, for example, running slowly, consuming resources inefficiently, throwing "computation timed out" or "too many concurrent aggregations" errors, ask for optimization tips. Gemini capabilities can suggest best practices like early filtering, reducing computation steps, or converting client-side loops into server-side operations.

Get started in two steps

Ask is available globally today. To get started, you just need a Gemini API key:

  1. Get an API key: If you don’t already have a Gemini API key, head to Google AI Studio and create one (there are free options; if you choose a paid-tier API key, you will be billed for your usage). Learn more about Gemini API terms.

  2. Add the API key to GEE: Open the Google Earth Engine Code Editor. On the right-hand panel, click the Ask panel. Click the key icon in the bottom left corner and enter your API key.

We want to hear from you! Please use the Code Editor Feedback button to share your feedback and help us improve the experience.

Posted in