File formats and naming
Available formats for OS NGD data
OS NGD data is available in four easy-to-use formats: GeoPackage, CSV (comma-separated values), GeoJSON and vector tiles. The download service of OS Select+Build supports GeoPackage and CSV. OS NGD API – Features supports GeoJSON. OS NGD API – Tiles supports vector tiles.
CSV overview
CSV files are delimited text files which use commas to separate each attribute from the next. CSV is one of the file formats available via OS Select+Build. A single record is commonly provided per line, with a new line being started for each new record.
Geometry attribution will be provided as Well-Known Text (WKT).
CSV offers the following benefits:
The single file is familiar to many customers and well used across GIS and data science tools.
It is plug and play with most databases.
The ability to quickly load large datasets using COPY method rather than INSERT.
If you want a file format that allows you to quickly load OS NGD data into a database / central data repository and the option to receive COU (Change-Only Update) supplies, then CSV is your best choice.
Please be aware that CSV files are designed to be opened in a database or GI system, and opening them in other software applications could corrupt the data. In particular, Excel has a row limit which might be exceeded by some of our CSV files containing OS NGD data, depending on the order you placed and its size. We recommend that you load CSV files containing OS NGD data directly into a database or GI system, rather than trying to open these files in Excel.
CSV structure
The following table shows how different attribute types in the OS NGD are delivered when you choose to receive a CSV format. This includes whether to expect quotes, and how NULL values are treated.
Attribute type | Quotes (Y/N) | If NULL | Example |
---|---|---|---|
Integer | N | " | 123 |
Real | N | " | 1.23 |
Decimal | N | " | 1.23 |
Text | N | " | Some Text |
Text (including comma in string) | Y | " | "Some, Text" |
Array (code list) | Y | " | "item 1,item 2" |
Timestamp | N | " | 2022-08-17T00:00:00.000Z |
Date | N | " | 2022-08-31 |
GeoPackage overview
GeoPackage (GPKG) is an open standard data format as defined by the Open Geospatial Consortium (OGC). It is one of the file formats available via OS Select+Build. GeoPackage is designed to be a lightweight format that can contain large amounts of varied and complex data in a single, easy to distribute and ready to use file. Please be advised that older versions of GIS software may need updating before being able to display and interact with GeoPackage files.
GeoPackage offers the following benefits:
The single file is easy to transfer and offers the end-user a rich experience.
Attribute names are not limited in length, making it user-friendly.
The file size limit is very large at 140TB, so lots of data can be easily accommodated (please note that a file size limit may be imposed by the file system to which the file is written).
It supports raster, vector and database formats, making it a highly versatile solution.
It is an OGC standard.
In most cases, it is a plug and play format.
If you want a file format that allows you to quickly load full supplies of OS NGD data into a GIS, then GeoPackage is your best option.
GeoJSON overview
GeoJSON is an IETF standard designed to represent simple geographical features and their non-spatial attributes. It is used for encoding geographic data structures using JavaScript Object Notation (JSON). GeoJSON is used by OS NGD API – Features.
More information about the GeoJSON IETF standard can be found here.
Supported geometry types:
Point
LineString
Polygon
Multipart geometries: MultiPoints, MultiLineString, or MultiPolygon features
Vector tiles overview
Vector tiles are clipped tiles, or grid squares, composed of layers of vector features which are optimised for caching, scaling and producing map imagery quickly. They serve in a similar way to raster tiles but have the added functionality of being customisable by users. A client application requests tiles based on a zoom level and extent, and the server responds with binary data representing the vector tiles containing the layers to be visualised on that map.
OS NGD API – Tiles serves vector tiles as raw information which is presented using compressed packets of geographic data using the Protocolbuffer Binary Format (.pbf).
Vector tiles offer the following benefits:
User customisation and styling functionality – customise your map with full and dynamic design control.
Small file size – lightweight tiles that are efficient and quick to render in your client application.
Pixel perfect maps – high-resolution, beautiful mapping for all devices (web and mobile devices).
Snapping ability – due to the data being vector, data can be snapped to and traced.
Smooth zooming and scaling effect – a seamless user experience when zooming in and out of maps.
Advanced features – vector tiles contain geographic data (not just images) which can be interrogated and analysed.
File naming
When you place an order for OS NGD data via OS Select+Build, the following file naming convention will be applied to the data you receive:
themeshortcode_collectionshortcode_featuretype
In order to keep file names manageable and not overly long, shortened file names ('short codes') have been used for both the theme and collection. Using short codes in our naming convention also ensures we have consistency in naming between OS Select+Build and the OS NGD APIs.
An example of how these short codes are used is below, with the example showing a file name which would be created for an order of the Built Address Feature Type within the OS NGD GB Address Collection of the OS NGD Address Theme:
add_gb_builtaddress
A full list of the short codes we use in OS Select+Build and the OS NGD APIs is detailed in the following table:
Theme | Theme short code | Collection | Collection short code |
---|---|---|---|
Buildings | bld | Building Features | fts |
Water | wtr | Water Features | fts |
Water Network | ntwk | ||
Land | lnd | Land Features | fts |
Structures | str | Structure Features | fts |
Transport | trn | Transport Features | fts |
Transport Network | ntwk | ||
RAMI | rami | ||
Administrative and Statistical Units | asu | Boundaries | bdy |
Address | add | GB Address | gb |
Islands Address | isl | ||
Geographical Names | gnm | Named Features | fts |
Last updated