Class VerticalInfo

java.lang.Object
org.apache.sis.io.wkt.VerticalInfo

final class VerticalInfo extends Object
Stores temporary information needed for completing the construction of an DefaultVerticalExtent instance. WKT of vertical extents looks like: But DefaultVerticalExtent has no unit property. Instead, DefaultVerticalExtent has a verticalCRS property. The WKT specification said that heights are positive toward up and relative to an unspecified mean sea level, but we will try to use the parsed vertical CRS instance if we find a suitable one (i.e. one that defines gravity-related heights or depths), on the assumption that the vertical extent is likely to be defined in the same vertical CRS.

This class can be understood as the converse of Extents.getVerticalRange(org.opengis.metadata.extent.Extent)

Since:
0.6
Version:
0.6
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private org.opengis.referencing.crs.VerticalCRS
    If a vertical CRS could be used pending only a change of units, that CRS.
    private final DefaultVerticalExtent
    The vertical extent pending completion.
    private VerticalInfo
    The next instance to resolve.
    (package private) final javax.measure.Unit<javax.measure.quantity.Length>
    The unit specified in the VERTICALEXTENT WKT element.
  • Constructor Summary

    Constructors
    Constructor
    Description
    VerticalInfo(VerticalInfo next, DefaultExtent extents, double minimum, double maximum, javax.measure.Unit<javax.measure.quantity.Length> unit)
    Adds to the chained list a new DefaultVerticalExtent instance pending completion.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) final VerticalInfo
    complete(org.opengis.referencing.crs.CRSFactory crsFactory, org.opengis.referencing.cs.CSFactory csFactory)
    Completes the extent with a new CRS using the units specified at construction time.
    private static Map<String,?>
    Convenience method for creating the map of properties to give to the factory method.
    (package private) final VerticalInfo
    resolve(org.opengis.referencing.crs.VerticalCRS crs)
    If the pending DefaultVerticalExtent can use the given CRS, completes the extent now.
    private VerticalInfo
    resolve(org.opengis.referencing.crs.VerticalCRS crs, org.opengis.referencing.cs.CoordinateSystemAxis axis)
    Implementation of resolve(VerticalCRS, CoordinateSystemAxis) to be invoked recursively, after we checked the datum type and fetched the axis once for all.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • next

      private VerticalInfo next
      The next instance to resolve. This form a chained list.
    • extent

      private final DefaultVerticalExtent extent
      The vertical extent pending completion.
    • unit

      final javax.measure.Unit<javax.measure.quantity.Length> unit
      The unit specified in the VERTICALEXTENT WKT element.
    • compatibleCRS

      private org.opengis.referencing.crs.VerticalCRS compatibleCRS
      If a vertical CRS could be used pending only a change of units, that CRS. Otherwise null.
  • Constructor Details

    • VerticalInfo

      VerticalInfo(VerticalInfo next, DefaultExtent extents, double minimum, double maximum, javax.measure.Unit<javax.measure.quantity.Length> unit)
      Adds to the chained list a new DefaultVerticalExtent instance pending completion.
      Parameters:
      next - the existing VerticalInfo instance. Will become the next instance to process after this in a chain of VerticalInfo.
      extents - where to add the vertical extent.
      unit - the unit to assign to the extent. Cannot be null.
  • Method Details

    • resolve

      final VerticalInfo resolve(org.opengis.referencing.crs.VerticalCRS crs)
      If the pending DefaultVerticalExtent can use the given CRS, completes the extent now. This method invokes DefaultVerticalExtent.setVerticalCRS(VerticalCRS) with the given CRS if:
      • datum type is VerticalDatumType.GEOIDAL,
      • increasing height values are up, and
      • axis unit of measurement is the given linear unit.
      This method processes also all other VerticalInfo instances in the chained list.
      Returns:
      the new head of the chained list (may be this), or null if the list became empty as a result of this operation.
    • resolve

      private VerticalInfo resolve(org.opengis.referencing.crs.VerticalCRS crs, org.opengis.referencing.cs.CoordinateSystemAxis axis)
      Implementation of resolve(VerticalCRS, CoordinateSystemAxis) to be invoked recursively, after we checked the datum type and fetched the axis once for all.
    • complete

      final VerticalInfo complete(org.opengis.referencing.crs.CRSFactory crsFactory, org.opengis.referencing.cs.CSFactory csFactory) throws org.opengis.util.FactoryException
      Completes the extent with a new CRS using the units specified at construction time. The CRS created by this method is implementation-dependent. The only guarantees are:
      • datum type is VerticalDatumType.GEOIDAL,
      • increasing height values are up, and
      • axis unit of measurement is the given linear unit.
      If this method cannot propose a suitable CRS, then it returns this.
      Throws:
      org.opengis.util.FactoryException
    • properties

      private static Map<String,?> properties(Object name)
      Convenience method for creating the map of properties to give to the factory method.