org.geotoolkit.console
Class ReferencingCommands

Object
  extended by CommandLine
      extended by ReferencingCommands
All Implemented Interfaces:
Runnable

public class ReferencingCommands
extends CommandLine

Describe the given referencing object. This tool can display in Well Known Text format a Coordinate Reference System identified by a given code (typically, but not limited to, EPSG namespace). It can also describe the parameters expected by a given Operation Method, list the available authority codes, etc. The syntax is:

java -jar geotk-referencing <options> <action> <arguments...>
The following actions are recognized by this class, in addition of the actions recognized by the super-class:

bursawolfs List the Bursa-Wolf parameters for the specified CRS ou datum objects. For some transformations, there is more than one set of Bursa-Wolf parameters available. The standard Well Known Text format prints only what look like the "main" one. This action displays all Bursa-Wolf parameters in a table for a given object.
console Launch the referencing console for interactive transformation of coordinate points.
factories Print all authority factories and their dependencies as a tree.
list type List available objects or operations of the given type. The type must be one of "factories", "codes", "operations", "conversions" or "projections".
operations codes... Print all available coordinate operations between a pair of CRS. This action prints only the operations explicitly defined in a database like EPSG. There is sometime many such operations, and sometime none (in which case this option prints nothing - it doesn't try to find an operation by itself).
parameters names... List the parameters of the given operations. For example the name can be "Affine", "EPSG:9624" or just "9624" for the affine transform method.
reformat Read WKT from the standard input stream and reformat them to the standard output stream.
test type Perform tests using factories found on the classpath. The type must be one of "creates", "duplicates" or "all".
transform codes... Print the preferred math transform between a pair of CRS. At the opposite of the "operations" action, this action picks up only one operation (usually the most accurate one), inferring it if none were explicitly specified in the database.

The following options are recognized by this class, in addition of the options recognized by the super-class:

--authority=name Use the projection and parameter names defined by the given authority when formatting WKT. Also use the authority name‐space as the default one when no namespace is explicitly given in object codes. The authority name can be any of the authorities listed by the list authorities option. If this option is not specified, then the default is all factories.
--forcexy Force the X axis (or longitude) to appear before the Y axis (or latitude).
--ident=type Set the indentation to use for WKT formatting.

Since:
3.00
Version:
3.01
Author:
Martin Desruisseaux (Geomatys)
Module:
referencing/geotk-referencing (download)    View source code for this class

Field Summary
 
Fields inherited from class CommandLine
ABORT_EXIT_CODE, arguments, BAD_CONTENT_EXIT_CODE, colors, debug, encoding, err, ILLEGAL_ARGUMENT_EXIT_CODE, ILLEGAL_STATE_EXIT_CODE, in, INTERNAL_ERROR_EXIT_CODE, IO_EXCEPTION_EXIT_CODE, locale, out, SQL_EXCEPTION_EXIT_CODE
 
Constructor Summary
protected ReferencingCommands(String[] arguments)
          Creates a new instance of ReferencingCommands.
 
Method Summary
protected  void bursawolfs()
          Invoked when the user asked the "bursawolfs" action.
protected  void console()
          Invoked when the user asked the "console" action.
protected  void factories()
          Invoked when the user asked the "factories" action.
protected  void list()
          Invoked when the user asked the "list" action.
static void main(String[] arguments)
          Creates a new instance of ReferencingCommands with the given arguments and run it.
protected  void operations()
          Invoked when the user asked the "operations" action.
protected  void parameters()
          Invoked when the user asked the "parameters" action.
protected  void reformat()
          Invoked when the user asked the "reformat" action.
protected  void test()
          Invoked when the user asked the "test" action.
protected  void transform()
          Invoked when the user asked the "transform" action.
protected  void unknownAction(String action)
          Invoked when the user did not supplied an action.
 
Methods inherited from class CommandLine
convert, exit, help, printException, run, summary, version
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReferencingCommands

protected ReferencingCommands(String[] arguments)
Creates a new instance of ReferencingCommands.

Parameters:
arguments - The command-line arguments.
Method Detail

main

public static void main(String[] arguments)
Creates a new instance of ReferencingCommands with the given arguments and run it.

Parameters:
arguments - Command line arguments.

unknownAction

protected void unknownAction(String action)
Invoked when the user did not supplied an action. The default implementation assumes that the arguments are authority codes of CRS objects to prints in Well Known Text (WKT) format. This is the most common usage of this class.

Overrides:
unknownAction in class CommandLine

list

@Action(minimalArgumentCount=1,
        maximalArgumentCount=1,
        examples={"authorities","codes","operations","conversions","projections"})
protected void list()
Invoked when the user asked the "list" action. The default implementation lists the available factories, authority codes or coordinate operations. The argument must be one of "authorities", "codes", "operations", "conversions" or "projections".


factories

@Action(maximalArgumentCount=0)
protected void factories()
Invoked when the user asked the "factories" action. The default implementation prints all authority factories dependencies as a tree.


parameters

@Action(minimalArgumentCount=1,
        examples={"Affine","EPSG:9624","9624"})
protected void parameters()
Invoked when the user asked the "parameters" action. The default implementation lists the parameters of all operations named on the command lines.


bursawolfs

@Action(minimalArgumentCount=1,
        examples="EPSG:4230")
protected void bursawolfs()
Invoked when the user asked the "bursawolfs" action. The default implementation lists the Bursa-Wolf parameters for the specified CRS ou datum objects.


operations

@Action(minimalArgumentCount=2,
        examples={"EPSG:4230","EPSG:4326"})
protected void operations()
Invoked when the user asked the "operations" action. The default implementation prints the operations between every pairs of the specified authority code.


transform

@Action(minimalArgumentCount=2,
        examples={"EPSG:4230","EPSG:4326"})
protected void transform()
Invoked when the user asked the "transform" action. The default implementation prints the math transforms between every pairs of the specified authority code.


reformat

@Action(maximalArgumentCount=0)
protected void reformat()
Invoked when the user asked the "reformat" action. The default implementation reads WKT strings from the standard input stream and reformats them to the standard output stream. The input is read until it reach the end-of-file ([Ctrl-Z] if reading from the keyboard).


test

@Action(minimalArgumentCount=1,
        maximalArgumentCount=1,
        examples={"creates","duplicates","all"})
protected void test()
Invoked when the user asked the "test" action. The default implementation performs tests using factories found on the classpath. The test to perform is specified by the argument following "test" on the command line. Supported values are:

creates Try to instantiate all CRS and report any failure to do so.
duplicates List all codes from PropertyEpsgFactory that are duplicating a code from the ThreadedEpsgFactory.
all Perform all of the above tests.

The tests are implemented by calls to the following methods:

TODO:
Localize messages.

console

@Action(maximalArgumentCount=0)
protected void console()
Invoked when the user asked the "console" action. The default implementation launchs the referencing console for interactive transformation of coordinate points.



Copyright © 2009-2011 Geotoolkit.org. All Rights Reserved.