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 have a layer which is comprised of a number of different polygons symbolised according to their type.

I have set up a style which successfully filters by type then applies a corresponding fill (in some cases overlays this with a hatch style) and this works great. Now I want to apply the same filters but in some instances apply an external graphic with a transparent background instead of a hatch style.

I have used the sld code found in the Geoserver SLD Cookbook and this works fine on its own but when I try and use it in conjunction with a filter it fails to work.

Has anyone come across this same issue and if so can you help me please?

Thanks

share|improve this question
3  
Please show us your code. –  underdark Jan 25 '11 at 14:42
add comment

1 Answer

There's an example of using an external graphic to fill a polygon at http://suite.opengeo.org/recipes/#sld/polygon/graphicfill

Basically it's:

<Rule>
      <PolygonSymbolizer>
        <Fill>
          <GraphicFill>
            <Graphic>
              <ExternalGraphic>
                <OnlineResource
                  xlink:type="simple"
                  xlink:href="colorblocks.png" />
                <Format>image/png</Format>
              </ExternalGraphic>
            <Size>93</Size>
            </Graphic>
          </GraphicFill>
        </Fill>
      </PolygonSymbolizer>
    </Rule>

Though that's from the SLD cookbook. You can use a url in the xlink:href to refer to a graphic online, and I'm pretty sure it can be transparent. If you post what you've tried then it'll be easier to help, everything should work with filters.

share|improve this answer
add comment

Your Answer

 
discard

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