deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.model.crs
Class CRSFactory

java.lang.Object
  extended by org.deegree.model.crs.CRSFactory

public class CRSFactory
extends Object

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

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Rutger Bezema, last edited by: $Author: mschneider $

Constructor Summary
CRSFactory()
           
 
Method Summary
static CoordinateSystem create(CoordinateSystem realCRS)
          Wrapper for the private constructor of the org.deegree.model.crs.CoordinateSystem class.
static CoordinateSystem create(String name)
          Creates a CRS from the given name, if no CRS was found an UnkownCRSException will be thrown.
static CoordinateSystem create(String providerName, 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 createDummyCRS(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.
static Transformation getTransformation(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(String providerName, String id)
          Get a Transformation with given id, or null if it does not exist.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRSFactory

public CRSFactory()
Method Detail

create

public static CoordinateSystem create(String providerName,
                                      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

getTransformation

public static Transformation getTransformation(String providerName,
                                               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(String providerName,
                                               CoordinateSystem sourceCRS,
                                               CoordinateSystem targetCRS)
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.

create

public static CoordinateSystem create(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

create

public static CoordinateSystem create(CoordinateSystem realCRS)
Wrapper for the private constructor of the org.deegree.model.crs.CoordinateSystem class.

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

createDummyCRS

public static CoordinateSystem createDummyCRS(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.

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org