I would like to add a simple color-bar legend to my OpenLayers maps. I believe that I can do this by adding a LegendGraphic element to the above XML, and then making a GetLegendGraphic request. I am having a hard time finding documentation on how to do this. Is there an example of how to use the LegendGraphic tag, and how to format the GetLegendGraphic request? If someone could provide one, I would be most grateful.
Thanks!
Greg
--
| E R G O N O S I S
| Greg Ederer
| Lead Developer
| greg@anonymised.com
| 360.774.6848
|
I would like to add a simple color-bar legend to my OpenLayers maps. I
believe that I can do this by adding a LegendGraphic element to the
above XML, and then making a GetLegendGraphic request. I am having a
hard time finding documentation on how to do this. Is there an example
of how to use the LegendGraphic tag, and how to format the
GetLegendGraphic request? If someone could provide one, I would be most
grateful.
Thanks!
Greg
--
| E R G O N O S I S
| Greg Ederer
| Lead Developer
| greg@anonymised.com
| 360.774.6848
|
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users
This is very helpful for feature legends. Thanks very much. I didn't know you could do this.
For my rasters, I'm writing a servlet that parses the SLD files and generates the color-bar legend. I may refactor this into a GeoServer plugin at some point. I only started this work because I received no response to the question below. I'd love to know if there is another way to do this, or if someone else working on this.
Cheers,
Greg
Kelly Sharp wrote:
I don't know if this will help but this how I've put tighter as a quick
solution for me
I would like to add a simple color-bar legend to my OpenLayers maps. I believe that I can do this by adding a LegendGraphic element to the above XML, and then making a GetLegendGraphic request. I am having a hard time finding documentation on how to do this. Is there an example of how to use the LegendGraphic tag, and how to format the GetLegendGraphic request? If someone could provide one, I would be most grateful.
Thanks!
Greg
--
| E R G O N O S I S
| Greg Ederer
| Lead Developer
| greg@anonymised.com
| 360.774.6848
|
This is very helpful for feature legends. Thanks very much. I didn't know you could do this.
For my rasters, I'm writing a servlet that parses the SLD files and generates the color-bar legend. I may refactor this into a GeoServer plugin at some point. I only started this work because I received no response to the question below. I'd love to know if there is another way to do this, or if someone else working on this.
Not as far as I know. So your code does inspect the symbolizer and
builds dynamically a color bar? This would be very cool and could be
integrated into the GetLegendGraphics code
Exactly. This is currently implemented as a servlet, and is pretty crude (I needed it for a demo). It actually parses the info.xml file for the coverage, gets the default SLD file name, parses the SLD file and uses the ColorMap to produce the legend, then writes it out to the browser as an image/jpeg. It does not support any kind of caching.
I would eventually like to roll this into a GeoServer plugin, and add support for the full subset of the SLD schema that can influence legend composition.
Cheers,
Greg
Andrea Aime wrote:
Not as far as I know. So your code does inspect the symbolizer and
builds dynamically a color bar? This would be very cool and could be
integrated into the GetLegendGraphics code
Cheers
Andrea
--
| E R G O N O S I S
| Greg Ederer
| Lead Developer
| greg@anonymised.com
| 360.774.6848
|
Exactly. This is currently implemented as a servlet, and is pretty crude (I needed it for a demo). It actually parses the info.xml file for the coverage, gets the default SLD file name, parses the SLD file and uses the ColorMap to produce the legend, then writes it out to the browser as an image/jpeg. It does not support any kind of caching.
I would eventually like to roll this into a GeoServer plugin, and add support for the full subset of the SLD schema that can influence legend composition.
Sounds great, minus the bit about the plugin, which I'm not sure about.
We don't have any pluggability in GetLegendGraphics and I'm not sure
we need any... I mean, it seems just a matter of adding your code creating a decent legend for raster symbolizer into the existing one, which at the moment does not know how to deal with raster symbolizer.
If/when you have a patch, just add it to jira.codehaus.org as a new
issue of type improvement. Oh, and if you need any help figuring
out the code, write us mails or ping us on irc (GeoServer at
irc.freenode.net)... I'm not very knowledgeable about that part
of GeoServer but I'll try to help out anyways.
I'll have to take a look at the current implementation of GetLegendGraphics. I would like to be able to get the data I need to compose the color-bar from GeoServer's in-memory representation of the XML files. I'm not sure where those hooks are.
Cheers,
Greg
Andrea Aime wrote:
Greg Ederer ha scritto:
Hi Andrea,
Exactly. This is currently implemented as a servlet, and is pretty crude (I needed it for a demo). It actually parses the info.xml file for the coverage, gets the default SLD file name, parses the SLD file and uses the ColorMap to produce the legend, then writes it out to the browser as an image/jpeg. It does not support any kind of caching.
I would eventually like to roll this into a GeoServer plugin, and add support for the full subset of the SLD schema that can influence legend composition.
Sounds great, minus the bit about the plugin, which I'm not sure about.
We don't have any pluggability in GetLegendGraphics and I'm not sure
we need any... I mean, it seems just a matter of adding your code creating a decent legend for raster symbolizer into the existing one, which at the moment does not know how to deal with raster symbolizer.
If/when you have a patch, just add it to jira.codehaus.org as a new
issue of type improvement. Oh, and if you need any help figuring
out the code, write us mails or ping us on irc (GeoServer at
irc.freenode.net)... I'm not very knowledgeable about that part
of GeoServer but I'll try to help out anyways.
Cheers
Andrea
--
| E R G O N O S I S
| Greg Ederer
| Lead Developer
| greg@anonymised.com
| 360.774.6848
|
Resurrecting and old thread.
I am putting together an initial implementation of GetLegendGraphics for
raster data in GeoServer, therefore I would be interested in seeing this
code and possibly, in integrating it into my work.
Simone.
gederer wrote:
I'll have to take a look at the current implementation of
GetLegendGraphics. I would like to be able to get the data I need to
compose the color-bar from GeoServer's in-memory representation of the
XML files. I'm not sure where those hooks are.
Cheers,
Greg
Andrea Aime wrote:
Greg Ederer ha scritto:
Hi Andrea,
Exactly. This is currently implemented as a servlet, and is pretty
crude (I needed it for a demo). It actually parses the info.xml file
for the coverage, gets the default SLD file name, parses the SLD file
and uses the ColorMap to produce the legend, then writes it out to
the browser as an image/jpeg. It does not support any kind of caching.
I would eventually like to roll this into a GeoServer plugin, and add
support for the full subset of the SLD schema that can influence
legend composition.
Sounds great, minus the bit about the plugin, which I'm not sure about.
We don't have any pluggability in GetLegendGraphics and I'm not sure
we need any... I mean, it seems just a matter of adding your code
creating a decent legend for raster symbolizer into the existing one,
which at the moment does not know how to deal with raster symbolizer.
If/when you have a patch, just add it to jira.codehaus.org as a new
issue of type improvement. Oh, and if you need any help figuring
out the code, write us mails or ping us on irc (GeoServer at
irc.freenode.net)... I'm not very knowledgeable about that part
of GeoServer but I'll try to help out anyways.
Cheers
Andrea
--
| E R G O N O S I S
| Greg Ederer
| Lead Developer
| greg@anonymised.com
| 360.774.6848
|
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users
Resurrecting and old thread.
I am putting together an initial implementation of GetLegendGraphics for
raster data in GeoServer, therefore I would be interested in seeing this
code and possibly, in integrating it into my work.
Simone.
gederer wrote:
I'll have to take a look at the current implementation of
GetLegendGraphics. I would like to be able to get the data I need to
compose the color-bar from GeoServer's in-memory representation of the
XML files. I'm not sure where those hooks are.
Cheers,
Greg
Andrea Aime wrote:
Greg Ederer ha scritto:
Hi Andrea,
Exactly. This is currently implemented as a servlet, and is pretty
crude (I needed it for a demo). It actually parses the info.xml file
for the coverage, gets the default SLD file name, parses the SLD file
and uses the ColorMap to produce the legend, then writes it out to
the browser as an image/jpeg. It does not support any kind of caching.
I would eventually like to roll this into a GeoServer plugin, and add
support for the full subset of the SLD schema that can influence
legend composition.
Sounds great, minus the bit about the plugin, which I'm not sure about.
We don't have any pluggability in GetLegendGraphics and I'm not sure
we need any... I mean, it seems just a matter of adding your code
creating a decent legend for raster symbolizer into the existing one,
which at the moment does not know how to deal with raster symbolizer.
If/when you have a patch, just add it to jira.codehaus.org as a new
issue of type improvement. Oh, and if you need any help figuring
out the code, write us mails or ping us on irc (GeoServer at
irc.freenode.net)... I'm not very knowledgeable about that part
of GeoServer but I'll try to help out anyways.
Cheers
Andrea
--
| E R G O N O S I S
| Greg Ederer
| Lead Developer
| greg@anonymised.com
| 360.774.6848
|
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users