> For the complete documentation index, see [llms.txt](https://docs.os.uk/os-downloads/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.os.uk/os-downloads/products/areas-and-zones-portfolio/code-point-with-polygons/code-point-with-polygons-technical-specification/specification.md).

# Specification

## Content <a href="#bookmark11" id="bookmark11"></a>

Code-Point with Polygons contains:

* The Code-Point product which contains georeferenced postcode unit point data, alongside associated metadata such as address counts and quality indicators. Also provided are the health and administrative area codes related to each postcode. For shapefile, MapInfo TAB file, MapInfo MID / MIF and vector tiles formats, the Code-Point points coverage is for the United Kingdom as it includes Northern Ireland postcodes. For GeoPackage format, the associated Code-Point points data coverage is for Great Britain only, not Northern Ireland, and is provided as a single database table.
* Also provided, in association with the Code-Point data, is a text file that provides the full text equivalents of the administrative area codes, and a second text file that provides the numbers of postcode units in each postcode area.
* Postcode unit polygons depicting notional boundaries around each postcode unit in Great Britain. This data is supplied in either shapefile, MapInfo TAB file, MapInfo MID / MIF, vector tiles or GeoPackage formats.
* Also provided, in association with the polygon data, are two sets of CSV text files containing Vertical Street data and Discard data.

## Product structure <a href="#bookmark12" id="bookmark12"></a>

### Shapefile, MapInfo MID / MIF, MapInfo TAB file and vector tiles <a href="#bookmark13" id="bookmark13"></a>

The Code-Point with Polygons product contains two sets of data in two different folders:

* **Code-Point** – This folder contains the Code-Point product, details of which can be found in the [Code-Point Overview](/os-downloads/products/areas-and-zones-portfolio/code-point/code-point-overview.md), [Getting Started Guide](/os-downloads/products/areas-and-zones-portfolio/code-point/code-point-getting-started-guide.md), and [Technical Specification](/os-downloads/products/areas-and-zones-portfolio/code-point/code-point-technical-specification.md) documents.
* **Polygons** – The Polygons folder contains:
  * **Licence.txt** – A text file with licence, copyright and specification change information.
  * **Two sub-folders**: Docs and Data
    * The **Docs** folder contains the following file:
      * **Order Details.txt** – Notes about the data.
    * The **Data** folder contains the following sub-folders:
      * **Polygons** – Contains polygon data in 120 postcode area files for shapefile, MapInfo MID / MIF and MapInfo TAB file formats, or one national file for vector tiles format.
      * **Discard\_files** – A lookup list of 120 text files of the postcodes that have not been included in the polygon creation process because either there are no AddressBase records of sufficient PQ classification, or they are PO Box postcodes.
      * **Vertical\_streets** – A lookup table of 120 text files of vertical street reference codes and the postcodes contained in them.

### GeoPackage <a href="#bookmark14" id="bookmark14"></a>

The Code-Point with Polygons GeoPackage format contains the following text files:

* **Codepoint Licence.txt** – Licence information.
* **Codepoint with Polygons Licence.txt** – Licence information.

And three sub-folders: **Codepoint\_Resources**, **Data** and **Docs**:

* The **Codepoint\_Resources** folder contains text files relating to the Code-Point product, details of which can be found in the [Code-Point Overview](/os-downloads/products/areas-and-zones-portfolio/code-point/code-point-overview.md), [Getting Started Guide](/os-downloads/products/areas-and-zones-portfolio/code-point/code-point-getting-started-guide.md), and [Technical Specification](/os-downloads/products/areas-and-zones-portfolio/code-point/code-point-technical-specification.md) documents.
* The **Data** folder contains the following sub-folders:
  * **Data** – Code-Point with Polygons GeoPackage (following the convention Geopackage\_MMM\_YYYY.gpkg, where MMM\_YYYY are the month and year of release, respectively).
  * **DISCARD\_FILES** – A lookup list of 120 text files of the postcodes that have not been included in the polygon creation process because either there are no AddressBase records of sufficient PQ classification, or they are PO Box postcodes.
  * **VERTICAL\_STREETS** – A lookup table of 120 text files of vertical street reference codes and the postcodes contained in them.
* The **Docs** folder contains the following text file:
  * **Order Details.TXT** – Notes about the data (this file).

## Data specification – Polygons <a href="#bookmark15" id="bookmark15"></a>

The file contains polygon data in 120 postcode area files in the chosen format.

The following table represents the structure of the data in shapefile, MapInfo TAB file and MapInfo MID / MIF formats:

| Field Name | Type    | Width | Description                                            |
| ---------- | ------- | ----- | ------------------------------------------------------ |
| FID \*     | N/A     | N/A   | Feature identifier added by the software.              |
| Shape \*   | Polygon | N/A   | Feature geometry.                                      |
| POSTCODE   | Char    | 8     | Full postcode from Code-Point.                         |
| UPP        | Char    | 20    | Unique polygon identifier (including 4 leading zeros). |
| PC\_AREA   | Char    | 2     | The Postcode area, for example, SO.                    |

\* Denotes presence in shapefile format only.

{% hint style="info" %}
For information, the attribute headers in GeoPackage are lowercase; the data structure is the same.
{% endhint %}

**Example of shapefile** “0”,”Polygon”,”TA15 1PL”,00004000000001389232”,”TA”

**Example in MapInfo TAB file and MapInfo MID / MIF:** ”TA15 1PL”,00004000000001389232”,”TA”

The vector tiles format contains a single file with a national set of postcode polygons in vector tiles format. The vector tiles schema is detailed in the table below. In the zoom levels columns within the table, the letter *N* indicates that the specified layer and attribute is not mapped within that zoom level, whereas the letter *Y* indicates that the specified layer and attribute is mapped within that zoom level.

<table><thead><tr><th width="138">Attribute</th><th width="166">Zoom Level: 0–8</th><th width="68">9</th><th width="76">10</th><th width="70">11</th><th width="68">12</th><th width="83">13</th><th>14</th></tr></thead><tbody><tr><td>Postcode</td><td>N</td><td>N</td><td>N</td><td>N</td><td>N</td><td>Y</td><td>Y</td></tr><tr><td>UPP</td><td>N</td><td>N</td><td>N</td><td>N</td><td>N</td><td>Y</td><td>Y</td></tr><tr><td>PC_Area</td><td>N</td><td>N</td><td>N</td><td>N</td><td>N</td><td>Y</td><td>Y</td></tr></tbody></table>

### Vertical street lookup <a href="#bookmark17" id="bookmark17"></a>

Vertical streets is a list of polygons, identified by a serial number that is prefixed by the letter *V*, which contain more than one postcode. This situation can occur in, for example, blocks of flats where there is more than one postcode within a single building.

The Vertical Street lookup contains 120 postcode area text files of vertical street reference codes and the postcodes contained in them.

| Field name | Type | Width | Description                                               |
| ---------- | ---- | ----- | --------------------------------------------------------- |
| POSTCODE   | Char | 8     | Full postcode from Code-Point.                            |
| ID         | Char | 8     | Unique polygon identifier (including four leading zeros). |

**Example:** "UB1 1ET","VUB00001"

### Discard files <a href="#bookmark19" id="bookmark19"></a>

Discard files is a list of the postcodes for which polygons have not been included because there is no data of sufficient quality to use in the polygon creation, or because their constituent addresses lie outside the extent of the realm (coastline). Also in the discard file are PO Boxes – a list of the PO Box postcodes, none of which will have been used in the creation of the polygon set.

The Discard File lookup contains 120 postcode area text files of the postcodes.

| Field Name | Type | Width | Description                                                                                                   |
| ---------- | ---- | ----- | ------------------------------------------------------------------------------------------------------------- |
| POSTCODE   | Char | 8     | Full postcode from Code-Point.                                                                                |
| REASON     | Char | 7     | The reason for the postcode not having representative polygon geometry. This will either be POBOX or QUALITY. |

**Example:** "CB1 0AH","POBOX"

## Data coverage <a href="#bookmark20" id="bookmark20"></a>

### Points

The Code-Point product contains a point reference for every postcode unit in England, Scotland, Wales and Northern Ireland that is contained in Royal Mail’s Postcode Address File (PAF) product at the time of creation of the dataset. For further information about the Code-Point product, please refer to the [Code-Point Overview](/os-downloads/products/areas-and-zones-portfolio/code-point/code-point-overview.md), [Getting Started Guide](/os-downloads/products/areas-and-zones-portfolio/code-point/code-point-getting-started-guide.md) and [Technical Specification](/os-downloads/products/areas-and-zones-portfolio/code-point/code-point-technical-specification.md) documents.

### Polygons

The polygon set contains a polygon for every postcode in England, Scotland and Wales that is contained in Royal Mail’s PAF product, with the following exceptions:

* Postcodes for which there are no delivery point addresses of sufficient quality.
* Postcodes for which there are no delivery point addresses that lie within the extent of the realm coastline.
* Postcodes that relate to PO Boxes.
* Postcodes that are vertically stacked, i.e. two or more postcodes within a single building that are represented by a single large-scale building seed. In these situations, a single square polygon represents all the postcodes attributed to the single building seed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.os.uk/os-downloads/products/areas-and-zones-portfolio/code-point-with-polygons/code-point-with-polygons-technical-specification/specification.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
