Package org.geotools.map.legend
Class Drawer
Object
Drawer
This class is used to isolate GeoTools from the specific graphic library being used for rendering.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Drawer
create()
Retrieve the default Drawing implementation.void
drawDirect
(BufferedImage bi, SimpleFeature feature, Rule rule) void
drawDirect
(BufferedImage bi, SimpleFeature feature, Style style) Used to draw a freature directly onto the provided image.void
drawFeature
(BufferedImage bi, SimpleFeature feature, AffineTransform worldToScreenTransform) void
drawFeature
(BufferedImage bi, SimpleFeature feature, AffineTransform worldToScreenTransform, boolean drawVertices, MathTransform mt) void
drawFeature
(BufferedImage bi, SimpleFeature feature, AffineTransform worldToScreenTransform, boolean drawVertices, Symbolizer[] symbs, MathTransform mt) void
drawFeature
(BufferedImage bi, SimpleFeature feature, AffineTransform worldToScreenTransform, boolean drawVertices, Symbolizer symbolizer, MathTransform mathTransform, LiteShape shape) void
drawFeature
(BufferedImage bi, SimpleFeature feature, AffineTransform worldToScreenTransform, Style style) void
drawFeature
(BufferedImage bi, SimpleFeature feature, Style style, AffineTransform worldToScreenTransform) Just a convinient method to create feature from geometry.feature
(LineString line) Simple Feature with a default geometry and no attribtues.feature
(MultiLineString multilinestring) Simple Feature with a default geometry and no attribtues.feature
(MultiPoint multipoint) Simple Feature with a default geometry and no attribtues.feature
(MultiPolygon multipolygon) Simple Feature with a default geometry and no attribtues.Simple feature with one attribute called "point".Simple Feature with a default geometry and no attribtues.static Symbolizer[]
getSymbolizers
(Class<? extends Geometry> type, Color baseColor) static Symbolizer[]
getSymbolizers
(Class<? extends Geometry> type, Color baseColor, boolean useTransparency) static Symbolizer[]
getSymbolizers
(SimpleFeature feature) line
(int[] xy) Generate LineStrings from two dimensional ordinateslines
(int[][] xy) Generate a MultiLineString from two dimensional ordinatespoint
(int x, int y) Generate Point from two dimensional ordinatespolygon
(int[] xy) Convience constructor for GeometryFactory.createPolygon.polygon
(int[] xy, int[][] holes) Convience constructor for GeometryFactory.createPolygon.ring
(int[] xy) Convience constructor for GeometryFactory.createLinearRing.Create a SimpleFeatureType schema using a type short hand.worldToPixel
(Coordinate coord, AffineTransform worldToScreenTransform) static AffineTransform
worldToScreenTransform
(Envelope mapExtent, Rectangle screenSize) TODO summary sentence for worldToScreenTransform ...
-
Method Details
-
create
Retrieve the default Drawing implementation.- Returns:
- Drawing ready for use
-
drawDirect
Used to draw a freature directly onto the provided image.Feature coordintes are in the same coordinates as the image.
You may call this method multiple times to draw several features onto the same Image (say for glyph creation).
- Parameters:
bi
- Image to render on tofeature
- Feature to be renderedstyle
- Style to render feature with
-
drawDirect
-
drawFeature
public void drawFeature(BufferedImage bi, SimpleFeature feature, AffineTransform worldToScreenTransform, boolean drawVertices, MathTransform mt) -
drawFeature
public void drawFeature(BufferedImage bi, SimpleFeature feature, AffineTransform worldToScreenTransform) -
drawFeature
public void drawFeature(BufferedImage bi, SimpleFeature feature, AffineTransform worldToScreenTransform, Style style) -
drawFeature
public void drawFeature(BufferedImage bi, SimpleFeature feature, Style style, AffineTransform worldToScreenTransform) -
getSymbolizers
-
getSymbolizers
-
getSymbolizers
public static Symbolizer[] getSymbolizers(Class<? extends Geometry> type, Color baseColor, boolean useTransparency) -
drawFeature
public void drawFeature(BufferedImage bi, SimpleFeature feature, AffineTransform worldToScreenTransform, boolean drawVertices, Symbolizer[] symbs, MathTransform mt) -
drawFeature
public void drawFeature(BufferedImage bi, SimpleFeature feature, AffineTransform worldToScreenTransform, boolean drawVertices, Symbolizer symbolizer, MathTransform mathTransform, LiteShape shape) -
worldToPixel
-
worldToScreenTransform
TODO summary sentence for worldToScreenTransform ... -
schema
Create a SimpleFeatureType schema using a type short hand.Code Example:
new Drawing().schema("namespace.typename", "id:0,*geom:LineString,name:String,*centroid:Point");
- SimpleFeatureType with identifier "namespace.typename"
- Default Geometry "geom" of type LineStirng indicated with a "*"
- Three attributes: id of type Integer, name of type String and centroid of type Point
- Parameters:
name
- namespace.name- Returns:
- Generated SimpleFeatureType
-
feature
Just a convinient method to create feature from geometry.- Parameters:
geom
- the geometry to create feature from- Returns:
- feature instance
-
feature
Simple feature with one attribute called "point".- Returns:
- SimpleFeature with a default geometry and no attribtues
-
feature
Simple Feature with a default geometry and no attribtues.- Returns:
- Feature with a default geometry and no attribtues
-
feature
Simple Feature with a default geometry and no attribtues.- Returns:
- Feature with a default geometry and no attribtues
-
feature
Simple Feature with a default geometry and no attribtues.- Returns:
- Feature with a default geometry and no attribtues
-
feature
Simple Feature with a default geometry and no attribtues.- Returns:
- Feature with a default geometry and no attribtues
-
feature
Simple Feature with a default geometry and no attribtues.- Returns:
- Feature with a default geometry and no attribtues
-
point
Generate Point from two dimensional ordinates- Returns:
- Point
-
line
Generate LineStrings from two dimensional ordinates- Returns:
- LineStirng
-
lines
Generate a MultiLineString from two dimensional ordinates- Returns:
- MultiLineStirng
-
polygon
Convience constructor for GeometryFactory.createPolygon.The provided xy ordinates are turned into a linear rings.
- Parameters:
xy
- Two dimensional ordiantes.- Returns:
- Polygon
-
polygon
Convience constructor for GeometryFactory.createPolygon.The provided xy and holes are turned into linear rings.
- Parameters:
xy
- Two dimensional ordiantes.holes
- Holes in polygon or null.- Returns:
- Polygon
-
ring
Convience constructor for GeometryFactory.createLinearRing.- Parameters:
xy
- Two dimensional ordiantes.- Returns:
- LinearRing for use with polygon
-