Class SVGWriter
- java.lang.Object
-
- com.vividsolutions.jtstest.util.io.SVGWriter
-
public class SVGWriter extends java.lang.ObjectWrites the Well-Known Text representation of aGeometry. The Well-Known Text format is defined in the OGC Simple Features Specification for SQL. SeeWKTReaderfor a formal specification of the format syntax.The
WKTWriteroutputs 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 asLINESTRINGs. In order to allow precisely specifying constructed geometries, JTS also supports a non-standardLINEARRINGtag which is used to output LinearRings.- Version:
- 1.7
- See Also:
WKTReader
-
-
Constructor Summary
Constructors Constructor Description SVGWriter()Creates a new SVGWriter with default settings
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringstringOfChar(char ch, int count)Returns aStringof repeated characters.java.lang.Stringwrite(Geometry geometry)Converts aGeometryto its Well-known Text representation.voidwrite(Geometry geometry, java.io.Writer writer)Converts aGeometryto its Well-known Text representation.java.lang.StringwriteFormatted(Geometry geometry)Same aswrite, but with newlines and spaces to make the well-known text more readable.voidwriteFormatted(Geometry geometry, java.io.Writer writer)Same aswrite, but with newlines and spaces to make the well-known text more readable.
-
-
-
Method Detail
-
stringOfChar
public static java.lang.String stringOfChar(char ch, int count)Returns aStringof repeated characters.- Parameters:
ch- the character to repeatcount- the number of times to repeat the character- Returns:
- a
Stringof characters
-
write
public java.lang.String write(Geometry geometry)
Converts aGeometryto its Well-known Text representation.- Parameters:
geometry- aGeometryto process- Returns:
- a
string (see the OpenGIS Simple Features Specification)
-
write
public void write(Geometry geometry, java.io.Writer writer) throws java.io.IOException
Converts aGeometryto its Well-known Text representation.- Parameters:
geometry- aGeometryto process- Throws:
java.io.IOException
-
writeFormatted
public java.lang.String writeFormatted(Geometry geometry)
Same aswrite, but with newlines and spaces to make the well-known text more readable.- Parameters:
geometry- aGeometryto process- Returns:
- a
string (see the OpenGIS Simple Features Specification), with newlines and spaces
-
writeFormatted
public void writeFormatted(Geometry geometry, java.io.Writer writer) throws java.io.IOException
Same aswrite, but with newlines and spaces to make the well-known text more readable.- Parameters:
geometry- aGeometryto process- Throws:
java.io.IOException
-
-