1

I'm using OpenGeo Suite Boundless v2.6

I created a SLD style for a points layer and create 2 rules:

  • Rule to draw a graphics icon from png file.
  • Rule to draw a circle with radius(size) from db table using (OGC Attribute) value in meters.

I use the following code to load the layer in OL3:

    var wmsSource = new ol.source.TileWMS ({
    url: 'http://localhost:8080/geoserver/wms',
    params: {'TILED': true, VERSION:'1.3.0',
       'LAYERS': 'myds:antenna',
    },
    serverType: 'geoserver'
});

new ol.layer.Tile({
         id:'Message',
         title: 'Antennas',
         visible: true ,
         source:wmsSource
     });

The layer loaded correctly on the map in some lower zoom levels (0-10) if i zoomed in to more levels down (11-17) the circle shape is trimmed by the tiles like the image below:

InComplete circle in WMS layer

The strange thing when i set the 2nd rule in the SLD that to get a fixed radius value like (2000) meters - Not from db table -, it draw a complete circle in all zoom levels, but i need to set a different radius for each circle.

I tried many solutions to avoid this error by changing the metatiling factors to be 100x100 instead of 4x4 and change the Gutter to be 100px, it solve the problem but affect the loading speed badly.

So kindly help me solve this problem.

  • 1
    meta tiling and gutters are the only way to fix this but 100x100 is way to high, try 5x5 at most. Or don't use tiles – Ian Turton Aug 24 '15 at 12:20
  • I tried all metatiling configurations (4x4, 5x5, ...) and nothing changed and also i tried to set the WMS layer params: {'TILED': false} to disable tiles but nothing changed also, same problem, so please can you tell me how to load the WMS layer as single image instead of tiles. Thanks – Ahmed GIS Aug 24 '15 at 15:39
  • 1
    if you can generate a simple self contained test it may be a bug - osgeo-org.atlassian.net/projects/GEOS – Ian Turton Aug 24 '15 at 15:46
1

After applying iant suggestion by posting a bug to Geoserver in the following link Geoserver Issue

but the first answer was:

This is not a bug, GeoServer cannot predict how large the circle will be since it's attribute dependent. You have to setup manually a rendering buffer large enough to care for all your needs in the layer configuration: http://docs.geoserver.org/2.7.1/user/webadmin/data/layers.html

Another answer is using ol.source.ImageWMS** instead of using **ol.source.TileWMS` which will return the WMS response in ONE Single Image not tiled image so that the circles will not be trimmed like the previously attached image.

I tried this answer and the incomplete circle disappeared and the result are complete circles with the selected radius from the DB attribute.

So the Conclusion is :

  • Use ol.source.ImageWMS if you want to load the WMS response in a single tile image - not tiled images -.

I wanted to share the solution with anyone facing this problem.

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.