public class WKTParser extends Object
The types in the WKT format, and their mappings:
| Constructor and Description |
|---|
WKTParser(GeometryBuilder builder) |
WKTParser(GeometryFactory geometryFactory,
PrimitiveFactory primitiveFactory,
PositionFactory positionFactory,
AggregateFactory aggregateFactory)
Constructor takes pre-created geometry and primitive factories that will be used to parse the
Well Known Text (WKT).
|
| Modifier and Type | Method and Description |
|---|---|
Geometry |
parse(String text)
Takes a string containing well known text geometry description and wraps it in a Reader which
is then passed on to parseWKT for handling.
|
Geometry |
read(Reader reader)
Reads a Well-Known Text representation of a geometry from a
Reader. |
void |
setFactory(GeometryFactory factory)
Provide a GeometryFactory for the parser.
|
void |
setFactory(PositionFactory factory)
Provide a PositionFactory for the parser.
|
void |
setFactory(PrimitiveFactory factory)
Provide a PrimitiveFactory for the parser.
|
public WKTParser(GeometryBuilder builder)
public WKTParser(GeometryFactory geometryFactory, PrimitiveFactory primitiveFactory, PositionFactory positionFactory, AggregateFactory aggregateFactory)
CoordinateReferenceSystemgeometryFactory - A GeometryFactory created with a
CoordinateReferenceSystem and PrecisionModelprimitiveFactory - A PrimitiveFactory created with the same crs and
precision as abovepositionFactory - A PositionFactory created with the same crs and precision
as aboveaggregateFactory - A AggregateFactory created with the same crs and
precision as abovepublic void setFactory(GeometryFactory factory)
Should be called prior to use.
factory - public void setFactory(PrimitiveFactory factory)
Should be called prior to use.
factory - public void setFactory(PositionFactory factory)
Should be called prior to use.
factory - public Geometry parse(String text) throws ParseException
text - A string containing the well known text to be parsed.ParseExceptionpublic Geometry read(Reader reader) throws ParseException
Reader.reader - a Reader which will return a [Geometry Tagged Text] string (see the OpenGIS
Simple Features Specification)Geometry read from readerParseException - if a parsing problem occursCopyright © 1996–2019 Geotools. All rights reserved.