Back to Resources

Bringing the OS NGD to Desktop GIS

Share
LinkedInFacebook

Martin Daly, technical director, Cadcorp

Almost five years ago, I contributed a guest post to the Ordnance Survey’s blog, entitled “Bringing the OS Data Hub to Desktop GIS”. I finished that post by saying:

“OS have invested a great deal of time and effort in the OS Data Hub, and we at Cadcorp have no doubt that it is a practical, sensible and desirable way of delivering OS data, and that it is here to stay.”

Lessons from history

All that hard work is great, but without the right tools there is a danger that end users of OS data, especially those without highly technical knowledge and/or the time to familiarise themselves, will be left behind.

We’ve seen this happen in the relatively recent past with the introduction of OS MasterMap Topography Layer (henceforth Topo), in 2001. That was an extreme culture shock for many organisations. Even something as simple as the size-on-disk of the supplied data proved frightening, let alone the more-or-less compulsory use of a spatial database to store and manage the data, plus the freshly minted ‘Change-only Update’ concept.

Over time though, thanks to the tools provided by OS’s many software partners, and, frankly, thanks to the inevitability of the industry having to follow OS’s lead, we got there.

Similar, but different

The move from Land-Line NTF to Topo GML was notable for adding ‘feature types’ and attributes. OS NGD also does this, but on steroids.

Topo classified feature types partly by their geometry, eg TopographicArea, and partly by function, eg CartographicText. Some of the added attributes described what those features represented in the real world, eg the Theme, such as “Buildings”, “Land”, etc.

NGD’s primary classification is by nine themes: Address, Administrative and Statistical Units, Buildings, Geographical Names, Land, Land Use, Structures, Transport, and Water. These somewhat mirror the Topo Theme property, but not exactly. Below this level come collections, which are groupings of related feature types, eg “Water Network”. At the bottom level is the feature type, which is the first time the geometry makes an appearance, eg “Building Line”, “Structure Point”, etc.

Each of these feature types has a large set of attributes, two or three or more times as many as we saw with Topo. These make the NGD an incredibly powerful dataset for many more use cases, including complex analysis. This is a significant step up from what was possible with Topo which, more often than not, was used as the world’s most detailed, highest quality, background map.

Different, but similar

Presenting this Cambrian explosion of feature types and attributes in a way that allows both casual and advanced use is … not trivial. There is also the added excitement of three methods of delivery: an OGC API – Features service (OS NGD API – Features), an OGC API – Tiles service (OS NGD API – Tiles) and a download service (OS Select+Build).

Thanks to the extensive support that we added for the Data Hub 5 years ago, there’s already a natural home for the OS NGD API – Features and OS NGD API – Tiles – the OS (GB) Data Hub page of the SIS Desktop Add Overlay wizard:

Note
The API Key provided must be for either the Premium or the Public Sector Plan; the free Open Data plan does not allow use of any NGD APIs.

OS NGD API – Features

Clicking Next takes you to the dedicated OS NGD API – Features page:

Here you can see that the feature types are categorised by the aforementioned theme, and that expanding the tree for a theme (in this case Transport Network) shows the individual feature types. The list on the right-hand-side has been populated by selecting the required feature types, then clicking the green arrow to add them.

Note
The Transport Network theme has a lot of feature types, too many to fit in the available space, some of which have been updated since first release (the ‘vX’ on the end of the feature type name represents the version number, eg Path Link is at version 2). So far these feature type updates, have mostly been adding more attributes, on top of the already extensive set, making the NGD features even more useful in even more cases.

When we first implemented this new UI, we cribbed from the OS-supplied stylesheets and offered a choice between ‘Contextual’ (a pre-defined set of feature types) and ‘Analytical’ (a user-selected set of feature types), on this page, based on the stylesheet documentation. We demonstrated an early version to OS themselves, and someone from OS (I will neither confirm nor deny that it was Ian Bennet) suggested using the terminology from OS Select+Build of a ‘recipe’. That was too good a suggestion to ignore, and so the page now allows users to create, edit, and select their favourite set of feature types.

After choosing the desired feature types, down at the bottom of the page the user can decide how to filter the request. The default option, shown, is to limit the requests to the extent of current map view. Other options allow the user to pre-select a feature, eg an LSOA boundary or a Flood Zone, and then filter the request to, for example, only return features that Intersect with the selected LSOA or Flood Zone. There’s also the chance to impose an absolute limit on the number of features per feature type because the NGD API – Features like its predecessor the OS Features API is not intended as a vehicle for bulk downloading.

Important
In order to comply with the OS Data Hub API Service Terms OS NGD features can only be cached locally for the duration of a SIS Desktop session, and so the One-off import option is never enabled, but remains as a reminder of what might have been.

The eagle-eyed among you will have noticed that a lot of this is very similar to what SIS Desktop can do with the OS Features API. In fact the wizard page for the predecessor service looks more or less identical. But. There is a huge advantage in that the new API allows SIS Desktop to request the ‘queryables’ for a feature type (the set of attributes that can be used for queries), and the fixed set of well-known values for those attributes, where relevant. That allows SIS Desktop to offer auto-completion, like so, making query-building trivially easy:

No more having to remember if it is “Wood Or Timber” or “Timber Or Wood”!

OS NGD API – Tiles

The NGD API – Tiles wizard page is a great deal simpler:

Pick the Coordinate Reference System that you want to use (British National Grid or Google Maps-like WGS84 / Pseudo Mercator), and then pick the ‘Tileset’ you are interested in. It seems safe to assume that the Basemap Tileset, highlighted in the screenshot, will be the most widely-used, so you should probably start there.

Putting it all together

Here’s SIS Desktop showing the Basemap Tileset from the NGD API – Tiles centred on the Cadcorp office in Stevenage, with all of the multi-storey car-parks queried from the NGD API – Features (highlighted in dark blue, instead of the standard yellow-ish). The MapTip® on the bottom-most car park shows the multiple height-related attributes – a tiny sample of the plethora of attributes that are available:

OS Select+Build

The NGD API – Tiles and NGD API – Features are, as you have seen, extremely useful and extremely powerful. However, they are not suitable for all use-cases. In particular, large and very large volumes of data are best downloaded using Select+Build.

OS have provided really good, comprehensive documentation on how to use Select+Build, and if you have not used it before that is an excellent place to start.

What you get from Select+Build is one or more data files in your chosen format. For most feature types, OGC GeoPackage will be the natural format to use. You might want to use an alternative such as comma-separated values (CSV) if your data is point-based, eg addresses, and your workflow uses spreadsheet software (within reason – there will be limits on the number of rows that you can use in practice), or involves loading directly into a non-spatial database.

“One or more data files” means almost forty different feature types – and therefore GeoPackage files – for the Transport theme alone. Managing this many related files isn’t always easy, so SIS Desktop provides a simple utility to merge them all into a single GeoPackage. Even then, the tables have complex relationships, with, for example topological “Links” having references to topological “Nodes” (by the new osid attribute, RIP the TOID).

SIS Desktop is clever enough to be able to put Humpty Dumpty together again for the topological Transport and Network themes, just by pointing the Add Overlay wizard at either a single merged GeoPackage file, or a folder full of related files. Doing so rebuilds the topological network from the multiple tables or files, and gives you a ready-to-go routable network.

Here’s a trivially simple route between two points on the network near the Cadcorp office in Stevenage (with the Select+Build data loaded from multiple files in a single folder, and in the standard styling, and NGD API – Tiles in the background faded to make the vector data ‘pop’), showing that the network is fully connected and has network restrictions, eg one-way, etc:

Summary

If you have not started using the NGD, either via the APIs or via Select+Build downloads, then there is no time like the present. Having the right tools that can make either route both familiar and easy-to-use will make your transition smoother.

Once again, like the last time, there’s no doubt that OS’s investment has been significant, and also no doubt that NGD will be the basis of increasing numbers of OS products, with diverse means of access, now and in the future.

Contact us

Get in touch

Give us a call or complete the form. We endeavour to answer all enquiries within 24 hours on business days. We will be happy to answer your questions.

Contact us

    Register for E-news

    Sign up to receive news on Cadcorp products, software updates and invitations to GIS related events.

    Sign up