Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm serving a layer via WMS that has multiple Polygons with transparency set to 30%. The polygons can overlap each other resulting in darker areas where the transparencies combine. Is it possible to prevent this?

UPDATE: Transparency is set via <CssParameter name="fill-opacity">0.5</CssParameter> of <Fill> element in SLD definition. The whole SLD looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
  <NamedLayer>
    <Name>plochaQ5ZU</Name>
    <UserStyle>
      <Name>Q5ZU</Name>
      <FeatureTypeStyle>

        <Rule>
          <Name>Q5ZU</Name>
          <Title>Q5ZU</Title>
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">#0070D4</CssParameter>
              <CssParameter name="fill-opacity">0.5</CssParameter>
            </Fill>
          </PolygonSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

I'm using OpenLayers to display the layer.

share|improve this question
    
How have you set the layer transparancy, including your SLD will help understand what you are trying to achieve and get you a better answer. What Client are you using to display the layers? P;ease update your question with this information. Cheers –  Mark C Nov 21 '13 at 7:19
    
Edited question. –  zimmi Nov 21 '13 at 9:42
    
Ok, you are styling Polygons on a Layer, not styling a Layer. Now, is there two layers being styled, or are you referring to the case where two Polygons on the same layer overlap each other? –  Mark C Nov 22 '13 at 0:31
    
Two polygons on the same layer. –  zimmi Nov 22 '13 at 10:50
add comment

1 Answer

You have two polygons that overlap with transparency set. This results in the overlaps appearing darker.

As far as I Know, the SLD for Polygons does not allow for partial transparencies within an individual Polygon area, you would have to truncate your polygons where the overlap occurred and create a new polygon to replace the overlapped area then style the new polygon to the same transparency.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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