org.geotoolkit.referencing.operation.projection
Class UnitaryProjection.Parameters

Object
  extended by AbstractMathTransform2D.Parameters
      extended by UnitaryProjection.Parameters
All Implemented Interfaces:
Serializable, Parameterized
Direct Known Subclasses:
ObliqueMercator.Parameters, TransverseMercator.Parameters
Enclosing class:
UnitaryProjection

protected static class UnitaryProjection.Parameters
extends AbstractMathTransform2D.Parameters

Parameters that determine the affine transforms to be applied before and after the UnitaryProjection. Most of those parameters are not used by the unitary projection itself, but a few ones like the standard parallels may be on a case-by-case basis.

The lifecycle of this object is as below:

  1. MapProjection.createMathTransform invokes the static create method of some appropriate UnitaryProjection subclass. For example both Mercator1SP and Mercator2SP invokes the same Mercator.create method, but with different descriptor.

  2. The static factory method creates a new instance of this Parameters class with the user-supplied ParameterValueGroup. This have the effect of decoding the parameters in the given group and store their values in the corresponding Parameters fields. The parameters are then given to the class constructor.

  3. The constructor at step 2 is free to modify the value of any field contained in the Parameters instance it got in argument. The most typical use cases are to multiply the scale factor by some value inferred from the standard parallels, and to restrict the central meridian to the middle of a UTM or MTM zone.

  4. When every fields have their final values, the constructor at steps 2-3 must invoke validate(). At this point, the scalar values in Parameters should not be modified anymore. However the constructor is free to apply additional operations on the two affine transforms (normalize/denormalize) after validate() has been invoked.

  5. Once the execution point returned to MapProjection, the affine transforms are marked as immutable and concatenated in that order: normalize(true), <the transform created at step 2>, normalize(false). The Parameters instance is saved for Well Known Text formatting, but is not used in the transformation chain.

All angles in this class (either fields, method parameters or return values) are in decimal degrees. This is the opposite of UnitaryProjection where all angles are in radians.
Note: Serialization of this class is appropriate for short-term storage or RMI use, but may not be compatible with future versions. For long term storage, WKT (Well Know Text) or XML are more appropriate.

Since:
3.00
Version:
3.00
Author:
Martin Desruisseaux (Geomatys)
See Also:
Serialized Form
Module:
referencing/geotk-referencing (download)    View source code for this class

Field Summary
 double azimuth
          The azimuth of the central line passing through the centre of the projection, in degrees.
 double centralMeridian
          Central longitude in degrees.
 double falseEasting
          False easting, in metres.
 double falseNorthing
          False northing, in metres.
 double latitudeOfOrigin
          Latitude of origin in degrees.
 double scaleFactor
          The scale factor.
 double semiMajor
          Length of semi-major axis, in metres.
 double semiMinor
          Length of semi-minor axis, in metres.
 double[] standardParallels
          The standard parallels, or an empty array if there is none.
 
Constructor Summary
UnitaryProjection.Parameters(ParameterDescriptorGroup descriptor, ParameterValueGroup values)
          Creates parameters initialized to values extracted from the given parameter group.
 
Method Summary
 boolean equals(Object object)
          Compares the given object with the parameters for equality.
 ParameterValueGroup getParameterValues()
          Returns a group of parameters initialized to the values contained in this object.
 int hashCode()
          Returns a hash code value for this object.
 void validate()
          Sets the normalize/denormalize affine transforms to the values contained in this object.
 
Methods inherited from class AbstractMathTransform2D.Parameters
createConcatenatedTransform, getParameterDescriptors, normalize, toString
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

semiMajor

public final double semiMajor
Length of semi-major axis, in metres. This is named a or R (Radius in spherical cases) in Snyder.

See Also:
MapProjection.SEMI_MAJOR, UnitaryProjection.excentricity

semiMinor

public final double semiMinor
Length of semi-minor axis, in metres. This is named b in Snyder.

See Also:
MapProjection.SEMI_MINOR, UnitaryProjection.excentricity

centralMeridian

public double centralMeridian
Central longitude in degrees. Default value is 0, the Greenwich meridian. This is named λ0 in Snyder.


latitudeOfOrigin

public double latitudeOfOrigin
Latitude of origin in degrees. Default value is 0, the equator. This is named phi0 in Snyder.


standardParallels

public final double[] standardParallels
The standard parallels, or an empty array if there is none. There is typically no more than 2 standard parallels.


azimuth

public double azimuth
The azimuth of the central line passing through the centre of the projection, in degrees. This is 0° for most projections.


scaleFactor

public double scaleFactor
The scale factor. Default value is 1. This is named k in Snyder.


falseEasting

public double falseEasting
False easting, in metres. Default value is 0.


falseNorthing

public double falseNorthing
False northing, in metres. Default value is 0.

Constructor Detail

UnitaryProjection.Parameters

public UnitaryProjection.Parameters(ParameterDescriptorGroup descriptor,
                                    ParameterValueGroup values)
                             throws ParameterNotFoundException
Creates parameters initialized to values extracted from the given parameter group. The following parameters are recognized:

Constructors of UnitaryProjection subclasses must invoke the validate() method when all parameters (especially the central meridian and scale factor) are assigned their final value.

Parameters:
descriptor - The descriptor of parameters that are legal for the projection being constructed. In theory it should be the same than values.descriptors(), but projection providers should give explicitly the expected descriptors for safety.
values - The parameter values in standard units.
Throws:
ParameterNotFoundException - if a mandatory parameter is missing.
Method Detail

validate

public void validate()
              throws IllegalArgumentException
Sets the normalize/denormalize affine transforms to the values contained in this object. They are the transforms to be applied before and after UnitaryProjection respectively.

The default implementation defines those affine transforms as if they were performing the following steps, in that order:

The normalize/denormalize affine are usually identity transforms before this method is invoked. If they were not, the above operations will be concatenated to their current state.

Throws:
IllegalArgumentException - if a field has an illegal value.

getParameterValues

public ParameterValueGroup getParameterValues()
Returns a group of parameters initialized to the values contained in this object. Changes to the returned parameters will not affect this object.

Specified by:
getParameterValues in interface Parameterized
Specified by:
getParameterValues in class AbstractMathTransform2D.Parameters
Returns:
A copy of the parameter values.
See Also:
SingleOperation.getParameterValues()

hashCode

public int hashCode()
Returns a hash code value for this object. This value is implementation-dependent and may change in any future version.

Overrides:
hashCode in class AbstractMathTransform2D.Parameters

equals

public boolean equals(Object object)
Compares the given object with the parameters for equality.

Overrides:
equals in class AbstractMathTransform2D.Parameters
Parameters:
object - The object to compare with the parameters.
Returns:
true if the given object is equal to this one.


Copyright © 2009-2011 Geotoolkit.org. All Rights Reserved.