Thanks Jody,
At least I am headed down the right track. I was in fact working with
the Geoserver code (DefaultRasterLegendProducer) for the vector stuff.
I just wanted to make sure there wasn't something already out there.
Will share when done but it will likely need to be sanitized by a better
programmer. J
Peter
From: Jody Garnett [mailto:[email protected]]
Sent: Wednesday, June 30, 2010 4:31 PM
To: Parker, Peter R (DNR); andrea aime
Cc: [email protected]
Subject: Re: [Geotools-gt2-users] Legend
The WMS layes support a get legend graphics operation so you should be
able to make a legend graphic from that.
There is an example request on the user guide wiki.
I had a bit of trouble with it myself as many WMS servers ignore your
requested width and height and return a small image that is part of a
larger icon + title. So in uDig I went to some trouble to extract a
16x16 icon if in fact the WMS ignored me and returned something larger
then the 16x16 icon I asked for.
If you are interested the code is here:
-
http://svn.refractions.net/udig/udig/trunk/plugins/net.refractions.udig.
catalog.wms/src/net/refractions/udig/catalog/internal/wms/WMSGeoResource
Impl.java
For vector layers you need to roll up your sleeves and generate
something - In uDig I used code to look at the SLD for the vector layers
and generate an icon.
-
http://svn.refractions.net/udig/udig/trunk/plugins/net.refractions.udig.
ui/src/net/refractions/udig/ui/graphics/Glyph.java
-
http://svn.refractions.net/udig/udig/trunk/plugins/net.refractions.udig.
project.ui/src/net/refractions/udig/project/ui/internal/LayerGeneratedGl
yphDecorator.java
If you could tame these two uDig specific examples into something for
java swing we could add them to the gt-swing module (and it would be a
great help).
I think the geoserver project also started drawing icons by hand based
on SLD?
Jody
On 01/07/2010, at 7:51 AM, Parker, Peter R (DNR) wrote:
Hello,
I currently have a MapContent that contains some vector data layers and
some WMS source layers. I want to create a Legend image based on the
styles associated with the features in the vector layers and combine
that with images created from the WMS GetLegendGraphic request for the
WMS layers. Any suggestions?
Thank you,
Peter
------------------------------------------------------------------------
------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first --
http://p.sf.net/sfu/sprint-com-first____________________________________
___________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users