kiwi-postgis
Version 0.1.0.0
|
Writes the Well-Known Text representation of a Geometry. More...
Public Member Functions | |
SVGWriter () | |
Creates a new SVGWriter with default settings. More... | |
String | write (Geometry geometry) |
Converts a Geometry to its Well-known Text representation. More... | |
void | write (Geometry geometry, Writer writer) throws IOException |
Converts a Geometry to its Well-known Text representation. More... | |
String | writeFormatted (Geometry geometry) |
Same as write , but with newlines and spaces to make the well-known text more readable. More... | |
void | writeFormatted (Geometry geometry, Writer writer) throws IOException |
Same as write , but with newlines and spaces to make the well-known text more readable. More... | |
Static Public Member Functions | |
static String | stringOfChar (char ch, int count) |
Returns a String of repeated characters. More... | |
Private Member Functions | |
void | writeFormatted (Geometry geometry, boolean useFormatting, Writer writer) throws IOException |
Converts a Geometry to its Well-known Text representation. More... | |
void | appendGeometryTaggedText (Geometry geometry, int level, Writer writer) throws IOException |
Converts a Geometry to <Geometry Tagged Text> format, then appends it to the writer. More... | |
void | appendPointTaggedText (Coordinate coordinate, int level, Writer writer, PrecisionModel precisionModel) throws IOException |
Converts a Coordinate to <Point Tagged Text> format, then appends it to the writer. More... | |
void | appendLineStringTaggedText (LineString lineString, int level, Writer writer) throws IOException |
Converts a LineString to <LineString Tagged Text> format, then appends it to the writer. More... | |
void | appendLinearRingTaggedText (LinearRing linearRing, int level, Writer writer) throws IOException |
Converts a LinearRing to <LinearRing Tagged Text> format, then appends it to the writer. More... | |
void | appendPolygon (Polygon polygon, int level, Writer writer) throws IOException |
Converts a Polygon to <Polygon Tagged Text> format, then appends it to the writer. More... | |
void | appendMultiPointTaggedText (MultiPoint multipoint, int level, Writer writer) throws IOException |
Converts a MultiPoint to <MultiPoint Tagged Text> format, then appends it to the writer. More... | |
void | appendMultiLineStringTaggedText (MultiLineString multiLineString, int level, Writer writer) throws IOException |
Converts a MultiLineString to <MultiLineString Tagged Text> format, then appends it to the writer. More... | |
void | appendMultiPolygonTaggedText (MultiPolygon multiPolygon, int level, Writer writer) throws IOException |
Converts a MultiPolygon to <MultiPolygon Tagged Text> format, then appends it to the writer. More... | |
void | appendGeometryCollectionTaggedText (GeometryCollection geometryCollection, int level, Writer writer) throws IOException |
Converts a GeometryCollection to <GeometryCollection Tagged Text> format, then appends it to the writer. More... | |
void | appendPoint (Coordinate coordinate, int level, Writer writer, PrecisionModel precisionModel) throws IOException |
Converts a Coordinate to <Point Text> format, then appends it to the writer. More... | |
void | appendCoordinate (CoordinateSequence seq, int i, Writer writer) throws IOException |
Appends the i'th coordinate from the sequence to the writer. More... | |
void | appendCoordinate (Coordinate coordinate, Writer writer) throws IOException |
Converts a Coordinate to <Point> format, then appends it to the writer. More... | |
String | writeNumber (double d) |
Converts a double to a String , not in scientific notation. More... | |
void | appendSequencePath (CoordinateSequence seq, int level, boolean doIndent, Writer writer) throws IOException |
Converts a LineString to <LineString Text> format, then appends it to the writer. More... | |
void | appendSequencePoints (CoordinateSequence seq, int level, boolean doIndent, Writer writer) throws IOException |
void | appendLineString (LineString lineString, int level, boolean doIndent, Writer writer) throws IOException |
Converts a LineString to <LineString Text> format, then appends it to the writer. More... | |
void | appendPolygonPolygon (Polygon polygon, int level, boolean indentFirst, Writer writer) throws IOException |
Converts a Polygon to <Polygon Text> format, then appends it to the writer. More... | |
void | appendPolygonPath (Polygon polygon, int level, boolean indentFirst, Writer writer) throws IOException |
void | appendPathStart (boolean useFillRule, Writer writer) throws IOException |
void | appendPathEnd (Writer writer) throws IOException |
void | appendMultiPointText (MultiPoint multiPoint, int level, Writer writer) throws IOException |
Converts a MultiPoint to <MultiPoint Text> format, then appends it to the writer. More... | |
void | appendMultiLineStringText (MultiLineString multiLineString, int level, boolean indentFirst, Writer writer) throws IOException |
Converts a MultiLineString to <MultiLineString Text> format, then appends it to the writer. More... | |
void | appendMultiPolygonText (MultiPolygon multiPolygon, int level, Writer writer) throws IOException |
Converts a MultiPolygon to <MultiPolygon Text> format, then appends it to the writer. More... | |
void | appendGeometryCollectionText (GeometryCollection geometryCollection, int level, Writer writer) throws IOException |
Converts a GeometryCollection to <GeometryCollectionText> format, then appends it to the writer. More... | |
void | indentCoords (int coordIndex, int level, Writer writer) throws IOException |
void | indent (int level, Writer writer) throws IOException |
Static Private Member Functions | |
static DecimalFormat | createFormatter (PrecisionModel precisionModel) |
Creates the DecimalFormat used to write double s with a sufficient number of decimal places. More... | |
Private Attributes | |
int | outputDimension = 2 |
DecimalFormat | formatter |
boolean | isFormatted = false |
boolean | useFormatting = false |
int | level = 0 |
int | coordsPerLine = -1 |
String | indentTabStr = " " |
Static Private Attributes | |
static final int | INDENT = 2 |
Writes the Well-Known Text representation of a Geometry.
The Well-Known Text format is defined in the OGC Simple Features Specification for SQL. See WKTReader for a formal specification of the format syntax.
The WKTWriter
outputs coordinates rounded to the precision model. Only the maximum number of decimal places necessary to represent the ordinates to the required precision will be output.
The SFS WKT spec does not define a special tag for LinearRings. Under the spec, rings are output as LINESTRING
s. In order to allow precisely specifying constructed geometries, JTS also supports a non-standard LINEARRING
tag which is used to output LinearRings.
|
private |
Appends the i'th coordinate from the sequence to the writer.
seq | the CoordinateSequence to process |
i | the index of the coordinate to write |
writer | the output writer to append to |
References SVGWriter.writeNumber().
Referenced by SVGWriter.appendSequencePath(), and SVGWriter.appendSequencePoints().
|
private |
Converts a Coordinate
to <Point>
format, then appends it to the writer.
coordinate | the Coordinate to process |
writer | the output writer to append to |
References SVGWriter.writeNumber().
|
private |
Converts a GeometryCollection
to <GeometryCollection Tagged Text> format, then appends it to the writer.
geometryCollection | the GeometryCollection to process |
writer | the output writer to append to |
References SVGWriter.appendGeometryCollectionText().
Referenced by SVGWriter.appendGeometryTaggedText().
|
private |
Converts a GeometryCollection
to <GeometryCollectionText> format, then appends it to the writer.
geometryCollection | the GeometryCollection to process |
writer | the output writer to append to |
References SVGWriter.appendGeometryTaggedText(), and SVGWriter.level.
Referenced by SVGWriter.appendGeometryCollectionTaggedText().
|
private |
Converts a Geometry
to <Geometry Tagged Text> format, then appends it to the writer.
geometry | the Geometry to process |
writer | the output writer to append to |
References SVGWriter.appendGeometryCollectionTaggedText(), SVGWriter.appendLinearRingTaggedText(), SVGWriter.appendLineStringTaggedText(), SVGWriter.appendMultiLineStringTaggedText(), SVGWriter.appendMultiPointTaggedText(), SVGWriter.appendMultiPolygonTaggedText(), SVGWriter.appendPointTaggedText(), SVGWriter.appendPolygon(), SVGWriter.indent(), and SVGWriter.level.
Referenced by SVGWriter.appendGeometryCollectionText(), and SVGWriter.writeFormatted().
|
private |
Converts a LinearRing
to <LinearRing Tagged Text> format, then appends it to the writer.
linearRing | the LinearRing to process |
writer | the output writer to append to |
References SVGWriter.appendLineString().
Referenced by SVGWriter.appendGeometryTaggedText().
|
private |
Converts a LineString
to <LineString Text> format, then appends it to the writer.
lineString | the LineString to process |
writer | the output writer to append to |
References SVGWriter.appendSequencePoints(), SVGWriter.indent(), and SVGWriter.level.
Referenced by SVGWriter.appendLinearRingTaggedText(), SVGWriter.appendLineStringTaggedText(), and SVGWriter.appendMultiLineStringText().
|
private |
Converts a LineString
to <LineString Tagged Text> format, then appends it to the writer.
lineString | the LineString to process |
writer | the output writer to append to |
References SVGWriter.appendLineString().
Referenced by SVGWriter.appendGeometryTaggedText().
|
private |
Converts a MultiLineString
to <MultiLineString Tagged Text> format, then appends it to the writer.
multiLineString | the MultiLineString to process |
writer | the output writer to append to |
References SVGWriter.appendMultiLineStringText().
Referenced by SVGWriter.appendGeometryTaggedText().
|
private |
Converts a MultiLineString
to <MultiLineString Text> format, then appends it to the writer.
multiLineString | the MultiLineString to process |
writer | the output writer to append to |
References SVGWriter.appendLineString(), and SVGWriter.level.
Referenced by SVGWriter.appendMultiLineStringTaggedText().
|
private |
Converts a MultiPoint
to <MultiPoint Tagged Text> format, then appends it to the writer.
multipoint | the MultiPoint to process |
writer | the output writer to append to |
References SVGWriter.appendMultiPointText().
Referenced by SVGWriter.appendGeometryTaggedText().
|
private |
Converts a MultiPoint
to <MultiPoint Text> format, then appends it to the writer.
multiPoint | the MultiPoint to process |
writer | the output writer to append to |
References SVGWriter.appendPoint(), and SVGWriter.level.
Referenced by SVGWriter.appendMultiPointTaggedText().
|
private |
Converts a MultiPolygon
to <MultiPolygon Tagged Text> format, then appends it to the writer.
multiPolygon | the MultiPolygon to process |
writer | the output writer to append to |
References SVGWriter.appendMultiPolygonText().
Referenced by SVGWriter.appendGeometryTaggedText().
|
private |
Converts a MultiPolygon
to <MultiPolygon Text> format, then appends it to the writer.
multiPolygon | the MultiPolygon to process |
writer | the output writer to append to |
References SVGWriter.appendPolygon(), and SVGWriter.level.
Referenced by SVGWriter.appendMultiPolygonTaggedText().
|
private |
|
private |
|
private |
Converts a Coordinate
to <Point Text> format, then appends it to the writer.
coordinate | the Coordinate to process |
writer | the output writer to append to |
precisionModel | the PrecisionModel to use to convert from a precise coordinate to an external coordinate |
Referenced by SVGWriter.appendMultiPointText(), and SVGWriter.appendPointTaggedText().
|
private |
Converts a Coordinate
to <Point Tagged Text> format, then appends it to the writer.
coordinate | the Coordinate to process |
writer | the output writer to append to |
precisionModel | the PrecisionModel to use to convert from a precise coordinate to an external coordinate |
References SVGWriter.appendPoint().
Referenced by SVGWriter.appendGeometryTaggedText().
|
private |
Converts a Polygon
to <Polygon Tagged Text> format, then appends it to the writer.
polygon | the Polygon to process |
writer | the output writer to append to |
References SVGWriter.appendPolygonPath(), and SVGWriter.appendPolygonPolygon().
Referenced by SVGWriter.appendGeometryTaggedText(), and SVGWriter.appendMultiPolygonText().
|
private |
References SVGWriter.appendSequencePath(), SVGWriter.indent(), and SVGWriter.level.
Referenced by SVGWriter.appendPolygon().
|
private |
Converts a Polygon
to <Polygon Text> format, then appends it to the writer.
polygon | the Polygon to process |
writer | the output writer to append to |
References SVGWriter.appendSequencePoints(), SVGWriter.indent(), and SVGWriter.level.
Referenced by SVGWriter.appendPolygon().
|
private |
Converts a LineString
to <LineString Text> format, then appends it to the writer.
lineString | the LineString to process |
writer | the output writer to append to |
References SVGWriter.appendCoordinate(), and SVGWriter.indent().
Referenced by SVGWriter.appendPolygonPath().
|
private |
References SVGWriter.appendCoordinate(), and SVGWriter.indent().
Referenced by SVGWriter.appendLineString(), and SVGWriter.appendPolygonPolygon().
|
staticprivate |
Creates the DecimalFormat
used to write double
s with a sufficient number of decimal places.
precisionModel | the PrecisionModel used to determine the number of decimal places to write. |
DecimalFormat
that write double
s without scientific notation. References SVGWriter.stringOfChar().
Referenced by SVGWriter.writeFormatted().
|
private |
References SVGWriter.level.
Referenced by SVGWriter.appendGeometryTaggedText(), SVGWriter.appendLineString(), SVGWriter.appendPolygonPath(), SVGWriter.appendPolygonPolygon(), SVGWriter.appendSequencePath(), SVGWriter.appendSequencePoints(), and SVGWriter.indentCoords().
|
private |
References SVGWriter.indent().
|
static |
Returns a String
of repeated characters.
ch | the character to repeat |
count | the number of times to repeat the character |
String
of characters Referenced by SVGWriter.createFormatter().
String write | ( | Geometry | geometry | ) |
Converts a Geometry
to its Well-known Text representation.
geometry | a Geometry to process |
References SVGWriter.writeFormatted().
Referenced by AsSVG.operation().
void write | ( | Geometry | geometry, |
Writer | writer | ||
) | throws IOException |
Converts a Geometry
to its Well-known Text representation.
geometry | a Geometry to process |
References SVGWriter.writeFormatted().
String writeFormatted | ( | Geometry | geometry | ) |
Same as write
, but with newlines and spaces to make the well-known text more readable.
geometry | a Geometry to process |
Referenced by SVGWriter.write(), and SVGWriter.writeFormatted().
void writeFormatted | ( | Geometry | geometry, |
Writer | writer | ||
) | throws IOException |
Same as write
, but with newlines and spaces to make the well-known text more readable.
geometry | a Geometry to process |
References SVGWriter.writeFormatted().
|
private |
Converts a Geometry
to its Well-known Text representation.
geometry | a Geometry to process |
References SVGWriter.appendGeometryTaggedText(), SVGWriter.createFormatter(), and SVGWriter.useFormatting.
|
private |
Converts a double
to a String
, not in scientific notation.
d | the double to convert |
double
as a String
, not in scientific notation Referenced by SVGWriter.appendCoordinate().
|
private |
|
private |
|
staticprivate |
|
private |
|
private |
|
private |
Referenced by SVGWriter.appendGeometryCollectionText(), SVGWriter.appendGeometryTaggedText(), SVGWriter.appendLineString(), SVGWriter.appendMultiLineStringText(), SVGWriter.appendMultiPointText(), SVGWriter.appendMultiPolygonText(), SVGWriter.appendPolygonPath(), SVGWriter.appendPolygonPolygon(), and SVGWriter.indent().
|
private |
|
private |
Referenced by SVGWriter.writeFormatted().