org.deegree.cs
Class CRSRegistry

java.lang.Object
  extended by org.deegree.cs.CRSRegistry

public class CRSRegistry
extends java.lang.Object

The CRSRegistry class wraps the access to the CRSProvider in the org.deegree.cs package by supplying a static create method, thus encapsulating the access to the CoordinateSystems.

Version:
$Revision: 25628 $, $Date: 2010-08-02 10:16:18 +0200 (Mo, 02. Aug 2010) $
Author:
Rutger Bezema, last edited by: $Author: lbuesching $

Constructor Summary
CRSRegistry()
           
 
Method Summary
static Transformation getTransformation(java.lang.String providerName, CoordinateSystem sourceCRS, CoordinateSystem targetCRS)
          Retrieve a Transformation (chain) which transforms coordinates from the given source into the given target crs.
static Transformation getTransformation(java.lang.String providerName, CoordinateSystem sourceCRS, CoordinateSystem targetCRS, java.util.List<Transformation> transformationsToBeUsed)
          Retrieve a Transformation (chain) which transforms coordinates from the given source into the given target crs.
static Transformation getTransformation(java.lang.String providerName, java.lang.String id)
          Get a Transformation with given id, or null if it does not exist.
static CoordinateSystem lookup(CoordinateSystem realCRS)
          Wrapper for the private constructor of the org.deegree.cs class.
static CoordinateSystem lookup(CRSCodeType name)
          Get a real coordinate system from the default provider.
static CoordinateSystem lookup(java.lang.String name)
          Creates a CRS from the given name, if no CRS was found an UnkownCRSException will be thrown.
static CoordinateSystem lookup(java.lang.String name, boolean forceXY)
          Creates a CRS from the given name, if no CRS was found an UnkownCRSException will be thrown.
static CoordinateSystem lookup(java.lang.String providerName, CRSCodeType name)
          Get a 'real' coordinatesystem from the backend.
static CoordinateSystem lookup(java.lang.String providerName, java.lang.String name)
          Creates a CRS from the given name using the given provider, if no CRS was found an UnkownCRSException will be thrown.
static CoordinateSystem lookup(java.lang.String providerName, java.lang.String name, boolean forceXY)
          Creates a CRS from the given name using the given provider, if no CRS was found an UnkownCRSException will be thrown.
static CoordinateSystem lookupDummyCRS(java.lang.String name)
          Wrapper for the private constructor to create a dummy projected crs with no projection parameters set, the standard wgs84 datum and the given optional name as the identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRSRegistry

public CRSRegistry()
Method Detail

lookup

public static CoordinateSystem lookup(java.lang.String providerName,
                                      java.lang.String name)
                               throws UnknownCRSException
Creates a CRS from the given name using the given provider, if no CRS was found an UnkownCRSException will be thrown.

Parameters:
providerName - to be used for the creation of the crs.
name - of the crs, e.g. EPSG:31466
Returns:
a CoordinateSystem corresponding to the given name
Throws:
UnknownCRSException - if the crs-name is not known

lookup

public static CoordinateSystem lookup(java.lang.String providerName,
                                      java.lang.String name,
                                      boolean forceXY)
                               throws UnknownCRSException
Creates a CRS from the given name using the given provider, if no CRS was found an UnkownCRSException will be thrown.

Parameters:
providerName - to be used for the creation of the crs.
name - of the crs, e.g. EPSG:31466
forceXY - true if the axis order of the coordinate system should be x/y (EAST/NORTH; WEST/SOUTH); false id the defined axis order should be used
Throws:
UnknownCRSException
UnknownCRSException - if the crs-name is not known

lookup

public static CoordinateSystem lookup(java.lang.String providerName,
                                      CRSCodeType name)
                               throws UnknownCRSException
Get a 'real' coordinatesystem from the backend.

Parameters:
providerName -
name -
Returns:
a real coordinate system not just a wrapper.
Throws:
UnknownCRSException

getTransformation

public static Transformation getTransformation(java.lang.String providerName,
                                               java.lang.String id)
Get a Transformation with given id, or null if it does not exist.

Parameters:
providerName - to use.
id - of the Transformation.
Returns:
the identified transformation or null if no such transformation is found.

getTransformation

public static Transformation getTransformation(java.lang.String providerName,
                                               CoordinateSystem sourceCRS,
                                               CoordinateSystem targetCRS)
                                        throws java.lang.IllegalArgumentException,
                                               TransformationException
Retrieve a Transformation (chain) which transforms coordinates from the given source into the given target crs. If no such Transformation could be found or the implementation does not support inverse lookup of transformations null will be returned.

Parameters:
providerName - to use.
sourceCRS - start of the transformation (chain)
targetCRS - end point of the transformation (chain).
Returns:
the given Transformation or null if no such transformation was found.
Throws:
TransformationException
java.lang.IllegalArgumentException

getTransformation

public static Transformation getTransformation(java.lang.String providerName,
                                               CoordinateSystem sourceCRS,
                                               CoordinateSystem targetCRS,
                                               java.util.List<Transformation> transformationsToBeUsed)
                                        throws java.lang.IllegalArgumentException,
                                               TransformationException
Retrieve a Transformation (chain) which transforms coordinates from the given source into the given target crs. If no such Transformation could be found or the implementation does not support inverse lookup of transformations null will be returned.

Parameters:
providerName - to use.
sourceCRS - start of the transformation (chain)
targetCRS - end point of the transformation (chain).
transformationsToBeUsed - a list of transformations which must be used on the resulting transformation chain.
Returns:
the given Transformation or null if no such transformation was found.
Throws:
TransformationException
java.lang.IllegalArgumentException

lookup

public static CoordinateSystem lookup(java.lang.String name)
                               throws UnknownCRSException
Creates a CRS from the given name, if no CRS was found an UnkownCRSException will be thrown.

Parameters:
name - of the crs, e.g. EPSG:4326
Returns:
a CoordinateSystem corresponding to the given name, using the configured provider.
Throws:
UnknownCRSException - if the crs-name is not known

lookup

public static CoordinateSystem lookup(java.lang.String name,
                                      boolean forceXY)
                               throws UnknownCRSException
Creates a CRS from the given name, if no CRS was found an UnkownCRSException will be thrown.

Parameters:
name - of the crs, e.g. EPSG:4326
forceXY - true if the axis order of the coordinate system should be x/y (EAST/NORTH; WEST/SOUTH); false id the defined axis order should be used
Returns:
a CoordinateSystem corresponding to the given name, using the configured provider.
Throws:
UnknownCRSException - if the crs-name is not known

lookup

public static CoordinateSystem lookup(CRSCodeType name)
                               throws UnknownCRSException
Get a real coordinate system from the default provider.

Parameters:
name -
Returns:
a real coordinate system looked up in the default provider.
Throws:
UnknownCRSException

lookup

public static CoordinateSystem lookup(CoordinateSystem realCRS)
Wrapper for the private constructor of the org.deegree.cs class.

Parameters:
realCRS - to wrap
Returns:
a CRSDeliverable corresponding to the given crs.

lookupDummyCRS

public static CoordinateSystem lookupDummyCRS(java.lang.String name)
Wrapper for the private constructor to create a dummy projected crs with no projection parameters set, the standard wgs84 datum and the given optional name as the identifier. X-Y axis are in metres.

Parameters:
name - optional identifier, if missing, the word 'dummy' will be used.
Returns:
a dummy CoordinateSystem having filled out all the essential values.


Copyright © 2011. All Rights Reserved.