1

I've developed a simple web map using GeoServer and OpenLayers in WMS format. The styles are created in Geoserver using SLD and send image tiles to the client. In order to display a point layer, I've used PointSymbolizer and external graphics which shown properly on the map. The problem is the there is not any VendorOptions to control icon overlapping and some points close to each other are drawn on top of each other as shown in the picture.

enter image description here

The following is the of SLD for the point icons. How can make icons to not overlap with each other (the SpaceAround is not the option).

<se:Rule>
  <se:Name>fuel</se:Name>
  <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
   <ogc:PropertyIsEqualTo>
        <ogc:PropertyName>nearby_category_fk</ogc:PropertyName>
        <ogc:Literal>103</ogc:Literal>
      </ogc:PropertyIsEqualTo>
  </ogc:Filter>
  <se:MaxScaleDenominator>136494</se:MaxScaleDenominator>
  <se:PointSymbolizer>
    <se:Graphic>
        <!--Plain SVG fallback, no parameters-->
        <se:ExternalGraphic>
            <se:OnlineResource xlink:href="poi_new_cats/fuel-day.png" xlink:type="simple"/>
            <se:Format>image/png</se:Format>
        </se:ExternalGraphic>
        <!--Well known marker fallback-->
        <se:Mark>
            <se:WellKnownName>square</se:WellKnownName>
            <se:Fill>
                <se:SvgParameter name="fill">#000000</se:SvgParameter>
            </se:Fill>
            <se:Stroke>
                <se:SvgParameter name="stroke">#ffffff</se:SvgParameter>
                <se:SvgParameter name="stroke-width">0.5</se:SvgParameter>
            </se:Stroke>
        </se:Mark>
        <se:Size>20</se:Size>
    </se:Graphic>
   <se:VendorOption name="labelObstacle">true</se:VendorOption>
  </se:PointSymbolizer>
</se:Rule>
3
  • You can't point icons are designed to be drawn no matter what - your only option is to not draw some or all of them until the user has zoomed in enough that they don't overlap
    – Ian Turton
    Apr 8, 2020 at 12:39
  • Thank @IanTurton, but I think it's not possible because in a layer with the same attribute you don't have any option to control the draw of them. Apr 8, 2020 at 12:49
  • Hi all, I have the same problem. The fact is that my points are in the same exact geographical position. @IanTurton, I've seen that someone (like uMap if I'm not wrong) solved this by exploding icons when clicking on the point.. I was wondering if this is possible in an SLD Jun 16, 2022 at 8:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.