# Geospatial

Geospatial values say where things are, and what is near or inside what:
a bakery's position, the patches it delivers to, the shops within five
kilometres of a customer, the pins inside the map a person is looking at.

The types are standard types, listed under
[Geospatial types](geospatial-types.md): `Point`,
with a named `latitude` and `longitude`, five other geometries such as
`Polygon`, and `Geometry`, which holds any one of the six. All of them
are in WGS84, the coordinate system GPS uses, and are sent as GeoJSON.
This page covers what you do with them:

| Part | What | Builds on |
|---|---|---|
| [Operations](geometry-operations.md) | 10 in `geo`: distance, length, bearing, area, intersects, contains, within (with or without `distance:`), centroid, bounding box; and the two for WKT text | The standard library's [operations](what-every-operation-follows.md) and its whole-number maths |
| [Storage](geospatial-storage.md) | One PostGIS `geography` column per geometry, checked to its type and WGS84; GiST indexes derived from your queries | [Storage types](storage-types.md) |
| [Queries](geospatial-queries.md) | `geo.within`, `geo.contains`, `geo.intersects` as `where:` conditions; `order:` by `geo.distance` inside a radius | [Reads and writes](reads-and-writes.md) |
| [Interop](geospatial-interop.md) | GeoJSON `Feature` and `FeatureCollection`; WKT where other systems use it | The standard library's GeoJSON |

PostGIS is the PostgreSQL extension for geographic data. Where this page
says a PostGIS behaviour was verified, it was checked against PostGIS
3.4.2 on PostgreSQL 16. Some compiler messages cite a decision by number,
as in `question 10`; the Decisions table in the
[design notes](https://github.com/jadpo-dev/jadpo/blob/main/docs/language/notes/20-geospatial.md#decisions) lists them.
