From: James Macgill <j.macgill@ge...> - 2003-01-27 21:18:08
At 05:30 AM 1/5/2003 +0000, Cameron Shorter wrote:
>On Saturday 04 Jan 2003 6:06 am, Surya S Durbha wrote:
> > Is MapPane(geotools-2) more suited for this purpose?.
>I'm not sure about the rest of your email as I have not worked with the SVG
>code, however mapPane uses Rendering2D which doesn't support SVG.
Sorry, I should have spotted this email sooner....
GT2 has an 'svgsupport' module which uses the rendering2d code and batik to
produce SVG files.
The resolutions are fixed for the moment, but you should be able to
generate SVG from a shapefile using the code that is there with little
Let us know how you get on
From: James Macgill <jmacgill@ps...> - 2003-05-16 13:43:28
At 10:06 PM 1/3/2003 -0800, you wrote:
>I have tried to convert the shape file to SVG using Batiks's
>SVGGraphics2D class. I have used geotools-1 to display the shape file on
>to the viewer and dump the ouput to the SVGGraphics2D, I have seen several
>examples which have drawn some vactor objects(points, lines, polygons etc
>) in JAVA 2D and converted to SVG using SVGGraphics2D. If I use the same
>method, the output of the viewer is getting converted to SVG, but if I
>ZOOM at the SVG it looks like an raster image( later i have found that it
>has been converted to a PNG images and inlined in a SVG document. My
>question is, is it possible to convert the vectors to SVG using the
>Graphics2D. I am under the impression that the viewer of geotools-1
>outputs in vector format. Below is the code i have used..
The viewer in GeoTools 1 used a number of offscreen buffers to speedup
redraws, this enabled highlights and selections could be drawn without
redrawing the whole map. As a result the final rendering involves copying
the off-screen buffer to the display. This is why the Batik library is
creating an image instead of a vector display.
There are two solutions:
First take a look on the geotools.org web site, you will find a recent
which talks about a Shapefile -> SVG converter written by a GeoTools 1 user.
Second, there is an svgsupport module in GeoTools 2 which will do what you
want. It needs some work to make it more configurable (size/bounds of
output for example) but the main process is there.
If you choose the first option, please post any further queries to the
discussion mailing list, if you choose the second option we will be more
than happy to help you here.
All the best