Details
Description
A patch is provided that covers some limitations found in the current renderers (Shapefile and Streaming) as of 2.6.0. It follows discussions from thread http://www.mail-archive.com/geotools-devel@lists.sourceforge.net/msg18546.html
The limitations and corrections are the following:
1. Currently, some elements are always rendered as raster images: polygon fills are drawn as an AWT raster-based TexturePaint, and SVG ExternalGraphics are converted to images in SLDStyleFactory. In this way, rendering GeoTools maps on Graphics other than the screen (e.g., Batik's SVGGraphics and Graphics for printing) gives outputs of limited quality. In order to solve this, a rendering hint can now be provided to enable "vector rendering", so that polygon fills are painted directly to the target Graphics and SVGs are not converted to images. This is evidently slower, so if the hint is not provided, everything still works as usual.
2. Marks are currently always assumed to be square (usually 1x1). This patch also adds the capability of rendering marks with shapes of arbitrary sizes. As such, shapes with rectangular dimensions of any size are now supported. A separate patch will be provided that makes use of this capability to add new shapes (such as hatches with arbitrary angles)
I am also attaching a PDF file that gives an idea of what we can do now with these features (and the quality of the output). It contains hatches with different angle values (green one is 45 degrees, black ones are 110) and SVG files rendered as vectors.
Issue Links
- is depended upon by
-
GEOS-3792
Use full vector rendering for SVG graphics and marks in PDF and SVG
-
Activity
| Status | Open [ 1 ] | Closed [ 6 ] |
| Resolution | Fixed [ 1 ] | |
| Fix Version/s | 2.6.2 [ 16075 ] |
1. A new GlyphStyle2D class was introduced, for representing Style2D objects that can be rendered by a GlyphRenderer. This is used to allow SVG ExternalGraphics to be rendered directly to the target Graphics
2. In order to render marks of arbitrary sizes, its shape's bounds are now queried. However, in some cases the shape's exact bounds as defined by its coordinates may be inadequate (e.g., for a mark with a single "dot" in the middle, we would like to paint a polygon fill considering an area bigger that a single coordinate!). Because of that, an "ExplicitBoundsShape" decorator class is provided so that shape bounds can be explicitly defined (and hence be bigger than the area occupied by the shape's coordinates).
3. In order to correctly paint a MarkStyle2D (and now a GlyphStyle2D), we need a PathIterator of the shape being rendered. However, LiteShape2.getPathIterator() does not work for this, and current practice is to instantiate a GeomCollectionIterator (see code in StyledShapePainter.paint()). Could this code actually be used in LiteShape2.getPathIterator()?