|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.deegree.cs.configuration.AbstractCRSProvider<org.apache.axiom.om.OMElement>
org.deegree.cs.configuration.gml.GMLCRSProvider
public class GMLCRSProvider
The GMLCRSProvider is a provider for a GML 3.2 backend, this may be a dictionary or a database.
Note: not all of the GML3.2. features are implemented yet, but the basics (transformations, crs's, axis, units,
projections) should work quite well.
| Constructor Summary | |
|---|---|
GMLCRSProvider(java.util.Properties properties)
The 'default constructor' which will be called by the CRSConfiguration |
|
| Method Summary | |
|---|---|
boolean |
canExport()
|
protected Helmert |
createHelmert(CRSIdentifiable id,
java.util.List<Pair<CRSIdentifiable,java.lang.Object>> parameterValues,
CoordinateSystem source,
CoordinateSystem target)
Creates a Helmert transformation from the given parameter list. |
protected NTv2Transformation |
createNTv2(CRSIdentifiable id,
java.util.List<Pair<CRSIdentifiable,java.lang.Object>> parameterValues,
CoordinateSystem source,
CoordinateSystem target)
Create an NTv2Transformation from the given parameter list. |
void |
export(java.lang.StringBuilder sb,
java.util.List<CoordinateSystem> crsToExport)
Exports the crs to the implemented format. |
java.util.List<CRSCodeType[]> |
getAvailableCRSCodes()
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. |
CRSIdentifiable |
getIdentifiable(CRSCodeType id)
This method is more general than the CRSProvider.getCRSByCode(CRSCodeType), because it represents a possibility to
return an arbitrary CRSIdentifiable Object from the providers backend. |
protected org.apache.axiom.om.OMElement |
getRequiredXlinkedElement(org.apache.axiom.om.OMElement propertyElement,
java.lang.String alternativeXPath)
convenience method to retrieve a given required element either by resolving a optional xlink or by evaluating the required element denoted by the xpath. |
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. |
protected Axis |
parseAxis(org.apache.axiom.om.OMElement rootElement)
|
protected Axis[] |
parseAxisFromCSType(org.apache.axiom.om.OMElement rootElement)
For the ellipsoidal and cartesian cs Types, this method also checks the consistency of axis (radian, radian, [metre] ) or (metre, metre, [metre] ). |
protected CompoundCRS |
parseCompoundCRS(org.apache.axiom.om.OMElement rootElement)
This methods parses the given element and maps it onto a CompoundCRS. |
protected CoordinateSystem |
parseCoordinateSystem(org.apache.axiom.om.OMElement rootElement)
|
protected GeodeticDatum |
parseDatum(org.apache.axiom.om.OMElement rootElement)
|
protected Ellipsoid |
parseEllipsoid(org.apache.axiom.om.OMElement rootElement)
|
protected CoordinateSystem |
parseGeodeticCRS(org.apache.axiom.om.OMElement rootElement)
|
Transformation |
parseGMLTransformation(org.apache.axiom.om.OMElement rootElement,
CoordinateSystem sourceCRS,
CoordinateSystem targetCRS)
Parses some of the gml 3.2 transformation constructs. |
CRSIdentifiable |
parseIdentifiedObject(org.apache.axiom.om.OMElement rootElement)
|
protected Pair<CRSIdentifiable,java.lang.Object> |
parseParameterValue(org.apache.axiom.om.OMElement rootElement)
|
protected java.util.List<Pair<CRSIdentifiable,java.lang.Object>> |
parseParameterValues(org.apache.axiom.om.OMElement rootElement)
|
protected PrimeMeridian |
parsePrimeMeridian(org.apache.axiom.om.OMElement rootElement)
|
protected CoordinateSystem |
parseProjectedCRS(org.apache.axiom.om.OMElement rootElement)
|
protected Projection |
parseProjection(org.apache.axiom.om.OMElement rootElement,
GeographicCRS underlyingCRS)
For now this method actually wraps all information in a gml:AbstractGeneralConversionType (or a derived subtype) into an CRSIdentifiable Object (used for the Projections). |
Transformation |
parseTransformation(org.apache.axiom.om.OMElement rootElement)
Calls parseGMLTransformation for the catching of XMLParsingException. |
protected Unit |
parseUnitOfMeasure(org.apache.axiom.om.OMElement elementContainingUOMAttribute)
Returns the unit defined by the uomAttribute given of the given element. |
protected VerticalCRS |
parseVerticalCRS(org.apache.axiom.om.OMElement rootElement)
|
protected VerticalDatum |
parseVerticalDatum(org.apache.axiom.om.OMElement rootElement)
|
protected org.apache.axiom.om.OMElement |
retrieveAndResolveXLink(org.apache.axiom.om.OMElement rootElement)
Retrieves the xlink:href of the given rootElement and use the XLinkResolver to resolve the xlink if it was given. |
protected java.lang.String |
retrieveXLink(org.apache.axiom.om.OMElement rootElement)
Find an xlink:href attribute and return it's value, if not found, the empty String will be returned. |
| Methods inherited from class org.deegree.cs.configuration.AbstractCRSProvider |
|---|
addIdToCache, clearCache, getCachedIdentifiable, getCachedIdentifiable, getCachedIdentifiable, getCachedIdentifiable, getCachedIdentifiable, getCachedIdentifiable, getCachedIdentifiable, getCRSByCode, getCRSByCode, getResolver, setResolver |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GMLCRSProvider(java.util.Properties properties)
properties - the properties which can hold information about the configuration of this GML provider.| Method Detail |
|---|
public boolean canExport()
public void export(java.lang.StringBuilder sb,
java.util.List<CoordinateSystem> crsToExport)
CRSProviderCRSProvider.canExport() before executing this method.
sb - the StringBuilder which will contain the exported version of the given crs.crsToExport - the CoordinateSystems to export.CRSProvider.canExport()
public java.util.List<CRSCodeType[]> getAvailableCRSCodes()
throws CRSConfigurationException
CRSProvider
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.
public java.util.List<CoordinateSystem> getAvailableCRSs()
throws CRSConfigurationException
CRSProvider
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.
protected CoordinateSystem parseCoordinateSystem(org.apache.axiom.om.OMElement rootElement)
throws CRSConfigurationException
parseCoordinateSystem in class AbstractCRSProvider<org.apache.axiom.om.OMElement>rootElement - containing a gml:CRS dom representation.
CoordinateSystem instance initialized with values from the given XML-OM gml:CRS fragment or
null if the given root element is null
CRSConfigurationException - if something went wrong.
public Transformation parseTransformation(org.apache.axiom.om.OMElement rootElement)
throws CRSConfigurationException
XMLParsingException.
parseTransformation in class AbstractCRSProvider<org.apache.axiom.om.OMElement>rootElement - containing the parameters needed to build a Transformation.
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.
CRSConfigurationException - if an error was found in the given crsDefintion
public Transformation parseGMLTransformation(org.apache.axiom.om.OMElement rootElement,
CoordinateSystem sourceCRS,
CoordinateSystem targetCRS)
throws XMLParsingException,
java.io.IOException
rootElement - sourceCRS - to be used as the source crs, if null the values from the given transformation will be
parsed.targetCRS - to be used as the target crs, if null the values from the given transformation will be
parsed.
XMLParsingException
java.io.IOException
protected Helmert createHelmert(CRSIdentifiable id,
java.util.List<Pair<CRSIdentifiable,java.lang.Object>> parameterValues,
CoordinateSystem source,
CoordinateSystem target)
Helmert transformation from the given parameter list.
id - of the transformation.parameterValues - the list of values, the Object must be a Double (denoting a the rotation/translation/ppm of
the helmert.)source - to go fromtarget - to go to
protected NTv2Transformation createNTv2(CRSIdentifiable id,
java.util.List<Pair<CRSIdentifiable,java.lang.Object>> parameterValues,
CoordinateSystem source,
CoordinateSystem target)
NTv2Transformation from the given parameter list.
id - of the transformation.parameterValues - the list of values, the Object must be a String (denoting a gridshift file url.)source - to go fromtarget - to go to
NTv2Transformation if a file was given, null otherwise.
public CRSIdentifiable parseIdentifiedObject(org.apache.axiom.om.OMElement rootElement)
throws XMLParsingException
rootElement - which is a subtype of gml:IdentifiedObject and gml:DefinitionType or gml:AbstractCRSType
CRSIdentifiable instance, its values are filled with the values of the given gml instance.
XMLParsingException - if the given rootElement could not be parsed.
protected CompoundCRS parseCompoundCRS(org.apache.axiom.om.OMElement rootElement)
throws XMLParsingException,
java.io.IOException
CompoundCRS. Currently only gml:CompoundCRS 's
consisting of following combination is supported:
CompoundCRS by calling the
parseGeodeticCRS(OMElement)
rootElement - containing a gml:CompoundCRS dom representation.
CompoundCRS instance initialized with values from the given XML-OM gml:CompoundCRS fragment.
XMLParsingException
java.io.IOException
protected CoordinateSystem parseProjectedCRS(org.apache.axiom.om.OMElement rootElement)
throws XMLParsingException,
java.io.IOException
rootElement - containing a gml:ProjectedCRS dom representation.
ProjectedCRS instance initialized with values from the given XML-OM gml:ProjectedCRS fragment
or null if the given root element is null
XMLParsingException - if the dom tree is not consistent or a required element is missing.
java.io.IOException - if a retrieval of an xlink of one of the subelements failed.
protected CoordinateSystem parseGeodeticCRS(org.apache.axiom.om.OMElement rootElement)
throws XMLParsingException,
java.io.IOException
rootElement - containing a gml:GeodeticCRS dom representation.
CoordinateSystem instance initialized with values from the given XML-OM gml:GeodeticCRS
fragment or null if the given root element is null. Note the result may be a
CompoundCRS, a GeographicCRS or a GeocentricCRS, depending of the definition of
the CS type.
XMLParsingException
java.io.IOException
protected GeodeticDatum parseDatum(org.apache.axiom.om.OMElement rootElement)
throws java.io.IOException,
XMLParsingException
rootElement - containing a gml:GeodeticDatum dom representation.
GeodeticDatum instance initialized with values from the given XML-OM fragment or
null if the given root element is null
XMLParsingException - if the dom tree is not consistent or a required element is missing.
java.io.IOException - if a retrieval of an xlink of one of the subelements failed.
protected Axis[] parseAxisFromCSType(org.apache.axiom.om.OMElement rootElement)
throws XMLParsingException,
java.io.IOException
rootElement - containing a (Ellipsoidal, Spherical, Cartesian) CS type dom representation.
Axis array instance initialized with values from the given XML-OM fragment or null
if the given root element is null
XMLParsingException - if the dom tree is not consistent or a required element is missing.
java.io.IOException - if a retrieval of an xlink of one of the subelements failed.
protected Axis parseAxis(org.apache.axiom.om.OMElement rootElement)
throws XMLParsingException
rootElement - containing an gml:CoordinateSystemAxis type dom representation.
Axis instance initialized with values from the given XML-OM fragment or null if
the given root element is null if the axis could not be mapped it's orientation will be
Axis.AO_OTHER
XMLParsingException - if the dom tree is not consistent or a required element is missing.
protected Ellipsoid parseEllipsoid(org.apache.axiom.om.OMElement rootElement)
throws XMLParsingException
rootElement - containing a gml:Ellipsoid dom representation.
Ellipsoid instance initialized with values from the given XML-OM fragment or null
if the given root element is null
XMLParsingException - if the dom tree is not consistent or a required element is missing.
protected PrimeMeridian parsePrimeMeridian(org.apache.axiom.om.OMElement rootElement)
throws XMLParsingException
rootElement - to create the pm from.
PrimeMeridian.GREENWICH or the appropriate pm if a longitude is defined.
XMLParsingException
protected VerticalCRS parseVerticalCRS(org.apache.axiom.om.OMElement rootElement)
throws XMLParsingException,
java.io.IOException
rootElement - containing a gml:VerticalCRS dom representation.
VerticalCRS instance initialized with values from the given XML-OM fragment or
null if the given root element is null
java.io.IOException
XMLParsingException - if the dom tree is not consistent or a required element is missing.
protected VerticalDatum parseVerticalDatum(org.apache.axiom.om.OMElement rootElement)
throws XMLParsingException
rootElement - containing a gml:VerticalDatum dom representation.
VerticalDatum instance initialized with values from the given XML-OM fragment or
null if the given root element is null
XMLParsingException - if the dom tree is not consistent or a required element is missing.
protected Projection parseProjection(org.apache.axiom.om.OMElement rootElement,
GeographicCRS underlyingCRS)
throws XMLParsingException,
java.io.IOException
rootElement - a gml:GeneralConversion elementunderlyingCRS - of the projection.
XMLParsingException - if the dom tree is not consistent or a required element is missing.
java.io.IOException
protected java.util.List<Pair<CRSIdentifiable,java.lang.Object>> parseParameterValues(org.apache.axiom.om.OMElement rootElement)
throws XMLParsingException,
java.io.IOException
rootElement - which should contain a list of parameter Value properties.
null or no
parameterValues were found.
XMLParsingException - if the dom tree is not consistent or a required element is missing.
java.io.IOException
protected Pair<CRSIdentifiable,java.lang.Object> parseParameterValue(org.apache.axiom.om.OMElement rootElement)
throws XMLParsingException,
java.io.IOException
rootElement - containing a parameter Value property.
null
XMLParsingException - if the dom tree is not consistent or a required element is missing.
java.io.IOException
protected Unit parseUnitOfMeasure(org.apache.axiom.om.OMElement elementContainingUOMAttribute)
throws XMLParsingException
elementContainingUOMAttribute - an element containing the 'uom' attribute which will be mapped onto a known unit.
Unit or null if the given uomAttribute is empty or null, or
no appropriate mapping could be found.
XMLParsingException
protected org.apache.axiom.om.OMElement getRequiredXlinkedElement(org.apache.axiom.om.OMElement propertyElement,
java.lang.String alternativeXPath)
throws XMLParsingException,
java.io.IOException
propertyElement - to resolve an xlink from.alternativeXPath - denoting a path to the required node starting from the given propertyElement.
XMLParsingException - if the given propertyElement is null or the resulting xml dom-tree could not be parsed
or the alternative xpath does not result in an Element.
java.io.IOException - if the xlink could not be properly resolved
protected org.apache.axiom.om.OMElement retrieveAndResolveXLink(org.apache.axiom.om.OMElement rootElement)
throws java.io.IOException
rootElement - to retrieve and resolve
null if the xlink could not be
resolved (or was not given) or the rootElement is null.
java.io.IOExceptionprotected java.lang.String retrieveXLink(org.apache.axiom.om.OMElement rootElement)
rootElement - to get the attribute from.
public Transformation getTransformation(CoordinateSystem sourceCRS,
CoordinateSystem targetCRS)
throws CRSConfigurationException
CRSProvidernull 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.
public CRSIdentifiable getIdentifiable(CRSCodeType id)
throws CRSConfigurationException
CRSProviderCRSProvider.getCRSByCode(CRSCodeType), because it represents a possibility to
return an arbitrary CRSIdentifiable Object from the providers backend.
id - string representation of the resource to retrieve
CRSIdentifiable Object or null if no such Object was found.
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||