[Geoserver-users] legend graphics, sld rules, etc.

Hi lists,

I'm on a quest to get good looking legends in my mapbuilder based, geoserver backed webgis client. The problem is the following:

most of my layers have more than one class. This is expressed by more than one rules in the SLD for that layer. I want all used classes for my layers show up in my legend. I see 2 ways to solve this: having geoserver create a graphic for all rules of that layer, or looping the rules in mapbuilder and requesting one icon per rule.

However:

- when doing a getLegendGraphic request at geoserver and omitting any rules, I only get the icon for the first rule back. I thought the spec said that in this case, the WMS service should return a graphic that is representative for all rules of that layer? What did I do wrong?

- I can't find a way to get the current rules for the current style of a layer in mapbuilder (e.g. by some request to geoserver and parsing some xml). I tried to find it in the OGC documentation, but did not find anything (but I might have overlooked it, as to my experience this documentation was pretty maze-like...) Anyone knows a way to get the rules of the current style of a layer from geoserver?

Cheers,
Vincent.

btw both geoserver (and geotools) and mapbuilder are pretty recent versions from svn, at most one week old.

Vincent,

last time I checked GetLegendGraphic with Geoserver (around the Lausanne conference, sept 2006), everything was fine and it displayed an image representative of all the rules. Only problem I found is that the image misses the labels (Rule Titles or Names).

See also (slide 26):

http://www.foss4g2006.org/materialDisplay.py?contribId=16&sessionId=37&materialId=slides&confId=1

Wrt your second question, the SLD WMS spec has a GetStyles request which returns an SLD document describing all the rules in a style.

Best regards,
Bart

Vincent Schut schreef:

Hi lists,

I'm on a quest to get good looking legends in my mapbuilder based, geoserver backed webgis client. The problem is the following:

most of my layers have more than one class. This is expressed by more than one rules in the SLD for that layer. I want all used classes for my layers show up in my legend. I see 2 ways to solve this: having geoserver create a graphic for all rules of that layer, or looping the rules in mapbuilder and requesting one icon per rule.

However:

- when doing a getLegendGraphic request at geoserver and omitting any rules, I only get the icon for the first rule back. I thought the spec said that in this case, the WMS service should return a graphic that is representative for all rules of that layer? What did I do wrong?

- I can't find a way to get the current rules for the current style of a layer in mapbuilder (e.g. by some request to geoserver and parsing some xml). I tried to find it in the OGC documentation, but did not find anything (but I might have overlooked it, as to my experience this documentation was pretty maze-like...) Anyone knows a way to get the rules of the current style of a layer from geoserver?

Cheers,
Vincent.

btw both geoserver (and geotools) and mapbuilder are pretty recent versions from svn, at most one week old.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mapbuilder-users mailing list
Mapbuilder-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mapbuilder-users

--
Bart van den Eijnden
OSGIS, Open Source GIS
bartvde@anonymised.com
http://www.osgis.nl

Is putting labels on the recommended way of the spec? Bart, could you add that request to jira?

Bart van den Eijnden (OSGIS) wrote:

Vincent,

last time I checked GetLegendGraphic with Geoserver (around the Lausanne conference, sept 2006), everything was fine and it displayed an image representative of all the rules. Only problem I found is that the image misses the labels (Rule Titles or Names).

See also (slide 26):

http://www.foss4g2006.org/materialDisplay.py?contribId=16&sessionId=37&materialId=slides&confId=1

Wrt your second question, the SLD WMS spec has a GetStyles request which returns an SLD document describing all the rules in a style.

Best regards,
Bart

Vincent Schut schreef:

Hi lists,

I'm on a quest to get good looking legends in my mapbuilder based, geoserver backed webgis client. The problem is the following:

most of my layers have more than one class. This is expressed by more than one rules in the SLD for that layer. I want all used classes for my layers show up in my legend. I see 2 ways to solve this: having geoserver create a graphic for all rules of that layer, or looping the rules in mapbuilder and requesting one icon per rule.

However:

- when doing a getLegendGraphic request at geoserver and omitting any rules, I only get the icon for the first rule back. I thought the spec said that in this case, the WMS service should return a graphic that is representative for all rules of that layer? What did I do wrong?

- I can't find a way to get the current rules for the current style of a layer in mapbuilder (e.g. by some request to geoserver and parsing some xml). I tried to find it in the OGC documentation, but did not find anything (but I might have overlooked it, as to my experience this documentation was pretty maze-like...) Anyone knows a way to get the rules of the current style of a layer from geoserver?

Cheers,
Vincent.

btw both geoserver (and geotools) and mapbuilder are pretty recent versions from svn, at most one week old.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mapbuilder-users mailing list
Mapbuilder-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mapbuilder-users

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

[still cc-ing to mb user list, though the discussion is becoming more geoserver-centric, but mb people might still be interested?]

- About the getLegendGraphic for all rules of one layer:

For line and polygon layers this works, but for point layers geoserver just gives me one icon. See the attached sld, which defines 2 rules, one for larger cities and 1 for other cities. Geoserver just gives me one graphic back with a getLegendGraphic request on a point layer with this style. The layer renders OK though, with both symbols appearing in the image.
Can someone test this and confirm?

Furthermore, shouldn't geoserver multiply the HEIGHT parameter with the number of rules rendered in the legendGraphic, so the height (and width) apply to a single sld rule icon, instead of to the entire rendering result? Because there is no way to beforehand know the number of rules (from a client point of view), one cannot specify the correct height in the request. However, even when not specifying any height, all rules are being rendered inside one 20x20 pixel graphic, giving some strange results when one has many rules.

- About also rendering the rule titles:

I'd like to see geoserver do that, as there currently is no way to get at the rule names because geoserver does not (afaik) support the WMS getStyle request, so there is no way to put the right names beside your legend class icons.

Cheers,
Vincent.

Bart van den Eijnden (OSGIS) wrote:

Vincent,

last time I checked GetLegendGraphic with Geoserver (around the Lausanne conference, sept 2006), everything was fine and it displayed an image representative of all the rules. Only problem I found is that the image misses the labels (Rule Titles or Names).

See also (slide 26):

http://www.foss4g2006.org/materialDisplay.py?contribId=16&sessionId=37&materialId=slides&confId=1

Wrt your second question, the SLD WMS spec has a GetStyles request which returns an SLD document describing all the rules in a style.

Best regards,
Bart

Vincent Schut schreef:

Hi lists,

I'm on a quest to get good looking legends in my mapbuilder based, geoserver backed webgis client. The problem is the following:

most of my layers have more than one class. This is expressed by more than one rules in the SLD for that layer. I want all used classes for my layers show up in my legend. I see 2 ways to solve this: having geoserver create a graphic for all rules of that layer, or looping the rules in mapbuilder and requesting one icon per rule.

However:

- when doing a getLegendGraphic request at geoserver and omitting any rules, I only get the icon for the first rule back. I thought the spec said that in this case, the WMS service should return a graphic that is representative for all rules of that layer? What did I do wrong?

- I can't find a way to get the current rules for the current style of a layer in mapbuilder (e.g. by some request to geoserver and parsing some xml). I tried to find it in the OGC documentation, but did not find anything (but I might have overlooked it, as to my experience this documentation was pretty maze-like...) Anyone knows a way to get the rules of the current style of a layer from geoserver?

Cheers,
Vincent.

btw both geoserver (and geotools) and mapbuilder are pretty recent versions from svn, at most one week old.

-------------------------------------------------------------------------

Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Mapbuilder-users mailing list
Mapbuilder-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mapbuilder-users

Hi Chris,

if there is no rule, it's the recommended way, there was a thread on this on wms-dev way back:

http://lists.eogeo.org/pipermail/wms-dev/2004-May/000518.html

Best regards,
Bart

Chris Holmes schreef:

Is putting labels on the recommended way of the spec? Bart, could you add that request to jira?

Bart van den Eijnden (OSGIS) wrote:

Vincent,

last time I checked GetLegendGraphic with Geoserver (around the Lausanne conference, sept 2006), everything was fine and it displayed an image representative of all the rules. Only problem I found is that the image misses the labels (Rule Titles or Names).

See also (slide 26):

http://www.foss4g2006.org/materialDisplay.py?contribId=16&sessionId=37&materialId=slides&confId=1

Wrt your second question, the SLD WMS spec has a GetStyles request which returns an SLD document describing all the rules in a style.

Best regards,
Bart

Vincent Schut schreef:

Hi lists,

I'm on a quest to get good looking legends in my mapbuilder based, geoserver backed webgis client. The problem is the following:

most of my layers have more than one class. This is expressed by more than one rules in the SLD for that layer. I want all used classes for my layers show up in my legend. I see 2 ways to solve this: having geoserver create a graphic for all rules of that layer, or looping the rules in mapbuilder and requesting one icon per rule.

However:

- when doing a getLegendGraphic request at geoserver and omitting any rules, I only get the icon for the first rule back. I thought the spec said that in this case, the WMS service should return a graphic that is representative for all rules of that layer? What did I do wrong?

- I can't find a way to get the current rules for the current style of a layer in mapbuilder (e.g. by some request to geoserver and parsing some xml). I tried to find it in the OGC documentation, but did not find anything (but I might have overlooked it, as to my experience this documentation was pretty maze-like...) Anyone knows a way to get the rules of the current style of a layer from geoserver?

Cheers,
Vincent.

btw both geoserver (and geotools) and mapbuilder are pretty recent versions from svn, at most one week old.

-------------------------------------------------------------------------

Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Mapbuilder-users mailing list
Mapbuilder-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mapbuilder-users

--
Bart van den Eijnden
OSGIS, Open Source GIS
bartvde@anonymised.com
http://www.osgis.nl