|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.referencing.wkt.Formatter
Format Formattable
objects as
Well
Known Text (WKT).
A formatter is constructed with a specified set of symbols.
The locale associated with the symbols is used for querying
authority titles.
Constructor Summary | |
Formatter()
Creates a new instance of the formatter with the default symbols. |
|
Formatter(Symbols symbols)
Creates a new instance of the formatter. |
|
Formatter(Symbols symbols,
int indentation)
Creates a new instance of the formatter with the specified indentation width. |
Method Summary | |
void |
append(org.opengis.util.CodeList code)
Append a code list to the WKT. |
void |
append(double number)
Append a floating point number. |
void |
append(Formattable formattable)
Append the specified object. |
void |
append(org.opengis.parameter.GeneralParameterValue parameter)
Append a parameter in WKT form. |
void |
append(org.opengis.referencing.IdentifiedObject info)
Append the specified OpenGIS's object. |
void |
append(int number)
Append an integer number. |
void |
append(org.opengis.referencing.operation.MathTransform transform)
Append the specified math transform. |
void |
append(java.lang.String text)
Append a character string. |
void |
append(javax.units.Unit unit)
Appends a unit in WKT form. |
void |
clear()
Clear this formatter. |
javax.units.Unit |
getAngularUnit()
The angular unit for formatting measures, or for the "natural" unit of each WKT element. |
javax.units.Unit |
getLinearUnit()
The linear unit for formatting measures, or for the "natural" unit of each WKT element. |
java.lang.String |
getName(org.opengis.referencing.IdentifiedObject info)
Returns the preferred name for the specified object. |
boolean |
isInvalidWKT()
Returns if the WKT in this formatter is not strictly compliant to the WKT specification. |
static void |
main(java.lang.String[] args)
Set the preferred indentation from the command line. |
void |
setAngularUnit(javax.units.Unit unit)
Set the angular unit for formatting measures. |
void |
setInvalidWKT()
Set a flag marking the current WKT as not strictly compliant to the WKT specification. |
void |
setLinearUnit(javax.units.Unit unit)
Set the unit for formatting linear measures. |
java.lang.String |
toString()
Returns the WKT in its current state. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Formatter()
public Formatter(Symbols symbols)
symbols
- The symbols.public Formatter(Symbols symbols, int indentation)
symbols
- The symbols.indentation
- The amount of spaces to use in indentation. Typical values are 2 or 4.Method Detail |
public void append(Formattable formattable)
"GEOCS"
), the name and the authority code, and will invokes
formattable.formatWKT(this)
for completing
the inner part of the WKT.
formattable
- The formattable object to append to the WKT.public void append(org.opengis.referencing.IdentifiedObject info)
info
- The info object to append to the WKT.public void append(org.opengis.referencing.operation.MathTransform transform)
transform
- The transform object to append to the WKT.public void append(org.opengis.util.CodeList code)
public void append(org.opengis.parameter.GeneralParameterValue parameter)
public void append(int number)
public void append(double number)
public void append(javax.units.Unit unit)
UNIT["km", 1000]
" to the WKT.
public void append(java.lang.String text)
public java.lang.String getName(org.opengis.referencing.IdentifiedObject info)
info
- The object to looks for a preferred name.
public javax.units.Unit getLinearUnit()
public void setLinearUnit(javax.units.Unit unit)
unit
- The new unit, or .public javax.units.Unit getAngularUnit()
public void setAngularUnit(javax.units.Unit unit)
unit
- The new unit, or .public boolean isInvalidWKT()
setInvalidWKT()
has
been invoked at least once. The action to take regarding invalid WKT is caller-dependant.
For example Formattable.toString()
will accepts loose WKT formatting and ignore this
flag, while Formattable.toWKT()
requires strict WKT formatting and will thrown an
exception if this flag is set.
public void setInvalidWKT()
Formattable.formatWKT(org.geotools.referencing.wkt.Formatter)
methods when the
object to format is more complex than what the WKT specification allows. For example this
method is invoked when an engineering CRS uses different unit for each axis, An application can tests
isInvalidWKT()
later for checking WKT validity.
public java.lang.String toString()
public void clear()
public static void main(java.lang.String[] args)
Formattable.toWKT()
when no indentation were explicitly requested. This
method can be invoked from the command line using the following syntax:
<preferred indentation>
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |