I would like to ask a question as I'm having an issue here which I cannot really determine what is the actual problem.

Is it that having more styles per layer is not really possible or could it be something else?

Oddly enough, I noticed that if I have more than 6 styles the others don't show up. However, when I looked at the Start Geoserver window there was an error that caught my attention: "The requested style cannot be used with this layer. This style specifies attribute of p_T20 and the layer is..." and it goes on with multiple errors being mentioned.

For this exercise, I'm running on a local server on my machine.


It is perfectly possible to have more than 6 styles associated with a layer (I don't think there is a limit but if there is it is in the thousands).

As the log file is trying to tell you there is a problem with your 6th (or 7th) style. You have asked GeoServer to make use of an attribute called p_T20 but the layer you are asking it to draw doesn't have an attribute called that so it doesn't know what to do and gives up (but only after trying to alert you to the problem in the log file).

The most common issue is that the names are really all in uppercase (or lowercase) and you have used mixed case in your SLD file. It's possible that you have just mistyped the variable name too.

To find out what the attribute names in your layer are called go to the layer's page in the GeoServer admin pages and look at the bottom of the Data tab. There you will see the list of attribute names, exactly as GeoServer expects them to be typed.

  • Indeed, the problem was with the attribute field, the others were wrongly typed. Thanks for the tip. – Geosphere Nov 17 '15 at 10:39

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.