How can I know the default style for a layer in Geoserver, and the number of rules it contains, using a REST call or service?

1 Answer 1


You can request the style using REST (_http://myserver.com/geoserver/styles/mystyle). Once you've got the file use something like

grep '<Rule' mystyle.sld | wc -l 

to count the number of lines.

Obviously you can use any programming language of your choice to automate this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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