# Google Earth Engine

This extension provides powerful Google Earth Engine integration for spatial analysis.

It includes components for summarizing raster data over polygons and efficiently processing large-scale vector data with Earth Engine imagery.

These tools enable users to perform advanced geospatial analysis by combining BigQuery's data processing capabilities with Earth Engine's vast satellite imagery and geospatial datasets.

{% hint style="info" %}
These component make use of cloud functions deployed and maintained by CARTO on a GCP project.

Usage of these functions is limited to 1000 rows/day and connection.

These functions are available for the US BigQuery region.

Please get in touch with us at [**support@carto.com**](mailto:support@carto.com) if you need to deploy your own version of the functions.
{% endhint %}

## Summary Region

**Description**

Summarizes Google Earth Engine raster data over a polygon. Users specify an image, band, and reducer function for efficient spatial analysis.

**Inputs**

* **Source table:** This component is limited to an input of 10 rows with polygons. It's tipically used along with a [Draw Custom Features](https://docs.carto.com/carto-user-manual/workflows/parsers#draw-custom-features) input to define the regions that will be summarized.

**Settings**

* **Geometry column:** Select a column from the input table that contains polygons.
* **GEE Image ID:** (Optional) Provide a Google Earth Engine image ID. Provider either this or a GEE Image expression.
* **GEE Image expression:** (Optional) Provider a Google Earth Engine expression that returns a single image. Provider either this or a GEE Image ID.
* **Band:** Specify which band from the image will be used for the reduce operation.
* **Reducer:** Select a [reducer](https://developers.google.com/earth-engine/guides/reducers_intro) function
* **Scale in meters:** Specify a size in meters to define the scale of your operation.

**Outputs**

* **Output table:** This component return a table with the same columns as the Source table, with an additional one named `ee_summary_<reducer>` that contains the value of the reduce operation.

## Summary Table

**Description**

Summarizes Google Earth Engine raster data over polygons on a BigQuery table. Users specify an image, band, and reducer function for efficient spatial analysis.

**Inputs**

* **Source table:** A table that contains polygons.

**Settings**

* **Geometry column:** Select a column from the input table that contains polygons.
* **GEE Image ID:** (Optional) Provide a Google Earth Engine image ID. Provider either this or a GEE Image expression.
* **GEE Image expression:** (Optional) Provider a Google Earth Engine expression that returns a single image. Provider either this or a GEE Image ID.
* **Band:** Specify which band from the image will be used for the reduce operation.
* **Reducer:** Select a [reducer](https://developers.google.com/earth-engine/guides/reducers_intro) function
* **Scale in meters:** Specify a size in meters to define the scale of your operation.

**Outputs**

* **Output table:** This component return a table with the same columns as the Source table, with an additional one named `ee_<reducer>` that contains the value of the reduce operation.

## Get Elevation

**Description**

Retrieves and summarizes [elevation data from Google Earth Engine](https://developers.google.com/earth-engine/datasets/catalog/COPERNICUS_DEM_GLO30) for specified polygons.

**Inputs**

* **Source table:** This component is limited to an input of 10 rows with polygons. It's tipically used along with a [Draw Custom Features](https://docs.carto.com/carto-user-manual/workflows/parsers#draw-custom-features) input to define the regions that will be summarized.

**Settings**

* **Geometry column:** Select a column from the input table that contains polygons.
* **Reducer:** Select a [reducer](https://developers.google.com/earth-engine/guides/reducers_intro) function

**Outputs**

* **Output table:** This component return a table with the same columns as the Source table, with an additional one named `ee_<reducer>_elevation` that contains the value of the reduce operation.

## Get NDVI

**Description**

Retrieves and summarizes the Normalized Difference Vegetation Index (NDVI) obtained with NIR (B8) and RED (B4) bands [from Google Earth Engine data](https://developers.google.com/earth-engine/datasets/catalog/COPERNICUS_S2) for specified polygons and date ranges.

**Inputs**

* **Source table:** This component is limited to an input of 10 rows with polygons. It's tipically used along with a [Draw Custom Features](https://docs.carto.com/carto-user-manual/workflows/parsers#draw-custom-features) input to define the regions that will be summarized.

**Settings**

* **Geometry column:** Select a column from the input table that contains polygons.
* **Start date:** Type a `YYYY-MM-DD` that defines the start date to consider for your analysis.
* **End date:** Type a `YYYY-MM-DD` that defines the end date to consider for your analysis.

**Outputs**

* **Output table:** This component return a table with the same columns as the Source table, with an additional one named `ee_ndvi` that contains the mean NDVI value of the polygon.

## Get Precipitation

**Description**

Retrieves and summarizes [precipitation data from Google Earth Engine](https://developers.google.com/earth-engine/datasets/catalog/ECMWF_ERA5_LAND_HOURLY) for specified polygons and date ranges.

**Inputs**

* **Source table:** This component is limited to an input of 10 rows with polygons. It's tipically used along with a [Draw Custom Features](https://docs.carto.com/carto-user-manual/workflows/parsers#draw-custom-features) input to define the regions that will be summarized.

**Settings**

* **Geometry column:** Select a column from the input table that contains polygons.
* **Reducer:** Select a [reducer](https://developers.google.com/earth-engine/guides/reducers_intro) function.
* **Start date:** Type a `YYYY-MM-DD` that defines the start date to consider for your analysis.
* **End date:** Type a `YYYY-MM-DD` that defines the end date to consider for your analysis

**Outputs**

* **Output table:** This component return a table with the same columns as the Source table, with an additional one named `ee_<reducer>_precipitation` that contains the value of the reduce operation.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.carto.com/carto-user-manual/workflows/components/google-earth-engine.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
