deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

org.deegree.crs.configuration.deegree.xml.stax
Class Parser

java.lang.Object
  extended by org.deegree.crs.configuration.deegree.xml.stax.Parser
All Implemented Interfaces:
CRSParser<StAXResource>, CRSResource<StAXResource>, XLinkResolver<StAXResource>

public class Parser
extends Object
implements CRSParser<StAXResource>

The CRSParser holds the instances to the StAX based crs components parsers.

Version:
$Revision: 22662 $, $Date: 2010-02-19 14:51:52 +0100 (Fr, 19 Feb 2010) $
Author:
Rutger Bezema, last edited by: $Author: mschneider $

Field Summary
static String CRS_NS
          Default namespace of the crs configuration
 
Constructor Summary
Parser(DeegreeCRSProvider<StAXResource> provider, Properties properties)
           
 
Method Summary
 List<CRSCodeType[]> getAvailableCRSCodes()
           
 Ellipsoid getEllipsoidForId(String ellipsoidId)
          Tries to find a cached ellipsoid, if not found, the config will be checked.
 GeodeticDatum getGeodeticDatumForId(String datumId)
           
 PrimeMeridian getPrimeMeridianForId(String meridianId)
           
 Projection getProjectionForId(String id, GeographicCRS underlyingCRS)
           
 Transformation getTransformation(CoordinateSystem sourceCRS, CoordinateSystem targetCRS)
          Implementations should find a given transformation (chain) which transforms coordinates of the given coordinate system into coordinates of the target crs.
 StAXResource getURIAsType(String uri)
          Opens a stream to a resource which is defined by the uri.
 String getVersion()
           
 Helmert getWGS84Transformation(GeographicCRS sourceCRS)
          Implementations should find the helmert transformation which transforms coordinates of the geodetic datum into coordinates of the WGS84 datum.
 CoordinateSystem parseCoordinateSystem(StAXResource crsDefintion)
           
 CRSIdentifiable parseIdentifiableObject(String id)
          Gets the Element for the given id and heuristically check the localname of the resulting root Element.
 Transformation parseTransformation(StAXResource transformationDefinition)
          Retrieves a transformation from the resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CRS_NS

public static final String CRS_NS
Default namespace of the crs configuration

See Also:
Constant Field Values
Constructor Detail

Parser

public Parser(DeegreeCRSProvider<StAXResource> provider,
              Properties properties)
Parameters:
provider -
properties -
Method Detail

getTransformation

public Transformation getTransformation(CoordinateSystem sourceCRS,
                                        CoordinateSystem targetCRS)
Description copied from interface: CRSResource
Implementations should find a given transformation (chain) which transforms coordinates of the given coordinate system into coordinates of the target crs. If no such transformation could be found, the implementation should return null

Specified by:
getTransformation in interface CRSResource<StAXResource>
Parameters:
sourceCRS - start point of the transformation.
targetCRS - end point of the transformations
Returns:
the Transformation or null if no such transformation was defined.

getWGS84Transformation

public Helmert getWGS84Transformation(GeographicCRS sourceCRS)
Description copied from interface: CRSResource
Implementations should find the helmert transformation which transforms coordinates of the geodetic datum into coordinates of the WGS84 datum. If no such transformation could be found, the implementation should return null

Specified by:
getWGS84Transformation in interface CRSResource<StAXResource>
Parameters:
sourceCRS - to retrieve the transformation for.
Returns:
the Helmert transformation or null if no such transformation was defined.

getURIAsType

public StAXResource getURIAsType(String uri)
                          throws IOException
Description copied from interface: XLinkResolver
Opens a stream to a resource which is defined by the uri.

Specified by:
getURIAsType in interface XLinkResolver<StAXResource>
Parameters:
uri - to locate
Returns:
an opened InputStream to the given resource or null if no resource was found.
Throws:
IOException - If an error occurred while locating or opening the resource.

getAvailableCRSCodes

public List<CRSCodeType[]> getAvailableCRSCodes()
                                         throws CRSConfigurationException
Specified by:
getAvailableCRSCodes in interface CRSParser<StAXResource>
Returns:
all available codetypes, each sole array should reference the ids of one single crs.
Throws:
CRSConfigurationException

getEllipsoidForId

public Ellipsoid getEllipsoidForId(String ellipsoidId)
                            throws CRSConfigurationException
Description copied from interface: CRSParser
Tries to find a cached ellipsoid, if not found, the config will be checked.

Specified by:
getEllipsoidForId in interface CRSParser<StAXResource>
Returns:
an ellipsoid or null if no ellipsoid with given id was found, or the id was null or empty.
Throws:
CRSConfigurationException - if something went wrong.

getGeodeticDatumForId

public GeodeticDatum getGeodeticDatumForId(String datumId)
                                    throws CRSConfigurationException
Specified by:
getGeodeticDatumForId in interface CRSParser<StAXResource>
Returns:
the
Throws:
CRSConfigurationException

getPrimeMeridianForId

public PrimeMeridian getPrimeMeridianForId(String meridianId)
                                    throws CRSConfigurationException
Specified by:
getPrimeMeridianForId in interface CRSParser<StAXResource>
Parameters:
meridianId - the id to search for.
Returns:
the primeMeridian with given id or null
Throws:
CRSConfigurationException - if the longitude was not set or the units could not be parsed.

getProjectionForId

public Projection getProjectionForId(String id,
                                     GeographicCRS underlyingCRS)
Specified by:
getProjectionForId in interface CRSParser<StAXResource>
Parameters:
id - of the projection
underlyingCRS - of the projection
Returns:
the projection denoted by the given id, or null if no such projection could be loaded.

getVersion

public String getVersion()
                  throws CRSConfigurationException
Specified by:
getVersion in interface CRSParser<StAXResource>
Returns:
the version of the root element of the empty string if no version attribute was found in the root element.
Throws:
CRSConfigurationException - if the root element is empty

parseCoordinateSystem

public CoordinateSystem parseCoordinateSystem(StAXResource crsDefintion)
                                       throws CRSConfigurationException
Specified by:
parseCoordinateSystem in interface CRSParser<StAXResource>
Parameters:
crsDefintion - to be parsed
Returns:
an instance of the given crs or null if the crsDefinition is null or could not be mapped to a valid type.
Throws:
CRSConfigurationException - if something went wrong while constructing the crs.

parseIdentifiableObject

public CRSIdentifiable parseIdentifiableObject(String id)
Description copied from interface: CRSParser
Gets the Element for the given id and heuristically check the localname of the resulting root Element. This version supports following local names (see schema):
  • ellipsoid
  • geodeticDatum
  • projectedCRS
  • geographicCRS
  • compoundCRS
  • geocentricCRS
  • primeMeridian
  • wgs84Transformation

Specified by:
parseIdentifiableObject in interface CRSParser<StAXResource>
Parameters:
id - to look for.
Returns:
the instantiated CRSIdentifiable or null if it could not be parsed.

parseTransformation

public Transformation parseTransformation(StAXResource transformationDefinition)
Description copied from interface: CRSParser
Retrieves a transformation from the resource.

Specified by:
parseTransformation in interface CRSParser<StAXResource>
Returns:
the parsed transformation or null if no transformation could be parsed.

deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

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

]]>