Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've encountered a little problem with my styles having an assigned workspace. For one, I've got to admit that I'm not really sure what good does it make to put a certain style inside a workspace. I just guessed that if that style was going to be used by layers in a workspace, I might aswell add that workspace to the style.

So far, so good. But yesterday I ran into a problem trying to add my WMS service's URL to a map viewer web app. Let me put you in situation.

Let's say I have L1 layer, in W1 workspace with a default style of S1, which is also assigned to W1. Even if so far I didn't have any problems, this particular webapp didn't want to load the L1 layer attached to that same W1 workspace and S1 style. Whenever it did a GetMap request, GeoServer would return a "S1 style not found" error.

So, I had a look at the request itself and I noticed that, while in all other requests the "STYLES" parameter was missing (actually it was set to "(...)&STYLES=&(...)"), in this request it was "STYLES=S1". In fact, if I removed that from the request it worked correctly. This, I'm guessing is because S1 was set as L1 layer's default style.

Surprisingly, considering a L2 layer inside W1 with S1 as style too, it worked perfectly. After a bit of messing around I decided to remove S1's attachment to W1 workspace and, yay!, it worked and I was able to visualize L1 layer. So yes, the problem is solved. Now, my question is...

What is the real purpose of adding a workspace to a style? Is it worth it in any aspect? Should I not worry at all about this and just remove the workspace from all my styles?

Thanks for your help and sorry if it was a little confusing :-)

share|improve this question
add comment

2 Answers

Whether you want/need to assign a style to workspace is up to you. For example, now I need to assign workspace to styles, because different workspaces belong to different groups of users and:

  1. they want some privacy
  2. there may be two different styles of the same name in two different workspaces.

So this is to your question. Regading how to display it, you need to use geoserver/myworkspace/ows?... URL syntax, just geoserver/ows would not work. As a consequence, don't assign styles from different workspaces, that cannot be shown.

share|improve this answer
add comment

You should use SLD styles without Workspaces. When you uploading SLDs to GeoServer do not associate them with workspaces. This is my recommendation. Beacuse i tested this problem (in GeoServer 2.4.2) as same as you. And they worked without error when I use general SLDs.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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