---
id: "gb_scotland_settlement_code"
kind: "datatype"
status: "draft"
is_pii: false
name: "Scottish settlement code (GSS)"
regexp: "^S20\\d{6}$"
categories: ["geo"]
country: ["GB"]
langs: ["en"]
quality: 85
url: "https://registry.apicrafter.io/datatype/gb_scotland_settlement_code"
---

# Scottish settlement code (GSS) (`gb_scotland_settlement_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.

GSS code of a settlement of the National Records of Scotland, entity code S20. A settlement is a built-up area of neighbouring postcodes of high density with 500 or more residents; it may hold several localities.

- Parent datatype: [`ukgsscode`](https://registry.apicrafter.io/datatype/ukgsscode.md)
- Personal data (PII): no
- Categories: Geographic identifiers (geo)
- Countries: United Kingdom (GB)
- Languages: English (en)
- Classification: categorical

## Detection

Regular expression (Python `re`):

```
^S20\d{6}$
```

## Examples

- `S20001477` — A settlement of the Stirling council area
- `S20001992` — A settlement of the Stirling council area
- `S19001277` (invalid example) — A locality code (S19)

## Metacrafter rules

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

- `gbscotlandsettlementcodevalue` (data, `gb/gb_geo.yaml`)

## Supported by tools

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

## Sources

- doc: <https://www.ons.gov.uk/methodology/geography/geographicalproducts/namescodesandlookups/codehistorydatabasechd>
- doc: <https://www.nrscotland.gov.uk/publications/population-estimates-for-settlements-and-localities-in-scotland-mid-2020/>

## Quality

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

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