2

I'm using GeoServer - GeoWebCache with one layer group set to British National Grid (EPSG:27700). All layers within the group are the same projection - EPSG:27700

I've created a gridset for EPSG27700 and set the bounds to match the extent of my layer group.

I'm using OpenLayers 3 to fetch my layer using the following code:

var floodLayer = new ol.layer.Tile({
            extent: [96092.79481278273, 4921.6053531033685, 692596.2537952941, 665725.907765107],

            source: new ol.source.TileWMS({
                url: 'http://GEOSERVER/geoserver/Flood/wms',
                params: { workspace: 'Flood', layers: 'FloodRisk', tiled: true },
                serverType: 'geoserver',
                projection: 'EPSG:27700',

               )
            })

The extents above match the extents for the layer and the grid set. Hence the "Origin" should be the same - right??

So why do all my tile requests say "request does not align". The gridset is set to 256X256, I'm requesting 256x256.

What am I missing here?


So after 1 week of trying to resolve this issue I have to say I am not much further forward. I've set the same extent on the layers, gridset and openlayers request. I've set the same set of resolutions that are used by the OS base layer on the cached gridset, and also set these resolutions on the Flood layer overlay. Everything is the same and should line up, but I'm still getting 95% cache misses with the occasional hit when zoomed in.

  • 2
    There is something wrong with your extent. The valid bounds of 27700 are 1393.0196, 13494.9764, 671196.3657, 1230275.0454 (from spatialreference.org/ref/epsg/osgb-1936-british-national-grid). Why is your lower northing 4921.6053531033685 ? Why is your upper easting 692596.2537952941 ? Did you possibly swap X and Y? – BradHards Dec 13 '16 at 21:34
  • 1
    my usual practice is to use the bounds of 27700 for the grid, never had a problem with ol3 that way – Ian Turton Dec 14 '16 at 8:43
  • The bounds are those reported by the Layer Group "FloodRisk". I assumed that because these are the bounds displayed by GeoServer that I should use them for everything, and that way the grid would align. – Calanus Dec 14 '16 at 17:56
  • Well I'm now getting some cache hits (yay!). But then I realised that the cached tiles are completely misaligned with the base OS layer. Should I change the extent of ALL my layers to match the bounds given by @BradHards? – Calanus Dec 14 '16 at 18:29
  • So I just learned that when you change the gridset bounds you need to clear out the cached tiles otherwise they no longer line up. But I'm still getting a cache miss - this time because no parameter filter exists for FORMAT_OPTIONS, which I will now investigate... – Calanus Dec 15 '16 at 8:08
2

When you create the layer, on the Data tab, under the Bounding Boxes heading, you have two options for automatically creating the bounding boxes: 'Compute from data', and 'Compute from SRS bounds'. You want 'Compute from SRS bounds'.

If you do that, everything will work correctly after that.

  • Went through all the layers, set everything to compute from SRS bounds and the result is still the same - request does not align to grid(s):27700. :-( – Calanus Apr 20 '17 at 15:28
2

I have had a very similar issue. The problem is not related to the UK bounds, but to the tile cache itself.

I have tried multiple times to set up a gridset for British national grid, but no luck so far. I have managed to get EPSG:900913 working without too much trouble, but have failed so far to create a UK grid set that works. The 'request does not align' error is caused by the get map extent bounds not matching one of the grid sets that you have to pre determine in the Gridsets page. Now I was hoping some one cleverer then me listed a Gridset some where for EPSG:27700 but so far no luck!

1

Ran into this same issue with EPSG:27700 and managed to get the requests to align by defining the SRS bounds as integers for both the gridset and layer. So use the default extents but round them to the nearest integer. Hope this helps someone.

  • Hi Sam, can you provide anymore info on this? What version of Geoserver were you using. I have same error where my data is in BNG but I'm trying to use Geoserver to host mapbox tiles – mapping dom Aug 14 at 13:58
0

I had a similar issue my data was in EPSG:27700. What worked for me (on Geoserver 2.15.2) was using a tile gridset based on copy of EPSG:900913. I needed vectortiles to use with mapbox and there are two gotchas here;

  1. Tile size needes to be 512 x 512
  2. You'll need to remove all the layers and add them back so it generates the right pixel size as below

enter image description here

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.