> For the complete documentation index, see [llms.txt](https://cgps.gitbook.io/data-flo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cgps.gitbook.io/data-flo/reference-guide/split-geographical-coordinates.md).

# split-geographical-coordinates

## Description

<mark style="color:purple;">`split-geographical-coordinates`</mark> *adaptor splits geographical coordinates in a datatable column to a latitude & a longitude columns.*

The latitude & longitude must be in +/- values or E/W/N/S, not in degrees/minutes/seconds or degrees/decimal minutes.

## Inputs

**`data`**\
Type: `datatable`\
Required: Yes\
The datatable containing the column to be processed.

**`coordinates column`**\
Type: `text`\
Required: Yes\
The name of the column containing geographical coordinates.

**`latitude column`**\
Type: `text`\
Required: No\
The column name for the latitude result. If unspecified, defaults to "latitude".

**`longitude column`**\
Type: `text`\
Required: No\
The column name for the longitude result. If unspecified, defaults to "longitude".

## Outputs

**`data`**\
Type: `datatable`\
A datatable with the latitude & longitude values added.

**`invalid values`**\
Type: `datatable`\
A datatable with invalid coordinate values, the row in which they first appear and the number of times they appear.

## Examples

### Example 1: Default behaviour.

#### Inputs:

`data`:

| id | co-ordinate     |
| -- | --------------- |
| 1  | 40 N 120 W      |
| 2  | 22.4 N 114.1 E  |
| 3  | 29.85 S 31.01 E |
| 4  | 31.00 N 99.00 W |
| 5  | 20              |
| 6  | test            |

`coordinates column`: 1

`latitude column`: *null (empty)*

`longitude column`: *null (empty)*

#### Outputs:

`data`:

| id | co-ordinate     | latitude | longitude |
| -- | --------------- | -------- | --------- |
| 1  | 40 N 120 W      | 40       | -120      |
| 2  | 22.4 N 114.1 E  | 22.4     | 114.1     |
| 3  | 29.85 S 31.01 E | -29.85   | 31.01     |
| 4  | 31.00 N 99.00 W | 31.00    | -99.00    |

`invalid values`:

| Value | First row | Row count |
| ----- | --------- | --------- |
| 20    | 5         | 1         |
| test  | 6         | 1         |

-> Split geographical coordinates into latitude and longitude. The invalid values `20` and `test` are shown in the `invalid values` output.

## Use Cases

* Transform geolocation data extracted from a database into the format needed for mapping with Microreact.
* Prepare data for the <mark style="color:purple;">`reverse-geocoding`</mark> adaptor to identify the location based on the coordinates.
