Ordnance Survey - OS Opendata

Digimap OpenStream WMS Help

What is the Digimap OpenStream Service?
How do I register for an API Key?
Copyright attribution and citation
Using Digimap OpenStream WMS Parameters to request a map
Embedding an OpenLayers Map in your web page
Using Digimap OpenStream in Google Earth
Using Digimap OpenStream in a desktop GIS

What is the Digimap OpenStream Service?

Digimap OpenStream is an Application Programming Interface (API) to an EDINA Web Map Service providing Ordnance Survey (OS) OpenData mapping products for use with the UK academic community (.ac.uk). The API allows those with some knowledge of web and application development, to incorporate OS OpenData mapping products in their websites, mashups, services and applications, without the overheads of downloading and managing large quantities of data. To use Digimap OpenStream, you must register for an API key.

The following Ordnance Survey OpenData products are available via Digimap OpenStream: GB Overview, Miniscale, 1:250000 Colour Raster, Vector Map District Raster and OS Streetview. See an example OpenLayers map for an illustration of the available products.

How do I register for an API key?

To use the Digimap OpenStream WMS you first need to register for an API key. During the simple registration process an account activation link will be sent to your registered email address. Please note: registered email addresses must be within the 'ac.uk' domain. Once you have activated your account you will be able to login. Upon login you will be redirected to your account profile where you will find your API key. Your profile and API key are always available to view via the link in the top right corner of each Digimap OpenStream web page.

Back to top

Copyright attribution and citation

The following attribution must be added to any and all derived applications and images:

Contains Ordnance Survey data. (c) Crown copyright and database right 2010. Data provided by Digimap OpenStream, an EDINA, University of Edinburgh Service.

Using Digimap OpenStream WMS Parameters to request maps

The url for the Digimap OpenStream WMS is:

http://openstream.edina.ac.uk/openstream/wms?token=[your_aipkey]

This URL, combined with other parameters (see below) form the basic WMS GetMap request url (sent from your application, service or web page) to the Digimap OpenStream service. This request url queries the OpenStream WMS, which then returns the specific map layer, or layers, requested.

The required parameters for a basic WMS GetMap request are:

parameter nameparameter valuenotes
TOKENYour registered api key.
REQUESTGetMapThe required WMS request type.
SERVICEWMSSpecifies the type of service.
VERSION1.1.1
SRSEPSG:27700 | EPSG:4326Spatial Reference System.
EPSG:27700 = British National Grid.
EPSG:4326 = WGS84 (e.g. the SRS used by Google)
BBOXA bounding box of the form minx, miny, maxx, maxyProvide British National Grid or Lat/Long coordinates depending on SRS
FORMATimage/png | image/jpeg | image/gifpng is recommended for best quality image.
LAYERSosopendata, gb, miniscale_100, vmd_raster, raster_250k, streetviewThese are the map layers which can be requested in the WMS GetMap request. You can request just one, or any combination of them. Note that the “osopendata” layers includes all products.
WIDTHwidth of required map in pixelsUsed to adjust the size of map you want in your application / website.
HEIGHTheight of required map in pixelsUsed to adjust the size of map you want in your application / website.

The optional parameters for a basic WMS GetMap request are:

parameter nameparameter valuenotes
CACHEtrue | falseA value of 'false' will bypass the tilecache and call the WMS directly. Default is false. Setting CACHE to true will return a map faster in most cases but as tile size is fixed, you might get map back than the area defined in your bounding box.

An example request url which queries the WMS directly for the osopendata layer would look like...

http://openstream.edina.ac.uk/openstream/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1
&BBOX=325000,674000,326000,675000&WIDTH=460&HEIGHT=640
&SRS=EPSG:27700&FORMAT=image/png&LAYERS=osopendata&CACHE=false&TOKEN=[YOUR_APIKEY]

Back to top

Embedding an OpenLayers Map in your webpage.

If all you want to do is to embed a map with zoom and pan functions into your web page, you could add the following code to your html. This will embed an simple OpenLayers map browser which uses the Digimap OpenStream WMS.

<html>
<head>
<script src='http://openlayers.org/api/OpenLayers.js'></script>
<script>
var map;
var bounds = new OpenLayers.Bounds (0, 0, 700000, 1300000);
var apikey = "[YOUR API KEY]";
var cache = "true"; 
var attr = "Contains Ordnance Survey data. (c) Crown copyright and database right 20XX. Data provided by Digimap OpenStream, an EDINA, University of Edinburgh Service.";
var os_options = {
        token: apikey,
        format: "image/png",
        layers: "osopendata",
        cache: cache
};

function init() {

	map = new OpenLayers.Map('map', {controls: [], 
	projection: new OpenLayers.Projection("EPSG:27700"), 
	units: "m", 
	maxExtent: bounds, 
	resolutions: [1763.889,352.778,176.389,88.194,
	35.278,26.458,17.639,8.819,3.528,1.764,0.882,0.441]} );

	var osopenlayer = new OpenLayers.Layer.WMS( 
	       "Edina OS OpenData WMS","http://openstream.edina.ac.uk/openstream/wms",
		os_options, 
		{attribution: attr});

	map.addLayers([osopenlayer]);
	map.addControl(new OpenLayers.Control.Navigation());
	map.addControl(new OpenLayers.Control.PanZoomBar());
	map.addControl(new OpenLayers.Control.Attribution());
	if (!map.getCenter()) map.zoomToMaxExtent();
}
</script>
<script>window.onload=init;</script>
</head>
<body>
<div id="map" style="width:460px; height:480px;"></div>
</body>
</html>

See an example OpenLayers map here.

Back to top

Using Digimap OpenStream in Google Earth.

Follow these instructions to add OS OpenData products as a new layer in Google Earth:

1. Once you have Google Earth running go the Add menu and select Image Overlay

2. The New Image Overlay dialog box should now be open:

Click on the Refresh button, then click the WMS Parameters button.

3. You should now see the Web Mapping Service parameters window. Click on the Add button and in the dialog box that opens, enter the URL: http://openstream.edina.ac.uk/openstream/wms?token=your_aipkey (your API key can be found by clicking on the View Profile / API Key link on all Digimap OpenStream pages.) and click OK.

4. Google Earth will now fetch the WMS layers associated with the URL you entered, i.e. all those available through Digimap OpenStream, and they will be listed in the Transparent Layers box on the left hand side of the WMS Parameters window. Select the Layers you want to view by clicking on them in the Transparent Layers list, then click the Add - > button to move the to the Selected Layers list.

Once you are happy with your layer selection, click OK to return to the New Image Overlay window

5. Now in the New Image Overlay window, make the following changes:

a) Enter a name for your overlay in the NAME field (e.g. “Digimap OpenStream”)
b) In the Link field, locate the text “FORMAT=image/gif” and change “gif” to “png” (the default image format is gif, but this provides a very poor image. Changing this to png greatly improves image quality)
c) In the View-Based Refresh section, change When: from “Never” to “After Camera Stops” and from “4 secs” to “0 secs” (you can try other settings here if you wish).

d) Click OK and the New Image Overlay window will close, returning you to the main Google Earth view.

6. Zoom to the UK and you should now see the first Digimap OpenStream layer (assuming you selected the “OS Open Data” layer which contains all products). You'll also see Digimap OpenStream (or whatever you called the layer) listed in the Places list in the left-hand panel.

7. As you zoom in you will see other Digimap OpenStream map layers, depending on your viewing scale (assuming you selected the “OS Open Data” layer which contains all products). If you selected one specific product layer (e.g “Raster_250k”) rather than the “OS Open Data” layer, you will need to zoom in until you reach an appropriate scale, at which point the product will appear. Scale thresholds for each layer are as follows:

  • GB View: 1:10,000,000 to 1:2,000,000
  • Miniscale: 1:2,000,000 to 1:260,000
  • 250k Raster: 1:260,000 to 1:55,000
  • Vector Map District: 1:55,000 to 1:6,000
  • Streetview: 1:6,000 to 1:100

8. Note that Google Earth restricts the extent of the WMS layer that is viewable at any one time (this is the case for all WMS layers, not just Digimap OpenStream). This is shown in the image below. As you pan and zoom around, or change your Google Earth window size, the map will update but the relative extent of the WMS view will remain the same.

Back to top

Using Digimap OpenStream in a desktop GIS.

Follow the instructions at the links below to use OS OpenData products in a number of desktop GIS applications:

ArcGIS: http://gogeo.blogs.edina.ac.uk/2010/10/11/digimap-openstream/

QGIS: http://gogeo.blogs.edina.ac.uk/2010/10/12/digimap-openstream-part-ii/

gvSIG: http://gogeo.blogs.edina.ac.uk/2010/10/13/digimap-openstream-%E2%80%93-part-iii/

Back to top
 

Privacy & Cookie Policy