# ＊ GPSNoiser

{% 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 `GPSNoiser` creates realistic GPS coordinates from roughly the same areas as the real data. When transforming your data, it adds noise using a pre-defined distance to preserve privacy. When reverse transforming, it chooses from the noised data points.

<figure><img src="https://2225246359-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVGX92M819eIp0rMg5elc%2Fuploads%2F84ONAqBVsYYYLshosCNe%2Frdt_transformers-glossary-deep-data-understanding-gps-coordinates-gps-noiser_June%2002%202025.png?alt=media&#x26;token=cc0dd9bb-5994-46f0-b94a-92d6e7bcbba2" alt=""><figcaption></figcaption></figure>

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

transformer = GPSNoiser(noise_km=25.0)
```

## Parameters

**`noise_km`**: Add this argument to determine the overall magnitude of noise to add, in kilometers

<table data-header-hidden><thead><tr><th width="203"></th><th></th></tr></thead><tbody><tr><td>(default) <code>10.0</code></td><td>Add roughly 10km noise to the real GPS coordinates, in any direction<br><em>For reference, 10km is roughly the diameter of a city like Paris</em> </td></tr><tr><td><code>&#x3C;float></code></td><td>A floating point value in the range <code>(0.0, 1000.0)</code> that describes the noise radius. <br><em>For reference 1000km is roughly the length of California, or the distance between Paris and Barcelona.</em> </td></tr></tbody></table>

## 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 GPSNoiser

transformer = GPSNoiser(noise_km=25.0)

# 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>
