|
The Ordnance Survey is the UK's national mapping agency. They have a history of leading the way in surveying technology and digital map products. However, their digital products also have the reputation of being very expensive. Recently, the Ordnance Survey launched their "free" OpenSpace service to allow users to add interactive maps to websites. This article is an overview of this service.
Although the Ordnance Survey's digital pricing structure has come under criticism ever since they started to produce digital products in the 1980s, they have also produced a very high quality product. This has been both accurate and rich. They have also been innovative. For example, their flagship digital product 'Mastermap' is a very rich GML-based vector dataset. This is probably the richest GIS dataset that I have ever worked with, and is something that competing products such as OpenStreetMaps can probably never achieve. Criticism of pricing, licensing, and availability has increased over time, and Ordnance Survey appeared to be looking old fashioned as "free for personal use" AJAX programming interfaces became available from Google, Microsoft, Yahoo, and MapQuest. The Ordnance Survey's OpenSpace API fills this space. The OpenSpace is a JavaScript AJAX dynamic map control with many of the features we have come to expect of such services. It supports smooth panning and zooming between a range of scales; as well as supporting boundary, postcode and place name look-ups. Annotation can also be added in the form of markers (pushpins) and lines. Map data tiles are sourced from a number of Ordnance Survey products, including MiniScale® (1:1,000,000 for national maps), 1:250,000 (road maps and gazetteers), LandRanger® (1:50,000), and StreetView® (1:10,000). Note that the 1:250,000 "road map" and 1:50,000 LandRanger are both popular paper map styles that are very familiar to the British public. Aerial imagery is currently not available. To use OpenSpace, you will need an API key. The API key is free after registering on the OpenSpace website and agreeing to Ordnance Survey's Terms and Conditions. Most of the terms and conditions are comparable to the 'free' services offered by the likes of Google and Microsoft. There are bandwidth limits (see below), and applications must be public-facing and freely available. However there are some differences which have come under criticism. Databases of location based data that have been geocoded using OpenSpace are copyrighted (owned) by Ordnance Survey because it is classed as "derived data". This could be problematic for many applications even though you are automatically granted a non-exclusive, personal license to use this data. Full details can be found in the terms and conditions under 'Derived Data'. Note that, contrary to some reports, this restriction does not apply to data that you have geocoded and then plotted using OpenSpace. This restriction is strong, but it is not that much stronger than "data mining" or "reverse engineering" restrictions that prohibit users from deriving their own databases for re-use or re-sale. In common with other free online mapping services, there are usage limits. OpenSpace currently has a limit of 40,000 tiles per 24 hour period. Place name, postcode, and boundary look-ups are each limited to 1000 per 24 hour period. For a fee, commercial applications can remove these limits by signing up for OpenSpace Pro. So how do you use it? The current version of OpenSpace is actually based on OpenLayers, so much of the API will already be familiar to OpenLayers developers. Developers of other JavaScript map APIs (eg. Google Maps and Bing Maps) will also find the interface easy to learn. Here is an example from the documentation that creates a map and draws a shape: 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
// first we restrict the extent that you can pan around the map var options = {restrictedExtent: new OpenSpace.MapBounds(390500, 362700, 472600, 413500)}; // the osMap variable refers to a div element whose size we have set in the html body osMap = new OpenSpace.Map('map', options);
//set centre of map and zoom level (west of Sheffield) osMap.setCenter(new OpenSpace.MapPoint(430218.5, 383541.8), 5);
//initialise our vector layer variable vectorLayer = new OpenLayers.Layer.Vector("Vector Layer"); //define the line style (bright green) var style_green = {strokeColor: "#00FF00", strokeOpacity: 1, strokeWidth: 6}; //push points into array variable(named 'points') points.push(new OpenLayers.Geometry.Point(430170.54, 387588.11)); points.push(new OpenLayers.Geometry.Point(427951.11, 386890.58)); points.push(new OpenLayers.Geometry.Point(425034.14, 387841.77)); points.push(new OpenLayers.Geometry.Point(423512.24, 388285.65)); points.push(new OpenLayers.Geometry.Point(420278.22, 386700.35)); points.push(new OpenLayers.Geometry.Point(419897.74, 384734.56)); points.push(new OpenLayers.Geometry.Point(420722.11, 382515.13)); points.push(new OpenLayers.Geometry.Point(422941.54, 381120.05)); points.push(new OpenLayers.Geometry.Point(424146.37, 377632.38)); points.push(new OpenLayers.Geometry.Point(426746.28, 380485.94)); points.push(new OpenLayers.Geometry.Point(428268.18, 380676.17)); points.push(new OpenLayers.Geometry.Point(429473.01, 382007.83)); points.push(new OpenLayers.Geometry.Point(430868.07, 382261.48)); points.push(new OpenLayers.Geometry.Point(432009.5, 383656.55)); points.push(new OpenLayers.Geometry.Point(432833.86, 384671.15)); //create a polyline feature from the array of points var lineString = new OpenLayers.Geometry.LineString(points); var lineFeature = new OpenLayers.Feature.Vector(lineString, null, style_green); vectorLayer.addFeatures([lineFeature]); //add it to the map osMap.addLayer(vectorLayer);
|
As you can see, the OpenLayers namespace is retained for OpenLayers classes, but the OpenSpace namespace is used for the new Ordnance Survey classes. At the time of writing, current version of OpenSpace (v1.0) uses OpenLayers v2.7. OpenSpace is still a beta service, but it has been used in a number of visually attractive applications. A number of these can be found on Ordnance Survey's OpenSpace Gallery. One of these is the GPX File Generator, which allows a user to create simple straight-line waypoint routes and produce GPX files. An elevation profile is updated as the user clicks new points on the route. Here is an example with a cross-valley profile in the Ilkley area: 
Further information, documentation, support forums and API key registration, can be found on the OpenSpace website at http://openspace.ordnancesurvey.co.uk/ . As can be seen, OpenSpace can produce some very attractive web maps by combining Ordnance Survey imagery with the OpenLayers toolkit. It does not have a routing engine, but supports a number of geocoding look-ups as well as nationwide raster tiles. The licensing terms and conditions might be considered too restrictive for many applications, but OpenSpace does represent a large step forward in making Ordnance Survey data more readily available in the online world.
 |