Hi,
I am trying to do this same thing. However, I get the following error shown
in the stack trace. Does anyone have any ideas? I am not using this with
any GUI code, but rather as a backend process to extract an image from a
shapefile. Is there something special I need to setup in my map?
Thanks,
Cliff
Stack trace:
Apr 24, 2008 12:31:50 PM org.geotools.renderer.lite.StreamingRenderer paint
SEVERE: FEATURE_2D
java.lang.NoSuchFieldError: FEATURE_2D
at
org.geotools.renderer.lite.StreamingRenderer.queryLayer(StreamingRenderer.java:897)
at
org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1577)
at
org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:649)
at
org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:481)
at
blastradius.TestCreateImageFromShape.main(TestCreateImageFromShape.java:90)
systemintegrators.ca-2 wrote:
>
> Sample:
>
> ....
>
> MapContext mc = mapContext;
> BufferedImage bufferedImage = null;
>
> bufferedImage = new BufferedImage(width, height,
> BufferedImage.TYPE_INT_RGB);
> graphics2D = (Graphics2D)bufferedImage.getGraphics();
> graphics2D.setRenderingHints(new
> RenderingHints(RenderingHints.KEY_RENDERING,
> RenderingHints.VALUE_RENDER_SPEED));
> graphics2D.setColor(Color.WHITE);
> graphics2D.fillRect(0, 0, width, height);
>
> streamingRenderer = new StreamingRenderer();
> streamingRenderer.setContext(mc);
>
> RenderingHints hints = new
> RenderingHints(RenderingHints.KEY_ANTIALIASING,
> RenderingHints.VALUE_ANTIALIAS_ON );
> streamingRenderer.setJava2DHints(hints);
>
> Map rendererParams = new HashMap();
> rendererParams.put("optimizedDataLoadingEnabled",new Boolean(true)
> );
>
> streamingRenderer.setRendererHints(rendererParams);
> streamingRenderer.paint(graphics2D, new Rectangle(width, height),
> new ReferencedEnvelope(envelope,
> (org.opengis.referencing.crs.CoordinateReferenceSystem)org.geotools.referenc
> ing.crs.DefaultGeographicCRS.WGS84));
>
>
> .....
>
> but you should hack into geoserver.
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
--
View this message in context:
http://www.nabble.com/Convert-a-shape-file-to-a-png-file-tp15539226p16851041.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users