1

I'm using OpenLayers and I'm calling an Untiled 3rd party WMS service. I've run some tests to test performance\time differences between the following:

  1. OpenLayers WMS call to the service (mostly slowest)
  2. WMS URL directly into browser (sometimes slowest)
  3. Calling 3rd party WMS service directly (quickest)

I'm using the exact same image dimensions and bounding boxes each time for all calls. I'm seeing differences of 1 to 2 seconds between calls 1 and 3. I'm calling the WMS layer correctly using OpenLayers.Layer.WMS... I've done it before but the time differnce is odd.

Can anyone enlighten me as to why there would be differences?

closed as unclear what you're asking by Devdatta Tengshe, PolyGeo, Curlew, Paul, MappaGnosis Oct 8 '13 at 15:25

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • what do you mean by calling directly? – Ian Turton Jun 6 '13 at 10:37
  • The 3rd party supplier Astrium have a GeoStore where I can request images\tiles directly from. Its the fastest way but its not a mapping application (i.e. I cant pan around etc..) I just use it to test tiles coming back. – gisWeeper Jun 6 '13 at 10:43
  • Is OpenLayers adding anything to make the process slower? – gisWeeper Jun 6 '13 at 10:53
  • is the GeoStore just sending back a precached image instead of drawing? – Ian Turton Jun 6 '13 at 11:01
  • GeoStore sends back a single image tile. Here is a sanitised url: geostore.com/OGC/… – gisWeeper Jun 6 '13 at 11:16
2

If you have your WMS Layer in singleTile mode, OpenLayers has a ratio variable describing the ratio of the requested tile size over the screen size. It defaults to 1.5. This means your requested tile is about 1.5 times larger than the area you see on the screen. This might explain your time difference between 1. and 2.

Here is an example of how to create your WMS layer with ratio=1:

        var layer = new OpenLayers.Layer.WMS(
         "Single Tile", 
         "http://vmap0.tiles.osgeo.org/wms/vmap0",
         {layers: "basic"}, 
         {singleTile: true, ratio: 1}
        );

Also if you are in tiled mode (i.e. singleTile: false) it could be the case that the grid of tiles is a bit larger than your screen size (maximum of 1 tile in width/height). OpenLayers even allows an extra buffer of tiles around the screen, but this defaults to 0.

I see the performance gain of 3. over 2. in the lack of WMS-overhead that your data provider has. So there can be nothing done with OpenLayers.

  • Thanks but I know about the ratio - the WMS request URL's use the same Height and Width and Bounding Box parameters. They return the same tile but at different speeds. – gisWeeper Jun 6 '13 at 13:43
  • Could it be that you first call it with OpenLayers and the second time directly from the browser? Data is then cached and performance better. Just another idea. – EPSG31468 Jun 6 '13 at 13:54
  • No I clear out the cache each time - does OpenLayers just render the image returned or is it doing something specific when it renders the image? – gisWeeper Jun 7 '13 at 8:14
  • 1
    OL does not render the image: rendering is done by the WMS server. OL places the image with CSS in your browser. This should not consume too much time if you stick to few layers and vector features. Clearing the browser cache is not enough: The server has also a cache. – EPSG31468 Jun 8 '13 at 21:06
  • Thanks EPSG - my terminology was incorrect. I realise the image is created (rendered) by the map server I just thought that perhaps OpenLayers was doing something 'sepcial' with the image on the client side resulting in the slow performance but it appears not. In that case the relatively poor performance is still baffling. I hoping the 3rd party WMS will have a tiled version of their service that with a tile cache to improve performance on the server side - but I guess I'll still run into whatever is slowing me down on the client side. – gisWeeper Jun 10 '13 at 8:54

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