# Geocoding data

Two types of geocoding are available: address-level geocoding, which transforms a given address into its corresponding point location, and latitude/longitude geocoding, which converts a pair of latitude and longitude coordinates into a point geometry.

{% hint style="info" %}
Address level geocoding is currently available for BigQuery, Snowflake and Redshift connections. PostgreSQL and Databricks support is coming soon.
{% endhint %}

To geocode your data, select a connection and click on the table you would like to geocode from the collapsible tree. Then, click on the *Geocode data* button at the top right of the screen. Please note that this option will only be available if your table does not have a geography column.

<figure><img src="/files/782xgFPe1xFuMT7g6gZ9" alt=""><figcaption></figcaption></figure>

A new dialog will open for you to choose whether to geocode your table by address or by latitude/longitude.

<figure><img src="/files/fzWOsR0cT1RSgqijkFZ1" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you are using BigQuery and you plan to repeat the geocoding process, bear in mind that if you drop columns from your table you won't be able to create columns with the same name for a period of time (7 days) because BigQuery reserves the deleted columns names for [*time travel*](https://cloud.google.com/bigquery/docs/time-travel) purposes. So, for example, instead of dropping the `geom` column to re-geocode all rows, update the table and set it to `NULL`.
{% endhint %}

## By address <a href="#by-address" id="by-address"></a>

To geocode your data, select geocode by *Address* and fill in the options:

* select the column of your table that contains the addresses to geocode.
* optionally, select the country where your addresses are located. This is recommended as it generally improves the geocoding results.
* optionally, specify the name of the geometry column (`geom` by default) where the result of the geocoding will be stored.

<figure><img src="/files/XRc8ZVRVsGLuWXa79pEc" alt=""><figcaption></figcaption></figure>

Then, click on *Continue*. A new dialog will appear allowing you to confirm your selection. Click on the *Geocode* button to confirm or click *Cancel* to abort the process.

<figure><img src="/files/4dZrjQ0E3FOhTPWzWOUf" alt=""><figcaption></figcaption></figure>

As a result of the geocoding process, two new columns will be added to your existing table: a geometry column with the locations of your addresses, and a `carto_geocode_metadata` column with additional information regarding the geocoding results.

{% hint style="danger" %}
Address-level geocoding requires the advanced Analytics Toolbox for [Snowflake](https://docs.carto.com/analytics-toolbox-snowflake)/[Redshift](https://docs.carto.com/analytics-toolbox-redshift) to be available for your connection. Please get in touch at <support@carto.com> and we will guide you through the installation process.
{% endhint %}

## By latitude / longitude

To geocode your data, select geocode by *Latitude/Longitude* and fill in the options:

* select the columns of your table where the latitude and longitude coordinates are stored.
* optionally, specify the name of the geometry column (`geom` by default) where the result of the geocoding will be stored.

<figure><img src="/files/fzWOsR0cT1RSgqijkFZ1" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Bear in mind that the expected input are WGS84 coordinates in separate columns for latitude and longitude.

The decimal separator should always be a point, for example: `40.534243`
{% endhint %}

Then, click on *Continue*. A new dialog will appear allowing you to confirm your selection. Click on the *Geocode* button to confirm or click *Cancel* to abort the process.

<figure><img src="/files/LKIUCpEag2AWhvggIvlE" alt=""><figcaption></figcaption></figure>

As a result of the geocoding process, a new geometry column will be added to your existing table containing the points corresponding to your latitude/longitude coordinates.


---

# 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/data-explorer/geocoding-data.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.
