Class MapProjection

All Implemented Interfaces:
Serializable, Formattable, MathTransformProvider, Deprecable, LenientComparable, org.opengis.referencing.IdentifiedObject, org.opengis.referencing.operation.OperationMethod
Direct Known Subclasses:
AlbersEqualArea, AzimuthalEquidistantSpherical, CassiniSoldner, LambertAzimuthalEqualArea, LambertConformal1SP, LambertConformal2SP, LambertConformalBelgium, LambertConformalMichigan, LambertConformalWest, LambertCylindricalEqualArea, LambertCylindricalEqualAreaSpherical, Mercator1SP, Mercator2SP, MercatorAuxiliarySphere, MercatorSpherical, MillerCylindrical, ModifiedAzimuthalEquidistant, Mollweide, ObliqueMercator, ObliqueStereographic, Orthographic, PolarStereographicA, PolarStereographicB, PolarStereographicC, PolarStereographicNorth, PolarStereographicSouth, Polyconic, PseudoMercator, RegionalMercator, SatelliteTracking, Sinusoidal, TransverseMercator, TransverseMercatorSouth

public abstract class MapProjection extends AbstractProvider
Base class for most two-dimensional map projection providers defined in this package. This base class defines some descriptors for the most commonly used parameters. Subclasses will declare additional parameters and group them in a descriptor group named PARAMETERS.
Since:
0.6
Version:
1.3
Author:
Martin Desruisseaux (Geomatys)
See Also:
  • Field Details

    • SEMI_MAJOR

      public static final DefaultParameterDescriptor<Double> SEMI_MAJOR
      All names known to Apache SIS for the semi-major parameter. This parameter is mandatory and has no default value. The range of valid values is (0 … ∞).

      Some names for this parameter are "semi_major", "SemiMajorAxis" and "a".

      Parameter names
      OGC: semi_major
      ESRI: Semi_Major
      NetCDF: semi_major_axis
      GeoTIFF: SemiMajorAxis
      Proj4: a
      Notes:
      • Value domain: (0.0 … ∞) m
      • No default value
    • SEMI_MINOR

      public static final DefaultParameterDescriptor<Double> SEMI_MINOR
      All names known to Apache SIS for the semi-minor parameter. This parameter is mandatory and has no default value. The range of valid values is (0 … ∞).

      Some names for this parameter are "semi_minor", "SemiMinorAxis" and "b".

      Parameter names
      OGC: semi_minor
      ESRI: Semi_Minor
      NetCDF: semi_minor_axis
      GeoTIFF: SemiMinorAxis
      Proj4: b
      Notes:
      • Value domain: (0.0 … ∞) m
      • No default value
    • ECCENTRICITY

      public static final DefaultParameterDescriptor<Double> ECCENTRICITY
      The ellipsoid eccentricity, computed from the semi-major and semi-minor axis lengths. This a SIS-specific parameter.
      Parameter names
      SIS: eccentricity
      Notes:
      • Value domain: [0.0 … 1.0]
      • No default value
  • Constructor Details

    • MapProjection

      protected MapProjection(Class<? extends org.opengis.referencing.operation.Projection> operationType, org.opengis.parameter.ParameterDescriptorGroup parameters)
      Constructs a math transform provider from a set of parameters. The provider identifiers will be the same than the parameter ones.
      Parameters:
      operationType - interface of the CoordinateOperation instances that use this projection.
      parameters - the set of parameters (never null).
  • Method Details

    • redimension

      @Deprecated public final org.opengis.referencing.operation.OperationMethod redimension(int sourceDimensions, int targetDimensions)
      Deprecated.
      ISO 19111:2019 removed source/target dimensions attributes.
      Returns this operation method with the specified number of dimensions. The number of dimensions can be only 2 or 3, and must be the same for source and target CRS.
      Overrides:
      redimension in class DefaultOperationMethod
      Parameters:
      sourceDimensions - the desired number of input dimensions.
      targetDimensions - the desired number of output dimensions.
      Returns:
      the redimensioned projection method, or this if no change is needed.
      Since:
      0.8
    • validate

      public static void validate(org.opengis.parameter.ParameterDescriptor<? extends Number> descriptor, double value) throws IllegalArgumentException
      Validates the given parameter value. This method duplicates the verification already done by DefaultParameterValue.setValue(Object, Unit). But we check again because we have no guarantee that the parameters given by the user were instances of DefaultParameterValue, or that the descriptor associated to the user-specified ParameterValue has sufficient information.
      Parameters:
      descriptor - the descriptor that specify the parameter to validate.
      value - the parameter value in the units given by the descriptor.
      Throws:
      IllegalArgumentException - if the given value is out of bounds.
      See Also:
      • AbstractProvider.createZeroConstant(ParameterBuilder)
    • createMathTransform

      public final org.opengis.referencing.operation.MathTransform createMathTransform(org.opengis.referencing.operation.MathTransformFactory factory, org.opengis.parameter.ParameterValueGroup parameters) throws org.opengis.parameter.ParameterNotFoundException, org.opengis.util.FactoryException
      Creates a map projection from the specified group of parameter values.
      Parameters:
      factory - the factory to use for creating and concatenating the (de)normalization transforms.
      parameters - the group of parameter values.
      Returns:
      the map projection created from the given parameter values.
      Throws:
      org.opengis.parameter.ParameterNotFoundException - if a required parameter was not found.
      org.opengis.util.FactoryException - if the map projection cannot be created.
    • createProjection

      protected abstract NormalizedProjection createProjection(Parameters parameters) throws org.opengis.parameter.ParameterNotFoundException
      Creates a map projection on an ellipsoid having a semi-major axis length of 1.
      Parameters:
      parameters - the group of parameter values.
      Returns:
      the map projection created from the given parameter values.
      Throws:
      org.opengis.parameter.ParameterNotFoundException - if a required parameter was not found.