Geoserver样式(四)--过滤

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0" 
 xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" 
 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">
  <!-- a Named Layer is the basic building block of an SLD document -->
  <NamedLayer>
    <Name>Road Thematic</Name>
    <UserStyle>
    <!-- Styles can have names, titles and abstracts -->
      <Title>SLD Road Thematic map</Title>
      <Abstract>A sample style that draws a line</Abstract>
      <!-- FeatureTypeStyles describe how to render different features -->
      <!-- A FeatureTypeStyle for rendering lines -->
      <FeatureTypeStyle>
        <Rule>
          <Name>Interstate</Name>
          <Title>Blue Line</Title>
          <ogc:Filter>
          	<ogc:PropertyIsEqualTo>
          		<ogc:PropertyName>CLASS</ogc:PropertyName>
          		<ogc:Literal>Interstate</ogc:Literal>
          	</ogc:PropertyIsEqualTo>
          </ogc:Filter>
        </Rule>
      </FeatureTypeStyle>
      
      <FeatureTypeStyle>
        <Rule>
          <Name>Federal</Name>
          <Title>Blue Line</Title>
          <ogc:Filter>
          	<ogc:PropertyIsEqualTo>
          		<ogc:PropertyName>CLASS</ogc:PropertyName>
          		<ogc:Literal>Federal</ogc:Literal>
          	</ogc:PropertyIsEqualTo>
          </ogc:Filter>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#000000</CssParameter>
              <CssParameter name="stroke-width">4</CssParameter>
            </Stroke>
          </LineSymbolizer>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#FF7F00</CssParameter>
              <CssParameter name="stroke-width">2</CssParameter>
            </Stroke>
          </LineSymbolizer>
        </Rule>
      </FeatureTypeStyle>
        
      <FeatureTypeStyle>
         <Rule>
          <Name>State</Name>
          <Title>Blue Line</Title>
          <ogc:Filter>
          	<ogc:PropertyIsEqualTo>
          		<ogc:PropertyName>CLASS</ogc:PropertyName>
          		<ogc:Literal>State</ogc:Literal>
          	</ogc:PropertyIsEqualTo>
          </ogc:Filter>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#000000</CssParameter>
              <CssParameter name="stroke-width">4</CssParameter>
            </Stroke>
          </LineSymbolizer>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#FFFF00</CssParameter>
              <CssParameter name="stroke-width">2</CssParameter>
            </Stroke>
          </LineSymbolizer>
        </Rule>
      </FeatureTypeStyle>
        
      <FeatureTypeStyle>
         <Rule>
          <Name>Other</Name>
          <Title>Blue Line</Title>
          <ogc:Filter>
          	<ogc:PropertyIsEqualTo>
          		<ogc:PropertyName>CLASS</ogc:PropertyName>
          		<ogc:Literal>Other</ogc:Literal>
          	</ogc:PropertyIsEqualTo>
          </ogc:Filter>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#808080</CssParameter>
              <CssParameter name="stroke-width">4</CssParameter>
            </Stroke>
          </LineSymbolizer>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#0000FF</CssParameter>
              <CssParameter name="stroke-width">2</CssParameter>
            </Stroke>
          </LineSymbolizer>
        </Rule>
      </FeatureTypeStyle>
        
			<FeatureTypeStyle>                
         <Rule>
          <Name>U/C</Name>
          <Title>Blue Line</Title>
          <ogc:Filter>
          	<ogc:PropertyIsEqualTo>
          		<ogc:PropertyName>CLASS</ogc:PropertyName>
          		<ogc:Literal>U/C</ogc:Literal>
          	</ogc:PropertyIsEqualTo>
          </ogc:Filter>
          <LineSymbolizer>
            <Stroke>
            	<CssParameter name="stroke-dasharray">15 10</CssParameter>
              <CssParameter name="stroke">#808080</CssParameter>
              <CssParameter name="stroke-width">4</CssParameter>
            </Stroke>
          </LineSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

你可能感兴趣的:(Geoserver样式(四)--过滤)