|
JTS Topology Suite version 1.12 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vividsolutions.jts.awt.ShapeReader
public class ShapeReader
Converts a Java2D Shape
or the more general PathIterator
into a Geometry
.
The coordinate system for Java2D is typically screen coordinates, which has the Y axis inverted relative to the usual JTS coordinate system. This is rectified during conversion.
PathIterators to be converted are expected to be linear or flat. That is, they should contain only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE segment types. Any other segment types will cause an exception.
Constructor Summary | |
---|---|
ShapeReader(GeometryFactory geometryFactory)
|
Method Summary | |
---|---|
Geometry |
read(java.awt.geom.PathIterator pathIt)
Converts a flat path to a Geometry . |
static Geometry |
read(java.awt.geom.PathIterator pathIt,
GeometryFactory geomFact)
Converts a flat path to a Geometry . |
static Geometry |
read(java.awt.Shape shp,
double flatness,
GeometryFactory geomFact)
Converts a Shape to a Geometry, flattening it first. |
static java.util.List |
toCoordinates(java.awt.geom.PathIterator pathIt)
Extracts the points of the paths in a flat PathIterator into
a list of Coordinate arrays. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShapeReader(GeometryFactory geometryFactory)
Method Detail |
---|
public static Geometry read(java.awt.geom.PathIterator pathIt, GeometryFactory geomFact)
Geometry
.
pathIt
- the path to convertgeomFact
- the GeometryFactory to use
public static Geometry read(java.awt.Shape shp, double flatness, GeometryFactory geomFact)
shp
- the Java2D shapeflatness
- the flatness parameter to usegeomFact
- the GeometryFactory to use
public Geometry read(java.awt.geom.PathIterator pathIt)
Geometry
.
pathIt
- the path to convert
public static java.util.List toCoordinates(java.awt.geom.PathIterator pathIt)
PathIterator
into
a list of Coordinate arrays.
pathIt
- a path iterator
java.lang.IllegalArgumentException
- if a non-linear segment type is encountered
|
JTS Topology Suite version 1.12 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |