public class WKTReader extends Object
Geometry
.
WKTReader
supports
extracting Geometry
objects from either Reader
s or
String
s. This allows it to function as a parser to read Geometry
objects from text blocks embedded in other data formats (e.g. XML).
A WKTReader
is parameterized by a GeometryFactory
,
to allow it to create Geometry
objects of the appropriate
implementation. In particular, the GeometryFactory
determines the PrecisionModel
and SRID
that is
used.
The WKTReader
converts all input numbers to the precise
internal representation.
WKTGeometry: one of WKTPoint WKTLineString WKTLinearRing WKTPolygon WKTMultiPoint WKTMultiLineString WKTMultiPolygon WKTGeometryCollection WKTPoint: POINT ( Coordinate ) WKTLineString: LINESTRING CoordinateSequence WKTLinearRing: LINEARRING CoordinateSequence WKTPolygon: POLYGON CoordinateSequenceList WKTMultiPoint: MULTIPOINT CoordinateSingletonList WKTMultiLineString: MULTILINESTRING CoordinateSequenceList WKTMultiPolygon: MULTIPOLYGON ( CoordinateSequenceList { , CoordinateSequenceList } ) WKTGeometryCollection: GEOMETRYCOLLECTION ( WKTGeometry { , WKTGeometry } ) CoordinateSingletonList: ( CoordinateSingleton { , CoordinateSingleton } ) | EMPTY CoordinateSingleton: ( Coordinate ) | EMPTY CoordinateSequenceList: ( CoordinateSequence { , CoordinateSequence } ) | EMPTY CoordinateSequence: ( Coordinate { , Coordinate } ) | EMPTY Coordinate: Number Number Numberopt Number: A Java-style floating-point number (including NaN, with arbitrary case)
WKTWriter
Constructor and Description |
---|
WKTReader()
Creates a reader that creates objects using the default
GeometryFactory . |
WKTReader(GeometryFactory geometryFactory)
Creates a reader that creates objects using the given
GeometryFactory . |
Modifier and Type | Method and Description |
---|---|
Geometry |
read(Reader reader)
|
Geometry |
read(String wellKnownText)
|
public WKTReader()
GeometryFactory
.public WKTReader(GeometryFactory geometryFactory)
GeometryFactory
.geometryFactory
- the factory used to create Geometry
s.public Geometry read(String wellKnownText) throws ParseException
wellKnownText
- one or more Geometry
specified by wellKnownText
ParseException
- if a parsing problem occurspublic Geometry read(Reader reader) throws ParseException
reader
- a Reader which will return a Geometry
read from reader
ParseException
- if a parsing problem occursCopyright © 2016. All rights reserved.