Class GeodeticObjectParser

All Implemented Interfaces:
Comparator<org.opengis.referencing.cs.CoordinateSystemAxis>, Parser
Direct Known Subclasses:
WKTFormat.Parser

class GeodeticObjectParser extends MathTransformParser implements Comparator<org.opengis.referencing.cs.CoordinateSystemAxis>
Well Known Text (WKT) parser for referencing objects. This include, but is not limited too, Coordinate Reference System and Math Transform objects. Note that math transforms are part of the WKT 1 "FITTED_CS" element.
Since:
0.6
Version:
1.3
  • Field Details

    • ToWGS84

      private static final String[] ToWGS84
      The names of the 7 parameters in a TOWGS84[…] element. Those names are derived from the Well Known Text (WKT) version 1 specification. They are not the same than the BursaWolfParameters field names, which are derived from the EPSG database.
    • usesCommonUnits

      private final boolean usesCommonUnits
      During WKT 1 parsing, true means that PRIMEM and PARAMETER angular units need to be forced to Units.DEGREE instead of inferred from the context. Note that this rule does not apply to AXIS elements

      This flag is ignored during WKT 2 parsing.

      See Also:
    • ignoreAxes

      private final boolean ignoreAxes
      During WKT 1 parsing, true means that axes should be parsed only for verifying the syntax, but otherwise parsing should behave as if axes were not declared.

      This flag is ignored during WKT 2 parsing.

      See Also:
    • transliterator

      private final Transliterator transliterator
      The object to use for replacing WKT axis names and abbreviations by ISO 19111 names and abbreviations.
    • properties

      private final Map<String,Object> properties
      A map of properties to be given to the factory constructor methods. This map will be recycled for each object to be parsed.
    • axisOrder

      private final Map<org.opengis.referencing.cs.CoordinateSystemAxis,Integer> axisOrder
      Order of coordinate system axes. Used only if AXIS[…] elements contain ORDER[…] sub-element.
    • verticalCRS

      private transient org.opengis.referencing.crs.VerticalCRS verticalCRS
      The last vertical CRS found during the parsing, or null if none. This information is needed for creating DefaultVerticalExtent instances.

      ISO 19162 said that we should have at most one vertical CRS per WKT. Apache SIS does not enforce this constraint, but if a WKT contains more than one vertical CRS then the instance used for completing the DefaultVerticalExtent instances is unspecified.

    • verticalElements

      private transient VerticalInfo verticalElements
      A chained list of temporary information needed for completing the construction of DefaultVerticalExtent instances. In particular, stores the unit of measurement until the VerticalCRS instance to associate to the extents become known.
  • Constructor Details

    • GeodeticObjectParser

      public GeodeticObjectParser(Map<String,?> defaultProperties, org.opengis.referencing.ObjectFactory factories, org.opengis.referencing.operation.MathTransformFactory mtFactory)
      Constructs a parser for the specified set of symbols using the specified set of factories. This constructor is for internal usage by Apache SIS only — do not use!

      Maintenance note: this constructor is invoked through reflection by GeodeticObjectFactory.createFromWKT(String). Do not change the method signature even if it doesn't break the compilation, unless the reflection code is also updated.

      Parameters:
      defaultProperties - default properties to give to the objects to create.
      factories - an object implementing DatumFactory, CSFactory and CRSFactory.
      mtFactory - the factory to use to create MathTransform objects.
    • GeodeticObjectParser

      GeodeticObjectParser(Symbols symbols, Map<String,StoredTree> fragments, NumberFormat numberFormat, DateFormat dateFormat, UnitFormat unitFormat, Convention convention, Transliterator transliterator, Locale errorLocale, ReferencingFactoryContainer factories)
      Constructs a parser for the specified set of symbols using the specified set of factories. This constructor is for WKTFormat usage only.
      Parameters:
      symbols - the set of symbols to use.
      fragments - reference to the WKTFormat.fragments map, or an empty map if none.
      numberFormat - the number format provided by WKTFormat, or null for a default format.
      dateFormat - the date format provided by WKTFormat, or null for a default format.
      unitFormat - the unit format provided by WKTFormat, or null for a default format.
      convention - the WKT convention to use.
      errorLocale - the locale for error messages (not for parsing), or null for the system default.
      factories - on input, the factories to use. On output, the factories used. Can be null.
  • Method Details

    • getPublicFacade

      String getPublicFacade()
      Returns the name of the class providing the publicly-accessible createFromWKT(String) method. This information is used for logging purpose only.
      Overrides:
      getPublicFacade in class MathTransformParser
    • completeRoot

      void completeRoot(Map<String,Object> properties)
      Completes or edits properties of the root IdentifiedObject. This method is invoked before a Factory.createFoo(Map, …) method is invoked for creating the root object. The properties map is filled with all information that this parser found in the WKT elements. Subclasses can override this method for adding additional information if desired.

      The most typical use case is to add a default Identifier when the WKT does not contain an explicit ID[…] or AUTHORITY[…] element.

      Parameters:
      properties - the properties to be given in a call to a createFoo(Map, …) method.
      See Also:
    • createFromWKT

      final Object createFromWKT(String text, ParsePosition position) throws ParseException
      Parses a Well-Know Text from specified position as a geodetic object. Caller should invoke AbstractParser.getAndClearWarnings(Object) in a finally block after this method.
      Overrides:
      createFromWKT in class AbstractParser
      Parameters:
      text - the Well-Known Text (WKT) to parse.
      position - index of the first character to parse (on input) or after last parsed character (on output).
      Returns:
      the parsed object.
      Throws:
      ParseException - if the string cannot be parsed.
    • buildFromTree

      final Object buildFromTree(Element element) throws ParseException
      Parses the next element in the specified Well Know Text (WKT) tree.
      Overrides:
      buildFromTree in class MathTransformParser
      Parameters:
      element - the element to be parsed.
      Returns:
      the parsed object.
      Throws:
      ParseException - if the element cannot be parsed.
    • parseCoordinateReferenceSystem

      private org.opengis.referencing.crs.CoordinateReferenceSystem parseCoordinateReferenceSystem(Element element, boolean mandatory) throws ParseException
      Parses a coordinate reference system element.
      Parameters:
      element - the parent element.
      mandatory - true if a CRS must be present, or false if optional.
      Returns:
      the next element as a CoordinateReferenceSystem object.
      Throws:
      ParseException - if the next element cannot be parsed.
    • parseCoordinateReferenceSystem

      private org.opengis.referencing.crs.CoordinateReferenceSystem parseCoordinateReferenceSystem(Element parent, int mode, String keyword) throws ParseException
      Parses a coordinate reference system wrapped in an element of the given name.
      Parameters:
      parent - the parent element containing the CRS to parse.
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      keyword - "SourceCRS", "TargetCRS" or "InterpolationCRS".
      Returns:
      the coordinate reference system, or null if none.
      Throws:
      ParseException - if the CRS cannot be parsed.
    • toIdentifier

      private static org.opengis.metadata.Identifier toIdentifier(Object identifier)
      Returns the value associated to IdentifiedObject.IDENTIFIERS_KEY as an Identifier object. This method shall accept all value types that parseMetadataAndClose(Element, String, IdentifiedObject) may store.
      Parameters:
      identifier - the properties value, or null.
      Returns:
      the identifier, or null if the given value was null.
    • parseMetadataAndClose

      private Map<String,Object> parseMetadataAndClose(Element parent, String name, org.opengis.referencing.IdentifiedObject fallback) throws ParseException
      Parses an optional metadata elements and close. This includes elements like "SCOPE", "ID" (WKT 2) or "AUTHORITY" (WKT 1). This WKT 1 element has the following pattern:

      Fallback

      The name is a mandatory property, but some invalid WKT with an empty string exist. In such case, we will use the name of the enclosed datum. Indeed, it is not uncommon to have the same name for a geographic CRS and its geodetic datum.
      Parameters:
      parent - the parent element.
      name - the name of the parent object being parsed.
      fallback - the fallback to use if name is empty.
      Returns:
      a properties map with the parent name and the optional authority code.
      Throws:
      ParseException - if an element cannot be parsed.
      See Also:
    • parseAnchorAndClose

      private Map<String,Object> parseAnchorAndClose(Element element, String name) throws ParseException
      Parses the datum ANCHOR[] element and pass the values to the parseMetadataAndClose(Element, String, IdentifiedObject) method. If an anchor has been found, its value is stored in the returned map.
      Throws:
      ParseException
    • parseScaledUnit

      private <Q extends javax.measure.Quantity<Q>> javax.measure.Unit<Q> parseScaledUnit(Element parent, String keyword, javax.measure.Unit<Q> baseUnit) throws ParseException
      Parses an optional "UNIT" element of a known dimension. This element has the following pattern: Unit was a mandatory element in WKT 1, but became optional in WKT 2 because the unit may be specified in each AXIS[…] element instead of for the whole coordinate system.
      Parameters:
      parent - the parent element.
      keyword - the unit keyword (e.g. "LengthUnit" or "AngleUnit").
      baseUnit - the base unit, usually Units.METRE or Units.RADIAN.
      Returns:
      the "UNIT" element as an Unit object, or null if none.
      Throws:
      ParseException - if the "UNIT" cannot be parsed.
      See Also:
    • parseCoordinateSystem

      private org.opengis.referencing.cs.CoordinateSystem parseCoordinateSystem(Element parent, String type, int dimension, boolean isWKT1, javax.measure.Unit<?> defaultUnit, org.opengis.referencing.datum.Datum datum) throws ParseException, org.opengis.util.FactoryException
      Parses a "CS" element followed by all "AXIS" elements. This element has the following pattern (simplified): This element is different from all other elements parsed by GeodeticObjectParser in that its components are sibling elements rather than child elements of the CS element.

      The optional "UNIT[…]" element shall be parsed by the caller. That element may appear after the "CS[…]" element (not inside). The unit may be forced to some dimension (e.g. "LengthUnit") or be any kind of unit, depending on the context in which this parseCoordinateSystem(…) method is invoked.

      Variants of Cartesian type

      The WKTKeywords.Cartesian type may be used for projected, geocentric or other kinds of CRS. However, while all those variants are of the same CS type, their axis names and directions differ. Current implementation uses the following rules:
      • If the datum is not geodetic, then the axes of the Cartesian CS are unknown.
      • Otherwise if dimension is 2, then the CS is assumed to be for a projected CRS.
      • Otherwise if dimension is 3, then the CS is assumed to be for a geocentric CRS.
      Parameters:
      parent - the parent element.
      type - the expected type (Cartesian | ellipsoidal | vertical | etc…), or null if unknown.
      dimension - the minimal number of dimensions. Can be 1 if unknown.
      isWKT1 - true if the parent element is an element from the WKT 1 standard.
      defaultUnit - the contextual unit (usually Units.METRE or Units.RADIAN), or null if unknown.
      datum - the datum of the enclosing CRS, or null if unknown.
      Returns:
      the "CS", "UNIT" and/or "AXIS" elements as a Coordinate System, or null.
      Throws:
      ParseException - if an element cannot be parsed.
      org.opengis.util.FactoryException - if the factory cannot create the coordinate system.
    • parseAxis

      private org.opengis.referencing.cs.CoordinateSystemAxis parseAxis(int mode, Element parent, String csType, javax.measure.Unit<?> defaultUnit) throws ParseException
      Parses an "AXIS" element. This element has the following pattern (simplified): Abbreviation may be specified between parenthesis. Nested parenthesis are possible, as for example:
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      csType - the coordinate system type (Cartesian | ellipsoidal | vertical | etc…), or null if unknown.
      defaultUnit - the contextual unit (usually Units.METRE or Units.RADIAN), or null if unknown.
      Returns:
      the "AXIS" element as a CoordinateSystemAxis object, or null if the axis was not required and there are no axis objects.
      Throws:
      ParseException - if the "AXIS" element cannot be parsed.
    • compare

      public final int compare(org.opengis.referencing.cs.CoordinateSystemAxis o1, org.opengis.referencing.cs.CoordinateSystemAxis o2)
      Compares axes for order. This method is used for ordering axes according their ORDER element, if present. If no ORDER element were present, then the axis order is left unchanged. If only some axes have an ORDER element (which is illegal according ISO 19162), then those axes will be sorted before the axes without ORDER element.
      Specified by:
      compare in interface Comparator<org.opengis.referencing.cs.CoordinateSystemAxis>
      Parameters:
      o1 - the first axis to compare.
      o2 - the second axis to compare.
      Returns:
      -1 if o1 should be before o2, +1 if o2 should be before o1, or 0 if undetermined (no axis order change).
    • parsePrimeMeridian

      private org.opengis.referencing.datum.PrimeMeridian parsePrimeMeridian(int mode, Element parent, boolean isWKT1, javax.measure.Unit<javax.measure.quantity.Angle> angularUnit) throws ParseException
      Parses a "PrimeMeridian" element. The syntax is given by WKT 2 specification §8.2.2. The legacy WKT 1 pattern was:
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      isWKT1 - true if this method is invoked while parsing a WKT 1 element.
      angularUnit - the contextual unit.
      Returns:
      the "PrimeMeridian" element as a PrimeMeridian object.
      Throws:
      ParseException - if the "PrimeMeridian" element cannot be parsed.
      See Also:
    • parseToWGS84

      private Object parseToWGS84(int mode, Element parent) throws ParseException
      Parses an optional "TOWGS84" element. This element is specific to WKT 1 and has the following pattern:
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      Returns:
      the "TOWGS84" element as a BursaWolfParameters object, or null if no "TOWGS84" has been found.
      Throws:
      ParseException - if the "TOWGS84" cannot be parsed.
    • parseEllipsoid

      private org.opengis.referencing.datum.Ellipsoid parseEllipsoid(int mode, Element parent) throws ParseException
      Parses an "Ellipsoid" element. The syntax is given by WKT 2 specification §8.2.1. The legacy WKT 1 pattern was:
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      Returns:
      the "Ellipsoid" element as an Ellipsoid object.
      Throws:
      ParseException - if the "Ellipsoid" element cannot be parsed.
      See Also:
    • parseBaseCRS

      private org.opengis.referencing.crs.SingleCRS parseBaseCRS(int mode, Element parent, org.opengis.referencing.operation.OperationMethod method) throws ParseException
      Parses a "GeodeticCRS" (WKT 2) element where the number of dimensions and coordinate system type are derived from the operation method. This is used for parsing the base CRS component of derived CRS.
      Parameters:
      mode - AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      method - the operation method, or null if unknown.
      Throws:
      ParseException - if the "GeodeticCRS" element cannot be parsed.
    • parseMethod

      private org.opengis.referencing.operation.OperationMethod parseMethod(Element parent, String... keywords) throws ParseException
      Parses a "Method" (WKT 2) element, without the parameters.
      Parameters:
      parent - the parent element.
      keywords - the element keywords.
      Returns:
      the operation method.
      Throws:
      ParseException - if the "Method" element cannot be parsed.
    • parseDerivingConversion

      private org.opengis.referencing.operation.Conversion parseDerivingConversion(int mode, Element parent, String wrapper, javax.measure.Unit<?> defaultUnit, javax.measure.Unit<javax.measure.quantity.Angle> defaultAngularUnit) throws ParseException
      Parses a "Method" (WKT 2) element, followed by parameter values. The syntax is given by WKT 2 specification §9.3. The legacy WKT 1 specification was: Note that in WKT 2, this element is wrapped inside a Conversion or DerivingConversion element which is itself inside the ProjectedCRS element. This is different than WKT 1, which puts this element right into the the ProjectedCRS element without Conversion wrapper.
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      wrapper - "Conversion" or "DerivingConversion" wrapper name, or null if parsing a WKT 1.
      defaultUnit - the unit (usually linear) of the parent element, or null.
      defaultAngularUnit - the angular unit of the sibling GeographicCRS element, or null.
      Returns:
      the "Method" element and its parameters as a defining conversion.
      Throws:
      ParseException - if the "Method" element cannot be parsed.
    • parseDatum

      private org.opengis.referencing.datum.GeodeticDatum parseDatum(int mode, Element parent, org.opengis.referencing.datum.PrimeMeridian meridian) throws ParseException
      Parses a "Datum" (WKT 2) element. The syntax is given by WKT 2 specification §8.2.4. The legacy WKT 1 pattern was:
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      meridian - the prime meridian, or null for Greenwich.
      Returns:
      the "Datum" element as a GeodeticDatum object.
      Throws:
      ParseException - if the "Datum" element cannot be parsed.
      See Also:
    • parseVerticalDatum

      private org.opengis.referencing.datum.VerticalDatum parseVerticalDatum(int mode, Element parent, boolean isWKT1) throws ParseException
      Parses a "VerticalDatum" (WKT 2) element. The syntax is given by WKT 2 specification §10.2. The legacy WKT 1 pattern was:
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      isWKT1 - true if the parent is a WKT 1 element.
      Returns:
      the "VerticalDatum" element as a VerticalDatum object.
      Throws:
      ParseException - if the "VerticalDatum" element cannot be parsed.
    • parseTimeDatum

      private org.opengis.referencing.datum.TemporalDatum parseTimeDatum(int mode, Element parent) throws ParseException
      Parses a "TimeDatum" element. This element has the following pattern:
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      Returns:
      the "TimeDatum" element as a TemporalDatum object.
      Throws:
      ParseException - if the "TimeDatum" element cannot be parsed.
    • parseParametricDatum

      private org.opengis.referencing.datum.Datum parseParametricDatum(int mode, Element parent) throws ParseException
      Parses a "ParametricDatum" element. This element has the following pattern:
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      Returns:
      the "ParametricDatum" element as a ParametricDatum object.
      Throws:
      ParseException - if the "ParametricDatum" element cannot be parsed.
    • parseEngineeringDatum

      private org.opengis.referencing.datum.EngineeringDatum parseEngineeringDatum(int mode, Element parent, boolean isWKT1) throws ParseException
      Parses a "EngineeringDatum" (WKT 2) element. The syntax is given by WKT 2 specification §11.2. The legacy WKT 1 pattern was: The datum type (WKT 1 only) is currently ignored.
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      isWKT1 - true if the parent is a WKT 1 element.
      Returns:
      the "EngineeringDatum" element as an EngineeringDatum object.
      Throws:
      ParseException - if the "EngineeringDatum" element cannot be parsed.
    • parseImageDatum

      private org.opengis.referencing.datum.ImageDatum parseImageDatum(int mode, Element parent) throws ParseException
      Parses an "ImageDatum" (WKT 2) element. The syntax is given by WKT 2 specification §12.2.
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      Returns:
      the "ImageDatum" element as an ImageDatum object.
      Throws:
      ParseException - if the "ImageDatum" element cannot be parsed.
    • parseEngineeringCRS

      private org.opengis.referencing.crs.SingleCRS parseEngineeringCRS(int mode, Element parent, boolean isBaseCRS) throws ParseException
      Parses a "EngineeringCRS" (WKT 2) element. The syntax is given by WKT 2 specification §11. The legacy WKT 1 pattern was:
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      isBaseCRS - true if parsing the CRS inside a DerivedCRS.
      Returns:
      the "EngineeringCRS" element as an EngineeringCRS object.
      Throws:
      ParseException - if the "EngineeringCRS" element cannot be parsed.
    • parseImageCRS

      private org.opengis.referencing.crs.ImageCRS parseImageCRS(int mode, Element parent) throws ParseException
      Parses an "ImageCRS" (WKT 2) element. The syntax is given by WKT 2 specification §12.
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      Returns:
      the "ImageCRS" element as an ImageCRS object.
      Throws:
      ParseException - if the "ImageCRS" element cannot be parsed.
    • parseGeodeticCRS

      private org.opengis.referencing.crs.SingleCRS parseGeodeticCRS(int mode, Element parent, int dimension, String csType) throws ParseException
      Parses a "GeodeticCRS" (WKT 2) element. The syntax is given by WKT 2 specification §8. The legacy WKT 1 specification had two elements for this: and
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      dimension - the minimal number of dimensions (usually 2).
      csType - the default coordinate system type, or null if unknown. Should be non-null only when parsing a GeneralDerivedCRS.getBaseCRS() component.
      Returns:
      the "GeodeticCRS" element as a GeographicCRS or GeocentricCRS object.
      Throws:
      ParseException - if the "GeodeticCRS" element cannot be parsed.
      See Also:
    • parseVerticalCRS

      private org.opengis.referencing.crs.SingleCRS parseVerticalCRS(int mode, Element parent, boolean isBaseCRS) throws ParseException
      Parses a "VerticalCRS" (WKT 2) element. The syntax is given by WKT 2 specification §10. The legacy WKT 1 pattern was:
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      isBaseCRS - true if parsing the CRS inside a DerivedCRS.
      Returns:
      the "VerticalCRS" element as a VerticalCRS object.
      Throws:
      ParseException - if the "VerticalCRS" element cannot be parsed.
    • parseTimeCRS

      private org.opengis.referencing.crs.SingleCRS parseTimeCRS(int mode, Element parent, boolean isBaseCRS) throws ParseException
      Parses "TimeCRS" element.
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      isBaseCRS - true if parsing the CRS inside a DerivedCRS.
      Returns:
      the "TimeCRS" element as a TemporalCRS object.
      Throws:
      ParseException - if the "TimeCRS" element cannot be parsed.
    • parseParametricCRS

      private org.opengis.referencing.crs.SingleCRS parseParametricCRS(int mode, Element parent, boolean isBaseCRS) throws ParseException
      Parses "ParametricCRS" element.
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      isBaseCRS - true if parsing the CRS inside a DerivedCRS.
      Returns:
      the "ParametricCRS" object.
      Throws:
      ParseException - if the "ParametricCRS" element cannot be parsed.
    • parseProjectedCRS

      private org.opengis.referencing.crs.ProjectedCRS parseProjectedCRS(int mode, Element parent, boolean isBaseCRS) throws ParseException
      Parses a "ProjectedCRS" (WKT 2) element. The syntax is given by WKT 2 specification §9. The legacy WKT 1 specification was:
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      isBaseCRS - true if parsing the CRS inside a DerivedCRS.
      Returns:
      the "ProjectedCRS" element as a ProjectedCRS object.
      Throws:
      ParseException - if the "ProjectedCRS" element cannot be parsed.
    • parseCompoundCRS

      private org.opengis.referencing.crs.CoordinateReferenceSystem parseCompoundCRS(int mode, Element parent) throws ParseException
      Parses a "CompoundCRS" element. The syntax is given by WKT 2 specification §16. The legacy WKT 1 specification was: In the particular case where there is a geographic CRS and an ellipsoidal height, this method rather build a three-dimensional geographic CRS.
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      Returns:
      the "CompoundCRS" element as a CompoundCRS object.
      Throws:
      ParseException - if the "CompoundCRS" element cannot be parsed.
    • parseFittedCS

      private org.opengis.referencing.crs.DerivedCRS parseFittedCS(int mode, Element parent) throws ParseException
      Parses a "FITTED_CS" element. This element has the following pattern:
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      Returns:
      the "FITTED_CS" element as a CompoundCRS object.
      Throws:
      ParseException - if the "COMPD_CS" element cannot be parsed.
    • parseGeogTranslation

      private org.opengis.referencing.operation.CoordinateOperation parseGeogTranslation(int mode, Element parent) throws ParseException
      Parses a "GeogTran" element. This is specific to ESRI.
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      Returns:
      the "GeogTran" element as a CoordinateOperation object.
      Throws:
      ParseException - if the "GeogTran" element cannot be parsed.
    • parseOperation

      private org.opengis.referencing.operation.CoordinateOperation parseOperation(int mode, Element parent) throws ParseException
      Parses a "CoordinateOperation" element. The syntax is given by WKT 2 specification §17.
      Parameters:
      mode - AbstractParser.FIRST, AbstractParser.OPTIONAL or AbstractParser.MANDATORY.
      parent - the parent element.
      Returns:
      the "CoordinateOperation" element as a CoordinateOperation object.
      Throws:
      ParseException - if the "CoordinateOperation" element cannot be parsed.
    • parseParametersAndClose

      private Map<String,Object> parseParametersAndClose(Element parent, String name, org.opengis.referencing.operation.OperationMethod method) throws ParseException
      Parses a sequence of "PARAMETER" elements, then parses optional metadata elements and close.
      Parameters:
      parent - the parent element.
      name - the name of the parent object being parsed.
      method - the operation method, also the fallback to use if name is empty.
      Returns:
      a properties map with the parent name, the optional authority code and the parameters.
      Throws:
      ParseException - if an element cannot be parsed.
      See Also:
    • getOperationFactory

      private DefaultCoordinateOperationFactory getOperationFactory()
      Returns the factory to use for creating coordinate operation.