# `EastingNorthing`

Map coordinates on a projected grid: an easting, a northing and which grid.

Use it for data on a national grid, such as Ordnance Survey's in Great Britain. For latitude and longitude, use [`Point`](/docs/types/type-point.md).

## Shape

| Field | Type | Required? |
|---|---|---|
| `easting` | `Decimal` | Yes |
| `northing` | `Decimal` | Yes |
| `crs` | [`Crs`](/docs/types/type-crs.md) | Yes |

## Example

```jadpo
EastingNorthing { easting: 530000.0 northing: 180000.0 crs: "EPSG:27700" }
```

## Good to know

- Jadpo stores it as written and doesn't convert it to or from a [`Point`](/docs/types/type-point.md).
- `==` tells you whether two are the same. `<` and `list.sort_by` don't take it, so sort by one of its parts instead.

## In JSON

An object of its parts, in a request, a response or `json.write`:

```json
{"easting":"530000","northing":"180000","crs":"EPSG:27700"}
{"easting":"448251.795","northing":"5411932.678","crs":"EPSG:32630"}
```

## Details

<details>
<summary>Text form, storage, how it is shown, and operations</summary>

`EastingNorthing` is in the group Geospatial, and has been in Jadpo since 0.1.0.

### Text form

It has no single text form, so `text.from` and `text.parse` don't take it.

### How it is stored

It is stored in 3 columns, each named for the field, `_` and its suffix. This is `{"easting":"448251.795","northing":"5411932.678","crs":"EPSG:32630"}`:

| Column | Type | Holds |
|---|---|---|
| `<field>_easting` | `numeric` | `448251.795` |
| `<field>_northing` | `numeric` | `5411932.678` |
| `<field>_crs` | `text` | `'EPSG:32630'` |

### How it is shown to people

`text.format(value, locale:)` shows it to people in their locale.

With `locale: Locale.en_gb`:

| Value | Shown |
|---|---|
| `{"easting":"530000","northing":"180000","crs":"EPSG:27700"}` | `easting 530,000, northing 180,000 (EPSG:27700)` |
| `{"easting":"448251.795","northing":"5411932.678","crs":"EPSG:32630"}` | `easting 448,251.795, northing 5,411,932.678 (EPSG:32630)` |

### Operations

It also takes `text.format`, `json.read`, `json.write` and `==`. [How every standard type behaves](/docs/every-standard-type-meets-one-contract.md) says how they work.

</details>
