deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.crs.configuration.proj4
Class PROJ4CRSProvider

java.lang.Object
  extended by org.deegree.crs.configuration.AbstractCRSProvider<java.util.Map<java.lang.String,java.lang.String>>
      extended by org.deegree.crs.configuration.proj4.PROJ4CRSProvider
All Implemented Interfaces:
CRSProvider

public class PROJ4CRSProvider
extends AbstractCRSProvider<java.util.Map<java.lang.String,java.lang.String>>

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: 27765 $, $Date: 2010-11-04 07:50:32 +0100 (Do, 04 Nov 2010) $
Author:
Rutger Bezema, last edited by: $Author: lbuesching $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.deegree.crs.configuration.AbstractCRSProvider
AbstractCRSProvider.SupportedProjectionParameters, AbstractCRSProvider.SupportedProjections, AbstractCRSProvider.SupportedTransformationParameters, AbstractCRSProvider.SupportedTransformations
 
Constructor Summary
PROJ4CRSProvider()
          Export constructor, sets the version to current date..
PROJ4CRSProvider(java.util.Properties properties)
          Opens a reader on the file and parses all parameters with id, without instantiating any CoordinateSystems.
 
Method Summary
 boolean canExport()
           
 void export(java.lang.StringBuilder sb, java.util.List<CoordinateSystem> crsToExport)
          Exports the crs to the implemented format.
 java.util.List<java.lang.String> getAvailableCRSIds()
          This method should be called if one is only interested in the available identifiers and not in the coordinatesystems themselves.
 java.util.List<CoordinateSystem> 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.
 Identifiable getIdentifiable(java.lang.String id)
          This method is more general than the CRSProvider.getCRSByID(String), because it represents a possibility to return an arbitrary Identifiable Object from the providers backend.
protected  ProjFileResource getResolver()
           
 java.util.List<java.lang.String[]> getSortedAvailableCRSIds()
          This method should be called if one is only interested in the available identifiers and not in the coordinatesystems themselves.
 Transformation getTransformation(CoordinateSystem sourceCRS, CoordinateSystem targetCRS)
          This method is should retrieve a transformation (chain) which transforms coordinates from the given source into the given target crs.
 java.util.List<Transformation> getTransformations()
           
protected  CoordinateSystem parseCoordinateSystem(java.util.Map<java.lang.String,java.lang.String> crsDefinition)
           
 Transformation parseTransformation(java.util.Map<java.lang.String,java.lang.String> transformationDefinition)
           
 
Methods inherited from class org.deegree.crs.configuration.AbstractCRSProvider
addIdToCache, clearCache, getCachedIdentifiable, getCachedIdentifiable, getCachedIdentifiable, getCachedIdentifiable, getCRSByID, mapProjectionParameters, mapProjections, mapTransformation, mapTransformationParameters, setResolver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PROJ4CRSProvider

public PROJ4CRSProvider()
Export constructor, sets the version to current date..


PROJ4CRSProvider

public PROJ4CRSProvider(java.util.Properties properties)
Opens a reader on the file and parses all parameters with id, without instantiating any CoordinateSystems.

Parameters:
properties - containing a crs.configuration property referencing a file location.
Method Detail

getResolver

protected ProjFileResource getResolver()
Overrides:
getResolver in class AbstractCRSProvider<java.util.Map<java.lang.String,java.lang.String>>
Returns:
the resolver for a type.

getAvailableCRSs

public java.util.List<CoordinateSystem> getAvailableCRSs()
                                                  throws CRSConfigurationException
Description copied from interface: CRSProvider
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.

canExport

public boolean canExport()
Returns:
true if this provider can export a given crs.

export

public void export(java.lang.StringBuilder sb,
                   java.util.List<CoordinateSystem> crsToExport)
Description copied from interface: CRSProvider
Exports the crs to the implemented format. Try calling CRSProvider.canExport() before executing this method.

Parameters:
sb - the StringBuilder which will contain the exported version of the given crs.
crsToExport - the CoordinateSystems to export.
See Also:
CRSProvider.canExport()

getSortedAvailableCRSIds

public java.util.List<java.lang.String[]> getSortedAvailableCRSIds()
                                                            throws CRSConfigurationException
Description copied from interface: CRSProvider
This method should be called if one is only interested in the available identifiers and not in the coordinatesystems themselves.

Returns:
a list of string arrays. Each string array contains the identifiers of one configured CRS.
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.

getAvailableCRSIds

public java.util.List<java.lang.String> getAvailableCRSIds()
                                                    throws CRSConfigurationException
Description copied from interface: CRSProvider
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.

getIdentifiable

public Identifiable getIdentifiable(java.lang.String id)
                             throws CRSConfigurationException
Description copied from interface: CRSProvider
This method is more general than the CRSProvider.getCRSByID(String), because it represents a possibility to return an arbitrary Identifiable Object from the providers backend.

Parameters:
id - string representation of the resource to retrieve
Returns:
the Identifiable 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 CoordinateSystem parseCoordinateSystem(java.util.Map<java.lang.String,java.lang.String> crsDefinition)
                                          throws CRSConfigurationException
Specified by:
parseCoordinateSystem in class AbstractCRSProvider<java.util.Map<java.lang.String,java.lang.String>>
Parameters:
crsDefinition - containing the definition of a crs in the understood type.
Returns:
a CoordinateSystem instance initialized with values from the given type definition fragment or null if the given crsDefinition is null or not known.
Throws:
CRSConfigurationException - if an error was found in the given crsDefintion

parseTransformation

public Transformation parseTransformation(java.util.Map<java.lang.String,java.lang.String> transformationDefinition)
                                   throws CRSConfigurationException
Specified by:
parseTransformation in class AbstractCRSProvider<java.util.Map<java.lang.String,java.lang.String>>
Parameters:
transformationDefinition - containing the parameters needed to build a Transformation.
Returns:
a Transformation instance initialized with values from the given definition or null if the given transformationDefintion is null. If the parsed transformation is not supported or a NotSupportedTransformation will be returned.
Throws:
CRSConfigurationException - if an error was found in the given crsDefintion

getTransformation

public Transformation getTransformation(CoordinateSystem sourceCRS,
                                        CoordinateSystem targetCRS)
                                 throws CRSConfigurationException
Description copied from interface: CRSProvider
This method is should 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 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.

getTransformations

public java.util.List<Transformation> getTransformations()
Returns:
a list of all available transformations

deegree 2.5 (2011/06/29 09:44 build-8-official)

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