org.deegree.cs.persistence.deegree.d3.parsers
Class CoordinateSystemParser

java.lang.Object
  extended by org.deegree.cs.persistence.deegree.d3.parsers.DefinitionParser
      extended by org.deegree.cs.persistence.deegree.d3.parsers.CoordinateSystemParser

public class CoordinateSystemParser
extends DefinitionParser

Stax-based parser for Coordinate system objects.

Version:
$Revision: 31619 $, $Date: 2011-08-23 14:56:28 +0200 (Tue, 23 Aug 2011) $
Author:
Rutger Bezema, last edited by: $Author: mschneider $

Field Summary
 
Fields inherited from class org.deegree.cs.persistence.deegree.d3.parsers.DefinitionParser
store
 
Constructor Summary
CoordinateSystemParser(DeegreeCRSStore provider, URL configURL)
           
 
Method Summary
protected  QName expectedRootName()
           
 List<CRSCodeType[]> getAvailableCRSs()
           
 ICRS getCRSForId(String crsId)
           
protected  List<Transformation> parseAlternativeTransformations(XMLStreamReader reader)
          Parse all polynomial transformations for a given crs.
protected  Axis parseAxis(XMLStreamReader reader)
          Parses an axis element
protected  Axis[] parseAxisOrder(XMLStreamReader reader)
          Creates an axis array for the given crs element.
protected  CRS parseCompoundCRS(XMLStreamReader reader)
           
 CRS parseCoordinateSystem(XMLStreamReader reader)
           
protected  CRS parseGeocentricCRS(XMLStreamReader reader)
           
protected  CRS parseGeographicCRS(XMLStreamReader reader)
           
protected  CRS parseProjectedCRS(XMLStreamReader reader)
           
protected  IGeodeticDatum parseReferencedGeodeticDatum(XMLStreamReader reader, String parentID)
          Parses the required usedDatum element from the given parentElement (probably a crs element).
 Transformation parseTransformation(org.apache.axiom.om.OMElement transformationDefinition)
          Retrieves a transformation from the resource.
 
Methods inherited from class org.deegree.cs.persistence.deegree.d3.parsers.DefinitionParser
getConfigReader, getConfigURL, getStore, moveReaderToNextIdentifiable, moveReaderToNextIdentifiable, parseIdentifiable, parseLatLonType, parseUnit, readEntireFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoordinateSystemParser

public CoordinateSystemParser(DeegreeCRSStore provider,
                              URL configURL)
Parameters:
provider - to be used for callback.
configURL - to be used for the configuration.
Method Detail

getCRSForId

public ICRS getCRSForId(String crsId)
                 throws CRSConfigurationException
Parameters:
crsId -
Returns:
the
Throws:
CRSConfigurationException

parseCoordinateSystem

public CRS parseCoordinateSystem(XMLStreamReader reader)
                          throws CRSConfigurationException,
                                 XMLStreamException
Parameters:
reader - 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.
XMLStreamException

parseAxisOrder

protected Axis[] parseAxisOrder(XMLStreamReader reader)
                         throws CRSConfigurationException,
                                XMLStreamException
Creates an axis array for the given crs element.

Parameters:
reader - to be parsed from
Returns:
an Array of axis defining their order.
Throws:
CRSConfigurationException - if a required element could not be found, or an xmlParsingException occurred, or the axisorder uses names which were not defined in the axis elements.
XMLStreamException

parseAxis

protected Axis parseAxis(XMLStreamReader reader)
                  throws XMLStreamException,
                         XMLParsingException
Parses an axis element

Parameters:
reader -
Returns:
the parsed axis element
Throws:
XMLStreamException
XMLParsingException

parseTransformation

public Transformation parseTransformation(org.apache.axiom.om.OMElement transformationDefinition)
Retrieves a transformation from the resource.

Parameters:
transformationDefinition -
Returns:
the parsed transformation or null if no transformation could be parsed.

parseAlternativeTransformations

protected List<Transformation> parseAlternativeTransformations(XMLStreamReader reader)
Parse all polynomial transformations for a given crs.

Parameters:
reader - to parse the transformations for.
Returns:
the list of transformations or the empty list if no transformations were found. Never null.

parseProjectedCRS

protected CRS parseProjectedCRS(XMLStreamReader reader)
                         throws CRSConfigurationException,
                                XMLStreamException
Parameters:
reader - from which the crs is to be created (using chached datums, conversioninfos and projections).
Returns:
a projected coordinatesystem based on the given xml-element.
Throws:
CRSConfigurationException - if a required element could not be found, or an xmlParsingException occurred.
XMLStreamException

parseGeographicCRS

protected CRS parseGeographicCRS(XMLStreamReader reader)
                          throws CRSConfigurationException,
                                 XMLStreamException
Parameters:
reader - positioned on the crs to be created (using cached datums, conversioninfos and projections).
Returns:
a geographic coordinatesystem based on the given xml-element.
Throws:
CRSConfigurationException - if a required element could not be found, or an xmlParsingException occurred.
XMLStreamException

parseGeocentricCRS

protected CRS parseGeocentricCRS(XMLStreamReader reader)
                          throws CRSConfigurationException,
                                 XMLStreamException
Parameters:
reader - from which the crs is to be created (using cached datums, conversioninfos and projections).
Returns:
a geocentric coordinatesystem based on the given xml-element.
Throws:
CRSConfigurationException - if a required element could not be found, or an xmlParsingException occurred.
XMLStreamException

parseCompoundCRS

protected CRS parseCompoundCRS(XMLStreamReader reader)
                        throws XMLStreamException
Parameters:
reader - from which the crs is to be created.
Returns:
a compound coordinatesystem based on the given xml-element.
Throws:
XMLStreamException
CRSConfigurationException - if a required element could not be found, or an xmlParsingException occurred.

parseReferencedGeodeticDatum

protected IGeodeticDatum parseReferencedGeodeticDatum(XMLStreamReader reader,
                                                      String parentID)
                                               throws CRSConfigurationException,
                                                      XMLStreamException
Parses the required usedDatum element from the given parentElement (probably a crs element).

Parameters:
reader - pointing to the required usedDatum element from.
parentID - optional for an appropriate error message.
Returns:
the Datum.
Throws:
CRSConfigurationException - if a parsing error occurred, the node was not defined or an illegal id reference (not found) was given.
XMLStreamException

expectedRootName

protected QName expectedRootName()
Specified by:
expectedRootName in class DefinitionParser
Returns:
the top level element of a configuration file.

getAvailableCRSs

public List<CRSCodeType[]> getAvailableCRSs()
Returns:
the list of all available crs id's


Copyright © 2011. All Rights Reserved.