I am trying to develop a web page displaying a base layer from Ordnance Survey openspace api and overlaying flood polygon data on to from geoserver. I understand that the CRS for OS is EPSG:27700 so what I have done is:

1) Loaded the flood data already in EPSG:27700 into Geoserver 2) Ensured that the Native CRS specified in GeoServer is EPSG:27700 3) Checked that the layer displays something in the "Layer Preview" 4) Created a basic webpage using OpenLayers3 utilising the handy JS code from Bill Chadwick (http://www.bdcc.co.uk/ol3/examples/os-openspace.html)

Here is the code I am using:


    var openSpaceOl3 = new OpenSpaceOl3('EB8FE9471221364EE0430B6CA40A6BDC', document.URL, OpenSpaceOl3.ALL_LAYERS);

  var layers = [  openSpaceOl3.getLayer(),
        new ol.layer.Tile({
      extent: ol.proj.transformExtent([-6, 49, 2, 56], 'EPSG:4326', 'EPSG:27700'),
      source: new ol.source.TileWMS({
        url: 'http://localhost:8080/geoserver/FloodRisk/wms',
        params: {workspace:'Flood', layers: 'LowRisk', tiled: true},
        serverType: 'geoserver',
        projection: openSpaceOl3.getProjection();

  var map = new ol.Map({
    layers: layers,
    loadTilesWhileInteracting: true,
    target: 'map',
    view: new ol.View({
      center: ol.proj.transform([0, 52.5], 'EPSG:4326', 'EPSG:27700'),
      zoom: 8,
      projection: openSpaceOl3.getProjection();


The base layer displays correctly on its own, but when I add in the flood layer from GeoServer it doesn't work. It should work without too much problem if the projections of both layers are EPSG 27700 - right?!? I know that there are some more complicated examples overlaying OSM and OS tiles which require the proj4 transformations, but these should not be required if the transformation is the same - right? :-)

I have a feeling that some of the problem could be also due to the extents for the flood layer not being correct as when I take this line out the OS map does display and I can see calls to Geoserver in fiddler, but the tiles are not correct (presumably because the extents are missing).

Any ideas? - there could me multiple problems with the above code as I'm tying myself in knots trying to figure it out!


I'm an idiot - I did need to include the proj4s.js library because open layers knows nothing about the 27700 projection. Once I did this and fixed a few other things it worked out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.