XML : Trouble styling data for viewing in open layers using XML

I have uploaded data for postGIS using geoserver, now I want to style the data. This is done in XML. I am getting an error message that says

      <?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE ServiceExceptionReport SYSTEM "http://localhost:8080/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd"> <ServiceExceptionReport version="1.1.1" >   <ServiceException>    The requested Style can not be used with this layer.  The style specifies an attribute of PolygonAcres and the layer is: lab4:wa_publiclandsinventory_2014_publicinfo    

Here is my XML code that has been altered to display two groups of data large parks and small parks in WA state from a statewide data set downloaded from the WA GIS database found here

  <?xml version="1.0" encoding="UTF-8"?>  <sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld"  xmlns:sld="http://www.opengis.net/sld"  xmlns:ogc="http://www.opengis.net/ogc"  xmlns:gml="http://www.opengis.net/gml" version="1.0.0">  <sld:NamedLayer>  <sld:Name>public_land_classificiation</sld:Name>  <sld:UserStyle>  <sld:Name>public_land_classification</sld:Name>  <sld:Title>Public Land classification</sld:Title>  <sld:FeatureTypeStyle>  <sld:Name>name</sld:Name>  <sld:Rule>  <sld:Title>Large Parks</sld:Title>  <ogc:Filter>  <ogc:PropertyIsGreaterThanOrEqualTo>  <ogc:PropertyName>PolygonAcres  </ogc:PropertyName>  <ogc:Literal>2</ogc:Literal>  </ogc:PropertyIsGreaterThanOrEqualTo>  </ogc:Filter>  <sld:PolygonSymbolizer>  <sld:Fill>  <sld:CssParameter  name="fill">#FF0000</sld:CssParameter>  </sld:Fill>  <sld:Stroke/>  </sld:PolygonSymbolizer>  </sld:Rule>  <sld:Rule>  <sld:Title>Small Parks</sld:Title>  <ogc:Filter>  <ogc:PropertyIsLessThan>  <ogc:PropertyName>PolygonAcres  </ogc:PropertyName>  <ogc:Literal>2</ogc:Literal>  </ogc:PropertyIsLessThan>  </ogc:Filter>  <sld:PolygonSymbolizer>  <sld:Fill>  <sld:CssParameter  name="fill">#0000FF</sld:CssParameter>  </sld:Fill>  <sld:Stroke/>  </sld:PolygonSymbolizer>    </sld:Rule>    </sld:FeatureTypeStyle>  </sld:UserStyle>  </sld:NamedLayer>  </sld:StyledLayerDescriptor>    

PolygonAcres is an attribute with numerical values from 0-70000 acres or so. I have tried working with other attributes but get basically the same error using the property is equal to state, federal, and local governments using three "rules" to style by different color. Let me know if you need more information..

No comments:

Post a Comment