---
id: "pt_bgri_code"
kind: "datatype"
status: "draft"
is_pii: false
name: "Portuguese census subsection code (BGRI)"
regexp: "^(?:0[1-9]|1[0-8]|3[12]|4[1-9])\\d{9}$"
categories: ["geo", "government"]
country: ["PT"]
langs: ["common"]
quality: 90
url: "https://registry.apicrafter.io/datatype/pt_bgri_code"
---

# Portuguese census subsection code (BGRI) (`pt_bgri_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.

Eleven-digit code of a statistical subsection in the Base Geográfica de Referenciação de Informação (BGRI) of Statistics Portugal, the smallest area of the census: the six-digit parish code (pt_dicofre), three digits of the statistical section and two of the subsection, as in 17032100111. Census layers of 2011 carry it in columns named BGRI11 or GEO_COD, with the parts in DTMN11, FR11, SEC11 and SS11.

- Personal data (PII): no
- Categories: Geographic identifiers (geo), Government related (government)
- Countries: Portugal (PT)
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^(?:0[1-9]|1[0-8]|3[12]|4[1-9])\d{9}$
```

## Examples

- `17032100111` — a subsection in Chaves
- `17090200112` — a subsection in Ribeira de Pena
- `170321001` (invalid example) — without the subsection

## Metacrafter rules

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

- `ptbgribyname` (field, `pt/pt_codes.yaml`)

## Supported by tools

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

## Translations

- pt: Código da subsecção estatística (BGRI)
- ru: Код статистической подсекции переписи Португалии (BGRI)

## Sources

- doc: <https://mapas.ine.pt/>

## Quality

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

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