[Geoserver-users] GeoWebCache into Leaflet.js

All,

I’m having problems with GeoWebCache, I have a Leaflet.js web mapping site using Proj4Leaflet which consumes 2 WMS feeds from Geoserver (2.3.3), both are Layer Groups (one base mapping the other is data) and everything displays fine when I’m not using GWC.

When I enable caching on the base mapping Layer Group I get two different results at different zoom levels:

  1. At zoom levels 5, 6, 8 & 9: I get “geowebcache-cache-result: HIT”. However the images are misaligned/offset to the non-cached layers

  2. At zoom levels 7, 10, 11, 12, 13 & 14: I get “geowebcache-cache-result: MISS” and “geowebcache-miss-reason: request does not align to grid(s) ‘Ordnance_Survey_National_Grid’”. Because the cache isn’t used the layers align correctly

I have created a custom Gridset for this and it is British National Grid, EPSG:27700 (full specification at the foot of the email).

I’m really confused as the resolutions that I’ve defined in my web app exactly match the Gridset below and I can’t work out if I’ve got a problem with the Gridset or something in the Leaflet code.

If anyone could shed any light on this matter or point me in the right direction to troubleshoot it I’d greatly appreciate it. Please let me know if any further information is required.

Kind regards,

Rob

Ordnance_Survey_National_Grid

27700

1346.748175220855

7097.996956234318

671066.5126380573

1230202.1293903186

false

5600.0

2800.0

1400.0

700.0

350.0

175.0

84.0

42.0

21.0

11.2

5.6

2.8

1.4

0.7

0.35

0.14

0.07

1.0

2.8E-4

Ordnance Survey National Grid:0

Ordnance Survey National Grid:1

Ordnance Survey National Grid:2

Ordnance Survey National Grid:3

Ordnance Survey National Grid:4

Ordnance Survey National Grid:5

Ordnance Survey National Grid:6

Ordnance Survey National Grid:7

Ordnance Survey National Grid:8

Ordnance Survey National Grid:9

Ordnance Survey National Grid:10

Ordnance Survey National Grid:11

Ordnance Survey National Grid:12

Ordnance Survey National Grid:13

Ordnance Survey National Grid:14

Ordnance Survey National Grid:15

Ordnance Survey National Grid:16

256

256

false



<br>DISCLAIMER: The information contained in this communication/message from Robert.Langford@anonymised.com..5490... sent on Fri Nov 8 15:20:47 2013 is confidential. It is intended solely for the addressee(s) geoserver-users@lists.sourceforge.net<br><br>Access to this message by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful.<br>As a public body, Salford City Council may be required to disclose this email [or any response to it] under the Freedom of Information Act 2000, unless the information in it is covered by one of the exemptions in the Act.<br>Please immediately contact the sender, Robert.Langford@anonymised.com if you have received this message in error.<br><br>For the full disclaimer please access http://www.salford.gov.uk/e-mail. Thank you.<br>

Hi Robert,
Comparing that to my own gridset, it’s pretty much identical. The only two differences are:
You have an extra zoom-out level (1:20million?), and your bounding box has probably been automatically generated.
Mine is here:

UK_OSGB 27700 0.0 0.0 700000.0 1300000.0 false 2800.0 1400.0 700.0 350.0 175.0 84.0 42.0 21.0 11.2 5.6 2.8 1.4 0.7 0.35 0.14 0.07 1.0 2.8E-4 UK_OSGB:0 UK_OSGB:1 UK_OSGB:2 UK_OSGB:3 UK_OSGB:4 UK_OSGB:5 UK_OSGB:6 UK_OSGB:7 UK_OSGB:8 UK_OSGB:9 UK_OSGB:10 UK_OSGB:11 UK_OSGB:12 UK_OSGB:13 UK_OSGB:14 UK_OSGB:15 256 256 false

So there’s probably nothing wrong with your gridset (mine works fine at least).

It certainly appears from your error that your application is using a different gridset (mine was doing similar things when they weren’t identical).
My javaScript declaration (not leaflet):
resolutions: [2800,1400,700,350,175,84,42,21,11.2,5.6,2.8,1.4,0.7,0.35,0.14,0.07],

Maybe leaflet is doing something it shouldn’t be?
Regards,

Jonathan

This transmission is intended for the named addressee(s) only and may contain sensitive or protectively marked material up to RESTRICTED and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

···

Jonathan Moules

GIS Analyst Programmer,
Corporate GIS,
Warwickshire County Council
Tel: +44 (0)1926 412588, (Internal: 2588)

On 8 November 2013 15:20, Langford, Robert <Robert.Langford@anonymised.com> wrote:

All,

I’m having problems with GeoWebCache, I have a Leaflet.js web mapping site using Proj4Leaflet which consumes 2 WMS feeds from Geoserver (2.3.3), both are Layer Groups (one base mapping the other is data) and everything displays fine when I’m not using GWC.

When I enable caching on the base mapping Layer Group I get two different results at different zoom levels:

  1. At zoom levels 5, 6, 8 & 9: I get “geowebcache-cache-result: HIT”. However the images are misaligned/offset to the non-cached layers

  2. At zoom levels 7, 10, 11, 12, 13 & 14: I get “geowebcache-cache-result: MISS” and “geowebcache-miss-reason: request does not align to grid(s) ‘Ordnance_Survey_National_Grid’”. Because the cache isn’t used the layers align correctly

I have created a custom Gridset for this and it is British National Grid, EPSG:27700 (full specification at the foot of the email).

I’m really confused as the resolutions that I’ve defined in my web app exactly match the Gridset below and I can’t work out if I’ve got a problem with the Gridset or something in the Leaflet code.

If anyone could shed any light on this matter or point me in the right direction to troubleshoot it I’d greatly appreciate it. Please let me know if any further information is required.

Kind regards,

Rob

Ordnance_Survey_National_Grid

27700

1346.748175220855

7097.996956234318

671066.5126380573

1230202.1293903186

false

5600.0

2800.0

1400.0

700.0

350.0

175.0

84.0

42.0

21.0

11.2

5.6

2.8

1.4

0.7

0.35

0.14

0.07

1.0

2.8E-4

Ordnance Survey National Grid:0

Ordnance Survey National Grid:1

Ordnance Survey National Grid:2

Ordnance Survey National Grid:3

Ordnance Survey National Grid:4

Ordnance Survey National Grid:5

Ordnance Survey National Grid:6

Ordnance Survey National Grid:7

Ordnance Survey National Grid:8

Ordnance Survey National Grid:9

Ordnance Survey National Grid:10

Ordnance Survey National Grid:11

Ordnance Survey National Grid:12

Ordnance Survey National Grid:13

Ordnance Survey National Grid:14

Ordnance Survey National Grid:15

Ordnance Survey National Grid:16

256

256

false



<br>DISCLAIMER: The information contained in this communication/message from [Robert.Langford@anonymised.com..5490...](mailto:Robert.Langford@anonymised.com) sent on Fri Nov 8 15:20:47 2013 is confidential. It is intended solely for the addressee(s) [geoserver-users@lists.sourceforge.net](mailto:geoserver-users@anonymised.comrceforge.net)<br><br>Access to this message by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful.<br>As a public body, Salford City Council may be required to disclose this email [or any response to it] under the Freedom of Information Act 2000, unless the information in it is covered by one of the exemptions in the Act. <br>Please immediately contact the sender, [Robert.Langford@anonymised.com](mailto:Robert.Langford@anonymised.com.5490...) if you have received this message in error. <br><br>For the full disclaimer please access [http://www.salford.gov.uk/e-mail](http://www.salford.gov.uk/e-mail). Thank you.<br>


November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Jonathan – Thanks for your input, you were correct it was Leaflet (well my incorrect use of it!).

For anyone else struggling;

When I’d defined the CRS (EPSG:27700) using Proj4Leaflet, I defined the projection and resolutions but didn’t define the origin (it wasn’t in the example I was following), therefore tiles were right resolution but wrong co-ords, so WMS was working but anything Tiled wasn’t.

Working JavaScript for reference is:

var crs = new L**.Proj.CRS(** ‘EPSG:27700’,

‘+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000’ +

‘+ellps=airy +datum=OSGB36 +units=m +no_defs’,

{

origin**:** [350000, 380000**],**

resolutions**:** [

5600**,** 2800**,** 1400**,** 700**,** 350**,** 175**,** 84**,** 42**,** 21**,** 11.2**,** 5.6**,** 2.8**,** 1.4**,** 0.7**,** 0.35**,** 0.14**,** 0.07

]

}

);

Where the origin values are the ‘Min X’ and ‘Min Y’ from the Geoserver Gridset (changed from my initial email).

Rob

From: Jonathan Moules [mailto:jonathanmoules@anonymised.com]
Sent: 13 November 2013 17:14
To: Langford, Robert
Cc: geoserver-users@lists.sourceforge.net
Subject: [Maybe Spam]Re: [Geoserver-users] GeoWebCache into Leaflet.js

Hi Robert,

Comparing that to my own gridset, it’s pretty much identical. The only two differences are:

You have an extra zoom-out level (1:20million?), and your bounding box has probably been automatically generated.

Mine is here:

UK_OSGB

27700

0.0

0.0

700000.0

1300000.0

false

2800.0

1400.0

700.0

350.0

175.0

84.0

42.0

21.0

11.2

5.6

2.8

1.4

0.7

0.35

0.14

0.07

1.0

2.8E-4

UK_OSGB:0

UK_OSGB:1

UK_OSGB:2

UK_OSGB:3

UK_OSGB:4

UK_OSGB:5

UK_OSGB:6

UK_OSGB:7

UK_OSGB:8

UK_OSGB:9

UK_OSGB:10

UK_OSGB:11

UK_OSGB:12

UK_OSGB:13

UK_OSGB:14

UK_OSGB:15

256

256

false

So there’s probably nothing wrong with your gridset (mine works fine at least).

It certainly appears from your error that your application is using a different gridset (mine was doing similar things when they weren’t identical).

My javaScript declaration (not leaflet):

resolutions: [2800,1400,700,350,175,84,42,21,11.2,5.6,2.8,1.4,0.7,0.35,0.14,0.07],

Maybe leaflet is doing something it shouldn’t be?

Regards,

Jonathan

Jonathan Moules

GIS Analyst Programmer,
Corporate GIS,
Warwickshire County Council
Tel: +44 (0)1926 412588, (Internal: 2588)

On 8 November 2013 15:20, Langford, Robert <Robert.Langford@anonymised.com> wrote:

All,

I’m having problems with GeoWebCache, I have a Leaflet.js web mapping site using Proj4Leaflet which consumes 2 WMS feeds from Geoserver (2.3.3), both are Layer Groups (one base mapping the other is data) and everything displays fine when I’m not using GWC.

When I enable caching on the base mapping Layer Group I get two different results at different zoom levels:

  1. At zoom levels 5, 6, 8 & 9: I get “geowebcache-cache-result: HIT”. However the images are misaligned/offset to the non-cached layers

  2. At zoom levels 7, 10, 11, 12, 13 & 14: I get “geowebcache-cache-result: MISS” and “geowebcache-miss-reason: request does not align to grid(s) ‘Ordnance_Survey_National_Grid’”. Because the cache isn’t used the layers align correctly

I have created a custom Gridset for this and it is British National Grid, EPSG:27700 (full specification at the foot of the email).

I’m really confused as the resolutions that I’ve defined in my web app exactly match the Gridset below and I can’t work out if I’ve got a problem with the Gridset or something in the Leaflet code.

If anyone could shed any light on this matter or point me in the right direction to troubleshoot it I’d greatly appreciate it. Please let me know if any further information is required.

Kind regards,

Rob

Ordnance_Survey_National_Grid

27700

1346.748175220855

7097.996956234318

671066.5126380573

1230202.1293903186

false

5600.0

2800.0

1400.0

700.0

350.0

175.0

84.0

42.0

21.0

11.2

5.6

2.8

1.4

0.7

0.35

0.14

0.07

1.0

2.8E-4

Ordnance Survey National Grid:0

Ordnance Survey National Grid:1

Ordnance Survey National Grid:2

Ordnance Survey National Grid:3

Ordnance Survey National Grid:4

Ordnance Survey National Grid:5

Ordnance Survey National Grid:6

Ordnance Survey National Grid:7

Ordnance Survey National Grid:8

Ordnance Survey National Grid:9

Ordnance Survey National Grid:10

Ordnance Survey National Grid:11

Ordnance Survey National Grid:12

Ordnance Survey National Grid:13

Ordnance Survey National Grid:14

Ordnance Survey National Grid:15

Ordnance Survey National Grid:16

256

256

false



<br>DISCLAIMER: The information contained in this communication/message from [Robert.Langford@anonymised.com](mailto:Robert.Langford@anonymised.com) sent on Fri Nov 8 15:20:47 2013 is confidential. It is intended solely for the addressee(s) [geoserver-users@lists.sourceforge.net](mailto:geoserver-users@lists.sourceforge.net)<br>



<br><br>



<br>Access to this message by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful.<br>



<br>As a public body, Salford City Council may be required to disclose this email [or any response to it] under the Freedom of Information Act 2000, unless the information in it is covered by one of the exemptions in the Act. <br>



<br>Please immediately contact the sender, [Robert.Langford@anonymised.com](mailto:Robert.Langford@anonymised.com) if you have received this message in error. <br>



<br><br>



<br>For the full disclaimer please access [http://www.salford.gov.uk/e-mail](http://www.salford.gov.uk/e-mail). Thank you.<br>


November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk


Geoserver-users mailing list
Geoserver-users@anonymised.comists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

This transmission is intended for the named addressee(s) only and may contain sensitive or protectively marked material up to RESTRICTED and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.



<br>DISCLAIMER: The information contained in this communication/message from Robert.Langford@anonymised.com..5490... sent on Thu Nov 14 11:12:47 2013 is confidential. It is intended solely for the addressee(s) geoserver-users@lists.sourceforge.net;jonathanmoules@anonymised.com<br><br>Access to this message by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful.<br>As a public body, Salford City Council may be required to disclose this email [or any response to it] under the Freedom of Information Act 2000, unless the information in it is covered by one of the exemptions in the Act.<br>Please immediately contact the sender, Robert.Langford@anonymised.com if you have received this message in error.<br><br>For the full disclaimer please access http://www.salford.gov.uk/e-mail. Thank you.<br>