---
id: "csquares_code"
kind: "datatype"
status: "draft"
is_pii: false
name: "C-squares code"
regexp: "^[1357][0-8](?:0\\d|1[0-7])(?::[1-4]\\d{2})*(?::[1-4])?$"
categories: ["geo", "environment"]
langs: ["common"]
quality: 90
url: "https://registry.apicrafter.io/datatype/csquares_code"
---

# C-squares code (`csquares_code`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Code of a cell of the c-squares grid (Concise Spatial Query and Representation System), which Tony Rees of CSIRO Marine Research published in 2002 to index marine data by latitude and longitude. The first four digits name a ten-degree square as WMO squares do: the global quadrant (1 north-east, 3 south-east, 5 south-west, 7 north-west), the tens of the latitude and two digits for the tens of the longitude. Each finer step adds a colon and a cycle of three digits, an intermediate quadrant from 1 to 4 and the next digits of latitude and longitude; a last cycle of one digit halves the cell. 1212:121:2 is a half-degree cell, the resolution of the species range tables of AquaMaps.

- Personal data (PII): no
- Categories: Geographic identifiers (geo), Environment (protected areas, biodiversity, water, weather, emissions, waste) (environment)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^[1357][0-8](?:0\d|1[0-7])(?::[1-4]\d{2})*(?::[1-4])?$
```

## Examples

- `3112:360:4` — Half-degree cell; example in Wikipedia
- `3112` — Ten-degree cell; example in Wikipedia
- `1000:100:100:1` — Cell of 0.05 degrees; example in Wikipedia
- `1212:121:2` — Species count table of the Pacific Environment Data Portal (SPREP), a 2024 snapshot
- `2112:360` (invalid example) — There is no global quadrant 2
- `3112:560` (invalid example) — The intermediate quadrant is 1 to 4

## Metacrafter rules

2 rules: 1 match the field name, 1 match values.

- `csquarescodebyname` (field, `common/conservation.yaml`)
- `csquarescodevalue` (data, `common/conservation.yaml`)

## Supported by tools

- [`metacrafter`](https://registry.apicrafter.io/tool/metacrafter.md)

## Translations

- ru: Код ячейки c-squares: Код ячейки географической сетки c-squares (CSIRO, 2002): четыре цифры десятиградусного квадрата и уточняющие группы через двоеточие.

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/C-squares>

## Quality

Score 90/100. Missing: mapping (Wikidata, Schema.org, ...).

JSON: <https://registry.apicrafter.io/api/v1/datatypes/csquares_code.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/geo/csquares_code.yaml>
