I'm trying to calculate the area of a polygon using the code from this page and I'm getting the following error

The requested Style can not be used with this layer. The style specifies an attribute of geometry and the layer is workspace:layer

Here's my code:

<?xml version="1.0" encoding="ISO-8859-1"?>
<sld:StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"

                                <ogc:Function name="area">
                            <sld:CssParameter name="fill">#777777</sld:CssParameter>


I've tried capital GEOMETRY. Still get the same error.

  • what is your geometry column called then? – Ian Turton Mar 2 '18 at 16:02
  • I'm not sure. How do I find out? – Neil Patrao Mar 2 '18 at 16:04
  • go to the layers menu and select workspace:layer and look at the bottom of the page – Ian Turton Mar 2 '18 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.