org.deegree.cs.persistence.proj4
Class PROJ4CRSStore

java.lang.Object
  extended by org.deegree.cs.persistence.AbstractCRSStore
      extended by org.deegree.cs.persistence.proj4.PROJ4CRSStore
All Implemented Interfaces:
CRSStore

public class PROJ4CRSStore
extends AbstractCRSStore

The PROJ4CRSProvider class is capable of parsing the nad/epsg file and use it as a backend for crs's. This class also adds following identifiers to the coordinatesystems.

Version:
$Revision: 30120 $, $Date: 2011-03-22 10:04:15 +0100 (Tue, 22 Mar 2011) $
Author:
Rutger Bezema, last edited by: $Author: aschmitz $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.deegree.cs.persistence.AbstractCRSStore
AbstractCRSStore.RESOURCETYPE
 
Constructor Summary
PROJ4CRSStore(TransformationFactory.DSTransform prefTransformType)
          Export constructor, sets the version to current date..
 
Method Summary
 List<CRSCodeType[]> getAvailableCRSCodes()
          This method should be called if one is only interested in the available identifiers and not in the coordinatesystems themselves.
 List<ICRS> getAvailableCRSs()
          This method should be called to see if the provider is able to create all defined crs's, thus verifying the correctness of the configuration.
 ICRS getCoordinateSystem(String id)
           
 CRSResource getCRSResource(CRSCodeType code)
          This method is more general than the CRSStore.getCRSByCode(CRSCodeType), because it represents a possibility to return an arbitrary CRSResource Object from the providers backend.
 Transformation getDirectTransformation(ICRS sourceCRS, ICRS targetCRS)
          This method is should retrieve a transformation which transforms coordinates from the given source into the given target crs.
 Transformation getDirectTransformation(String id)
          This method should retrieve a transformation with the given id.
protected  ProjFileResource getResolver()
           
 void init()
          Called by the manager to indicate that this CRSStore instance is being registered.
protected  CRS parseCoordinateSystem(Map<String,String> crsDefinition)
           
 void setResolver(ProjFileResource newResolver)
          Set the resolver to the given resolver.
 
Methods inherited from class org.deegree.cs.persistence.AbstractCRSStore
addIdToCache, clearCache, getCachedIdentifiable, getCachedIdentifiable, getCachedIdentifiable, getCachedIdentifiable, getCachedIdentifiable, getCachedIdentifiable, getCRSByCode, getCRSByCode, getPreferedTransformationType, resolve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PROJ4CRSStore

public PROJ4CRSStore(TransformationFactory.DSTransform prefTransformType)
Export constructor, sets the version to current date..

Method Detail

getAvailableCRSs

public List<ICRS> getAvailableCRSs()
                            throws CRSConfigurationException
Description copied from interface: CRSStore
This method should be called to see if the provider is able to create all defined crs's, thus verifying the correctness of the configuration.

Returns:
all configured CRSs.
Throws:
CRSConfigurationException - if the implementation was confronted by an exception and could not deliver the requested crs. This exception should not be thrown if no CoordinateSystems were found, in the latter case an empty List ( a list with size == 0 ) should be returned.

getAvailableCRSCodes

public List<CRSCodeType[]> getAvailableCRSCodes()
                                         throws CRSConfigurationException
Description copied from interface: CRSStore
This method should be called if one is only interested in the available identifiers and not in the coordinatesystems themselves.

Returns:
the identifiers of all configured CRSs.
Throws:
CRSConfigurationException - if the implementation was confronted by an exception and could not deliver the requested crs. This exception should not be thrown if no CoordinateSystems were found, in the latter case an empty List ( a list with size == 0 ) should be returned.

getCRSResource

public CRSResource getCRSResource(CRSCodeType code)
                           throws CRSConfigurationException
Description copied from interface: CRSStore
This method is more general than the CRSStore.getCRSByCode(CRSCodeType), because it represents a possibility to return an arbitrary CRSResource Object from the providers backend.

Parameters:
code - string representation of the resource to retrieve
Returns:
the CRSResource Object or null if no such Object was found.
Throws:
CRSConfigurationException - if the implementation was confronted by an exception and could not deliver the requested Object. This exception should not be thrown if the given id wasn't found, in this case null should be returned.

parseCoordinateSystem

protected CRS parseCoordinateSystem(Map<String,String> crsDefinition)
                             throws CRSConfigurationException
Throws:
CRSConfigurationException

getDirectTransformation

public Transformation getDirectTransformation(ICRS sourceCRS,
                                              ICRS targetCRS)
                                       throws CRSConfigurationException
Description copied from interface: CRSStore
This method is should retrieve a transformation 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 should be returned.

Parameters:
sourceCRS - start of the transformation (chain)
targetCRS - end point of the transformation (chain).
Returns:
the Transformation Object or null if no such Object was found.
Throws:
CRSConfigurationException - if the implementation was confronted by an exception and could not deliver the requested Object. This exception should not be thrown no Transformation was found, in this case null should be returned.

init

public void init()
Description copied from interface: CRSStore
Called by the manager to indicate that this CRSStore instance is being registered.


getCoordinateSystem

public ICRS getCoordinateSystem(String id)
Specified by:
getCoordinateSystem in class AbstractCRSStore
Returns:

setResolver

public void setResolver(ProjFileResource newResolver)
Set the resolver to the given resolver.

Parameters:
newResolver -

getResolver

protected ProjFileResource getResolver()
Returns:
the resolver for a type.

getDirectTransformation

public Transformation getDirectTransformation(String id)
                                       throws CRSConfigurationException
Description copied from interface: CRSStore
This method should retrieve a transformation with the given id. If a transformation with the given id could not be found null should be returned.

Parameters:
id - the id of the transformation
Returns:
the Transformation Object or null if no such Object was found.
Throws:
CRSConfigurationException - if the implementation was confronted by an exception and could not deliver the requested Object. This exception should not be thrown no Transformation was found, in this case null should be returned.


Copyright © 2011. All Rights Reserved.