Hi All,

What is the preferred way of rendering a MapContext to an image in 2.3?

In 2.1 I built up an AffineTransform from the getBounds() envelope to 
the (eg 600px by 600px) image size (as Rectangle), created a Graphics2D 
img and then used:

renderer.setContext(mapContext);
renderer.paint(g2d, paintArea, transform);

If I try that now I get a NullPointer from the 
BufferedCoordinateOperationFactory as below:

21-Feb-2007 11:01:25 AM org.geotools.renderer.lite.StreamingRenderer 
processSymbolizers
WARNING: null
java.lang.NullPointerException
        at 
org.geotools.referencing.operation.BufferedCoordinateOperationFactory$CRSPair.<init>(BufferedCoordinateOperationFactory.java:83)
        at 
org.geotools.referencing.operation.BufferedCoordinateOperationFactory.createOperation(BufferedCoordinateOperationFactory.java:245)
        at 
org.geotools.renderer.lite.StreamingRenderer.getMathTransform(StreamingRenderer.java:2053)
        at 
org.geotools.renderer.lite.StreamingRenderer.processSymbolizers(StreamingRenderer.java:1613)
...

The MapContext is built using new 
DefaultMapContext(DefaultGeographicCRS.WGS84);.  The source at line 83 
above is failing on a comparison between source and target CRS - I would 
think my transform would be used to calculate the difference between 
source and target but to be honest, I'm pretty confused on how things 
work now.  Not sure if it's relevant but the underlying data I'm working 
with is a boundary shape file from Statistics Canada covering the 
Toronto area.

Thanks,
Oliver

-------------------------------------------------------------------------
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
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to