| java.lang.Object org.geotools.referencing.wkt.AbstractConsole org.geotools.referencing.Console
All known Subclasses: org.geotools.referencing.TestScript,
Console | public class Console extends AbstractConsole (Code) | | A console for executing CRS operations from the command line.
Instructions are read from the
and results are sent to the
.
Instructions include:
SET name
= wkt |
Set the specified name as a shortcut for the specified Well Know
Text (wkt). This WKT can contains other shortcuts defined previously. |
transform = wkt |
Set explicitly a
to use for
coordinate transformations. This instruction is a more direct alternative to the usage of
source crs and
target crs instruction. |
source crs = wkt |
Set the source
to the specified object. This object can be specified as a Well Know Text
(wkt) or as a shortcut previously set. |
target crs = wkt |
Set the target
to the specified object. This object can be specified as a Well Know Text
(wkt) or as a shortcut previously set. Once both source and target
CRS are specified a
from source to
target CRS is automatically infered. |
source pt = coord |
Transforms the specified coordinates from source CRS to target CRS
and prints the result. |
target pt = coord |
Inverse transforms the specified coordinates from target CRS to source CRS
and prints the result. |
test tolerance = vector |
Set the maximum difference between the transformed source point and the
target point. Once this value is set, every occurence of the
target pt instruction
will trig this comparaison. If a greater difference is found, an exception is thrown or a
message is printed to the error stream. |
print set |
Prints the set of shortcuts defined in previous calls to
SET instruction. |
print crs |
Prints the source and target
and its inverse as Well Know Text (wkt). |
print pts |
Prints the source and target points, their transformed points, and the distance between
them. |
exit |
Quit the console. |
since: 2.1 version: $Id: Console.java 25050 2007-04-06 00:41:49Z jgarnett $ author: Martin Desruisseaux |
Constructor Summary | |
public | Console() Creates a new console instance using
,
,
and the system default line separator. | public | Console(LineNumberReader in) Creates a new console instance using the specified input stream. |
Method Summary | |
protected void | execute(String instruction) Execute the specified instruction. | public static void | main(String[] args) Run the console from the command line. | protected void | reportError(Exception exception) | protected void | test() Invoked automatically when the
target pt instruction were executed and a
test tolerance were previously set. |
Console | public Console()(Code) | | Creates a new console instance using
,
,
and the system default line separator.
|
Console | public Console(LineNumberReader in)(Code) | | Creates a new console instance using the specified input stream.
Parameters: in - The input stream. |
execute | protected void execute(String instruction) throws IOException, ParseException, FactoryException, TransformException(Code) | | Execute the specified instruction.
Parameters: instruction - The instruction to execute. throws: IOException - if an I/O operation failed while writting to the. throws: ParseException - if a line can't be parsed. throws: FactoryException - If a transform can't be created. throws: TransformException - if a transform failed. |
main | public static void main(String[] args)(Code) | | Run the console from the command line. Before to process all instructions
from the
, this method first
process the following optional command-line arguments:
-load <filename> |
Load a definition file before to run instructions from
the standard input stream. |
-encoding <code> |
Set the character encoding. |
-locale <language> |
Set the language for the output (e.g. "fr" for French). |
Parameters: args - the command line arguments |
reportError | protected void reportError(Exception exception)(Code) | | Parameters: exception - The exception to report. |
test | protected void test() throws TransformException, MismatchedDimensionException(Code) | | Invoked automatically when the
target pt instruction were executed and a
test tolerance were previously set. The default implementation compares
the transformed source point with the expected target point. If a mismatch greater than
the tolerance error is found, an exception is thrown. Subclasses may overrides this
method in order to performs more tests.
throws: TransformException - if the source point can't be transformed, or a mistmatch is found. throws: MismatchedDimensionException - if the transformed source point doesn't have theexpected dimension. |
|
|