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

# Portuguese DICOFRE code (`pt_dicofre`)

> **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 an administrative unit of Portugal in the Carta Administrativa Oficial de Portugal (CAOP): two digits of the district or island (DI: 01 Aveiro to 18 Viseu, 31 and 32 Madeira, 41 to 49 the Azores), two of the municipality (CO) and two of the civil parish (FRE). The four-digit form (DICO, called DTMN in census files) names a municipality, as in 1703 for Chaves, and the six-digit form a parish, as in 170301. Municipal geoportals carry it in columns named DICOFRE, DTMN11 or COD_INE. The subsection code of the census (pt_bgri_code) starts with it.

- 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{2}(?:\d{2})?$
```

## Examples

- `170301` — a parish of Chaves, district of Vila Real
- `010121` — a parish of Águeda, district of Aveiro
- `1703` — Chaves, the four-digit municipality code
- `190101` (invalid example) — 19 is not a district

## Metacrafter rules

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

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

## Supported by tools

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

## Translations

- pt: Código DICOFRE
- ru: Код DICOFRE (Португалия)

## Sources

- doc: <https://www.dgterritorio.gov.pt/cartografia/cartografia-tematica/caop>

## Quality

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

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