Spatial filters in SLDs

Brock Anderson banders at REFRACTIONS.NET
Wed Sep 29 14:25:57 EDT 2004


Has anyone used MapServer with SLDs that have spatial filters?

I have successfully used SLDs that apply rules based on attributes
values, but when I apply rules based on a bbox MapServer matches
everything, not just the features in the region I specified.  The file I
am using is pasted below.

Does anyone have an example SLD file that I can work from?

Brock Anderson


<?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:gml="http://www.opengis.net/gml">
 <NamedLayer>
   <Name>NTS_BC_WATER_LINES_125M</Name>
   <UserStyle>
     <Name>Lines</Name>
     <FeatureTypeStyle>

       <Rule>
         <ogc:Filter>
           <ogc:BBOX>
             <PropertyName>GEOMETRY</PropertyName>
             <gml:Box srsName="epsg:42102">
               <gml:coordinates>1191617,385898
1212589,409826</gml:coordinates>
             </gml:Box>
           </ogc:BBOX>
         </ogc:Filter>
         <LineSymbolizer>
          <Stroke>
            <CssParameter name="stroke">#bbec33</CssParameter>
            <CssParameter name="stroke-width">5.0</CssParameter>
          </Stroke>
        </LineSymbolizer>
       </Rule>

     </FeatureTypeStyle>
    </UserStyle>
 </NamedLayer>
</StyledLayerDescriptor>



More information about the mapserver-users mailing list