public class Drawer extends Object
Modifier and Type | Method and Description |
---|---|
static 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) |
SimpleFeature |
feature(Geometry geom)
Just a convinient method to create feature from geometry.
|
SimpleFeature |
feature(LineString line)
Simple Feature with a default geometry and no attribtues.
|
SimpleFeature |
feature(MultiLineString multilinestring)
Simple Feature with a default geometry and no attribtues.
|
SimpleFeature |
feature(MultiPoint multipoint)
Simple Feature with a default geometry and no attribtues.
|
SimpleFeature |
feature(MultiPolygon multipolygon)
Simple Feature with a default geometry and no attribtues.
|
SimpleFeature |
feature(Point point)
Simple feature with one attribute called "point".
|
SimpleFeature |
feature(Polygon polygon)
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) |
LineString |
line(int[] xy)
Generate LineStrings from two dimensional ordinates
|
MultiLineString |
lines(int[][] xy)
Generate a MultiLineString from two dimensional ordinates
|
Point |
point(int x,
int y)
Generate Point from two dimensional ordinates
|
Polygon |
polygon(int[] xy)
Convience constructor for GeometryFactory.createPolygon.
|
Polygon |
polygon(int[] xy,
int[][] holes)
Convience constructor for GeometryFactory.createPolygon.
|
LinearRing |
ring(int[] xy)
Convience constructor for GeometryFactory.createLinearRing.
|
SimpleFeatureType |
schema(String name,
String spec)
Create a SimpleFeatureType schema using a type short hand.
|
Point |
worldToPixel(Coordinate coord,
AffineTransform worldToScreenTransform) |
static AffineTransform |
worldToScreenTransform(Envelope mapExtent,
Rectangle screenSize)
TODO summary sentence for worldToScreenTransform ...
|
public static Drawer create()
public void drawDirect(BufferedImage bi, SimpleFeature feature, Style style)
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).
image
- Image to render on todisplay
- Needed to create Colors for imagefeature
- Feature to be renderedstyle
- Style to render feature withpublic void drawDirect(BufferedImage bi, SimpleFeature feature, Rule rule)
public void drawFeature(BufferedImage bi, SimpleFeature feature, AffineTransform worldToScreenTransform, boolean drawVertices, MathTransform mt)
public void drawFeature(BufferedImage bi, SimpleFeature feature, AffineTransform worldToScreenTransform)
public void drawFeature(BufferedImage bi, SimpleFeature feature, AffineTransform worldToScreenTransform, Style style)
public void drawFeature(BufferedImage bi, SimpleFeature feature, Style style, AffineTransform worldToScreenTransform)
public static Symbolizer[] getSymbolizers(SimpleFeature feature)
public static Symbolizer[] getSymbolizers(Class<? extends Geometry> type, Color baseColor)
public static Symbolizer[] getSymbolizers(Class<? extends Geometry> type, Color baseColor, boolean useTransparency)
public void drawFeature(BufferedImage bi, SimpleFeature feature, AffineTransform worldToScreenTransform, boolean drawVertices, Symbolizer[] symbs, MathTransform mt)
public void drawFeature(BufferedImage bi, SimpleFeature feature, AffineTransform worldToScreenTransform, boolean drawVertices, Symbolizer symbolizer, MathTransform mathTransform, LiteShape shape)
public Point worldToPixel(Coordinate coord, AffineTransform worldToScreenTransform)
public static AffineTransform worldToScreenTransform(Envelope mapExtent, Rectangle screenSize)
bounds
- rectangle
- public SimpleFeatureType schema(String name, String spec)
Code Example:
new Drawing().schema("namespace.typename", "id:0,*geom:LineString,name:String,*centroid:Point");
name
- namespace.namespec
- public SimpleFeature feature(Geometry geom)
geom
- the geometry to create feature frompublic SimpleFeature feature(Point point)
point
- public SimpleFeature feature(LineString line)
line
- public SimpleFeature feature(Polygon polygon)
polygon
- public SimpleFeature feature(MultiPoint multipoint)
multipoint
- public SimpleFeature feature(MultiLineString multilinestring)
multilinestring
- public SimpleFeature feature(MultiPolygon multipolygon)
multipolygon
- public Point point(int x, int y)
x
- y
- public LineString line(int[] xy)
xy
- public MultiLineString lines(int[][] xy)
xy
- public Polygon polygon(int[] xy)
The provided xy ordinates are turned into a linear rings.
xy
- Two dimensional ordiantes.public Polygon polygon(int[] xy, int[][] holes)
The provided xy and holes are turned into linear rings.
xy
- Two dimensional ordiantes.holes
- Holes in polygon or null.public LinearRing ring(int[] xy)
xy
- Two dimensional ordiantes.Copyright © 1996–2019 Geotools. All rights reserved.