I have added a new SLD style for my nyc_roads layer but no map is displayed with the new style. I get the error "The requested Style can not be used with this layer. The style specifies an attribute of NAME and the layer is: wsNYCRoads:nyc_roads".

The named layer has already been named as suggested but still the same error appears. Why?

 <Name> wsNYCRoads:nyc_roads </Name>      

I guess the attribute "NAME" is written in capital letters in your style and your column name of your layer/service is "name" without capital letters.could that be?

  • Thanks, I think you are pointing me into the right direction. Still couldn`t make it work though.This is where I found the "NAME" in the code: <Rule> <MaxScaleDenominator>32000</MaxScaleDenominator> <TextSymbolizer> <Label> <ogc:PropertyName>NAME</ogc:PropertyName> </Label> Even if I write my layer name here instead of NAME I get same type of error "The style specifies an attribute of wsNYCRoads:nyc_roads and the layer is: wsNYCRoads:nyc_roads".Tried with just layername and also as NAME="wsNYCRoads:nyc_roads". – nimetu Jan 23 '15 at 22:45
  • <ogc:PropertyName>name</ogc:PropertyName> – Thomas B Jan 24 '15 at 6:33

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.