[udig-devel] 3/2 How to render onto an Image using a Map

Jody Garnett jgarnett at refractions.net
Wed Oct 24 10:17:04 PDT 2007


Vince Darley wrote:
> 3) I have a map with a bunch of layers shown.  I'd like to get a 
> renderer (using RenderManager?) which I can use to render an arbitrary 
> bounding box of those layers (not necessarily related to the bounding 
> box of the current view port of the map) to a BufferedImage of 
> arbitrary size which I can then use for other purposes.  Can you fill 
> me in on the basic way to achieve this?
Have a look at the PNG export; or PDF export community modules in 
Jesse's section of svn. Also the map print functionality does this sort 
of work in order to render the Map onto an image for the "Box" you can 
layout on the page.  Map is "just" a data structure so you will find 
some of these examples going about the rendering process with different 
assumptions (say speed vs. quality).

If we have done our job right this should only result in a different set 
of Renderers being selected render the layers of the map. As an example 
- it may be wise to use WMS when drawing to screen (fast!); but to 
switch to WFS when drawing to the printer (high resolution).

Jody


More information about the udig-devel mailing list