On Tue, Dec 7, 2010 at 8:43 AM, Frank Gasdorf <[email protected]> wrote: > Hello, > > I'd like to extend the style renderer with an implementation of > org.geotools.renderer.style.MarkFactory to paint symbols of app6a symbol > standard. The idea was to use app6a:// as a prefix for the symbol code > within a SLD document like app6a://${symbolcodeattribute} where the > attribute is taken from feature. > > The implementation generates a BufferedImage for the symbol. But right now > I've no idea how to generate a shape out of it: > > public class App6AMarkFactory implements MarkFactory { > > public Shape getShape(Graphics2D g2, Expression symbolUrl, > Feature feature) throws Exception { > > BufferedImage bi = ... > Rectangle imageRect = new Rectangle(0, 0, bi.getWidth(), > bi.getHeight()); > > TexturePaint imagePaint = new TexturePaint(bi, imageRect); > > Shape shape = ???? > > return shape; > } > > Do you have any suggestions? Is there any other interface to extend the > style renderer with other symbols?
Marks are shapes because they are meant to be filled and stroked with whatever the user stated in the sld. So they are hollow vector shapes to be painted. If your symbol ends up as a buffered image your have to implement an ExternalGraphicFactory and use ImageIcon to bridge between Icon and BufferedImage Cheers Andrea ----------------------------------------------------- Ing. Andrea Aime Senior Software Engineer GeoSolutions S.A.S. Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584962313 fax: +39 0584962313 http://www.geo-solutions.it http://geo-solutions.blogspot.com/ http://www.linkedin.com/in/andreaaime http://twitter.com/geowolf ----------------------------------------------------- ------------------------------------------------------------------------------ What happens now with your Lotus Notes apps - do you make another costly upgrade, or settle for being marooned without product support? Time to move off Lotus Notes and onto the cloud with Force.com, apps are easier to build, use, and manage than apps on traditional platforms. Sign up for the Lotus Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
