# ＊ MetroAreaAnonymizer

{% hint style="info" %}
**＊SDV Enterprise Feature.** This feature is available to our licensed users and is not currently in our public library. For more information, visit our page to [Explore SDV](https://docs.sdv.dev/sdv/explore/sdv-enterprise/compare-features).
{% endhint %}

The `MetroAreaAnonymizer` performs Contextual Anonymization on GPS coordinates. It preserves the broad regions in your original data, while anonymizing the precise location. It transforms the data by extracting the postal code that corresponds to the GPS coordinate. When reverse transforming, it generates new GPS coordinates within the correct postal codes.

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

```python
from rdt.transformers.gps import MetroAreaAnonymizer

transformer = MetroAreaAnonymizer()
```

{% hint style="danger" %}
***This transformer is still in Beta!*** We have not yet optimized the performance or quality. Please contact us if you notice any issues.

Due to the nature of postal code information, this transformer is **optimized for dense, metropolitan areas such as cities**. If you use this transformer for rural areas, the level of anonymization may not be enough for your needs. In such cases, we recommend using the [GPSNoiser](/rdt/transformers-glossary/deep-data-understanding/gps-coordinates/gpsnoiser.md) or [RandomLocationGenerator](/rdt/transformers-glossary/deep-data-understanding/gps-coordinates/randomlocationgenerator.md).
{% endhint %}

## Parameters

No parameters are available for this transformer.&#x20;

## Examples

{% hint style="info" %}
**This transformer takes exactly 2 columns as input.** Make sure that you have 1 column with sdtype `latitude` and 1 column with sdtype `longitude`.
{% endhint %}

```python
from rdt.transformers.gps import MetroAreaAnonymizer

transformer = MetroAreaAnonymizer()

# in the hypertransformer, ensure that each column has a supported sdtype
ht.update_sdtypes(column_name_to_sdtype={
    'user_lat': 'latitude',
    'user_lon': 'longitude',
})

# in the hypertransformer, assign set of columns to your transformer
ht.update_transformers(column_name_to_transformer={
    ('user_lat', 'user_lon'): transformer
})
```

## FAQs

<details>

<summary>What happens to missing values?</summary>

This transformer recreates missing GPS coordinates during the reverse transform phase in the same proportion as the original data.

Note that a GPS coordinate is considered *missing* if either the latitude or longitude are null.

</details>

*Worldwide, regional data is provided by* [*www.geonames.org*](https://docs.sdv.dev/rdt/transformers-glossary/deep-data-understanding/gps-coordinates/www.geonames.org)*.*


---

# 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.sdv.dev/rdt/transformers-glossary/deep-data-understanding/gps-coordinates/metroareaanonymizer.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.
