deegree 2.2 (2008/12/22 11:33 build-3038-official)

org.deegree.crs.configuration
Class PROJ4CRSProvider

java.lang.Object
  extended by org.deegree.crs.configuration.PROJ4CRSProvider
All Implemented Interfaces:
CRSProvider

public class PROJ4CRSProvider
extends Object
implements CRSProvider

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:$, $Date:$
Author:
Rutger Bezema, last edited by: $Author:$

Field Summary
(package private)  Map<String,CoordinateSystem> coordinateSystems
           
(package private)  Map<String,Map<String,String>> idToParams
           
 
Constructor Summary
PROJ4CRSProvider()
          Export constructor, sets the version to current date..
PROJ4CRSProvider(File f)
          Opens a reader on the file and parses all parameters with id, without instantiating any CoordinateSystems.
 
Method Summary
 boolean canExport()
           
 void export(StringBuilder sb, List<CoordinateSystem> crsToExport)
          Exports the crs to the implemented format.
 List<CoordinateSystem> getAvailableCRSs()
           
 CoordinateSystem getCRSByID(String id)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

idToParams

Map<String,Map<String,String>> idToParams

coordinateSystems

Map<String,CoordinateSystem> coordinateSystems
Constructor Detail

PROJ4CRSProvider

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


PROJ4CRSProvider

public PROJ4CRSProvider(File f)
Opens a reader on the file and parses all parameters with id, without instantiating any CoordinateSystems.

Parameters:
f - the file to open.
Method Detail

getAvailableCRSs

public List<CoordinateSystem> getAvailableCRSs()
                                        throws CRSConfigurationException
Specified by:
getAvailableCRSs in interface CRSProvider
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 this an empty List ( a list with size == 0 ) should be returned.

canExport

public boolean canExport()
Specified by:
canExport in interface CRSProvider
Returns:
true if this provider can export a given crs.

export

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

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

getCRSByID

public CoordinateSystem getCRSByID(String id)
                            throws CRSConfigurationException
Specified by:
getCRSByID in interface CRSProvider
Parameters:
id - string representation of the CoordinateSystem
Returns:
the identified CRS or null if no such CRS was found.
Throws:
CRSConfigurationException - if the implementation was confronted by an exception and could not deliver the requested crs. This exception should not be thrown if the given id wasn't found, in this case null should be returned.

deegree 2.2 (2008/12/22 11:33 build-3038-official)

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