org.deegree_impl.model.cs
Class Projection

java.lang.Object
  extended byorg.deegree_impl.model.cs.Info
      extended byorg.deegree_impl.model.cs.Projection
All Implemented Interfaces:
java.io.Serializable

public class Projection
extends Info

A projection from geographic coordinates to projected coordinates.

Version:
1.00
Author:
OpenGIS (www.opengis.org), Martin Desruisseaux
See Also:
CS_Projection, Serialized Form

Nested Class Summary
private  class Projection.Export
          Wrap a Projection object for use with OpenGIS.
 
Nested classes inherited from class org.deegree_impl.model.cs.Info
Info.AngularUnit, Info.LinearUnit
 
Field Summary
private  java.lang.String classification
          Classification string for projection (e.g.
private  ParameterList parameters
          Parameters to use for projection, in metres or degrees.
private static long serialVersionUID
          Serial number for interoperability with different versions.
 
Fields inherited from class org.deegree_impl.model.cs.Info
pool
 
Constructor Summary
(package private) Projection(java.util.Map properties, java.lang.String classification, ParameterList parameters)
          Creates a projection.
  Projection(java.lang.String name, java.lang.String classification, Ellipsoid ellipsoid, java.awt.geom.Point2D centre, java.awt.geom.Point2D translation, double scaleFactor)
          Convenience constructor for a projection using the specified ellipsoid.
  Projection(java.lang.String name, java.lang.String classification, ParameterList parameters)
          Creates a projection.
 
Method Summary
(package private)  java.lang.String addString(java.lang.StringBuffer buffer)
          Fill the part inside "[...]".
private static ParameterList clone(ParameterList list)
          Returns a clone of a parameter list.
 boolean equals(java.lang.Object object)
          Compares the specified object with this projection for equality.
 java.lang.String getClassName()
          Gets the projection classification name (e.g.
(package private) static ParameterList getParameterList(java.lang.String classification)
          Returns a parameter list for the specified classification.
 ParameterList getParameters()
          Returns all parameters.
private static double getValue(ParameterList parameters, java.lang.String name, double defaultValue, boolean required)
          Convenience method for fetching a parameter value.
 double getValue(java.lang.String name)
          Convenience method for fetching a parameter value.
 double getValue(java.lang.String name, double defaultValue)
          Convenience method for fetching a parameter value.
 int hashCode()
          Returns a hash value for this projection.
(package private) static ParameterList init(ParameterList parameters, Ellipsoid ellipsoid, java.awt.geom.Point2D centre, java.awt.geom.Point2D translation, double scaleFactor)
          Initialize a list of parameter from the specified ellipsoid and points.
(package private)  java.lang.Object toOpenGIS(java.lang.Object adapters)
          Returns an OpenGIS interface for this projection.
 
Methods inherited from class org.deegree_impl.model.cs.Info
addUnit, cachedOpenGIS, ensureAngularUnit, ensureLinearUnit, ensureNonNull, ensureNonNull, ensureTimeUnit, getAbbreviation, getAlias, getAuthority, getAuthorityCode, getName, getRemarks, readResolve, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial number for interoperability with different versions.

See Also:
Constant Field Values

classification

private final java.lang.String classification
Classification string for projection (e.g. "Transverse_Mercator").


parameters

private final ParameterList parameters
Parameters to use for projection, in metres or degrees.

Constructor Detail

Projection

public Projection(java.lang.String name,
                  java.lang.String classification,
                  Ellipsoid ellipsoid,
                  java.awt.geom.Point2D centre,
                  java.awt.geom.Point2D translation,
                  double scaleFactor)
Convenience constructor for a projection using the specified ellipsoid.

Parameters:
name - Name to give new object.
classification - Classification string for projection (e.g. "Transverse_Mercator").
ellipsoid - Ellipsoid parameter. If non-null, then "semi_major" and "semi_minor" parameters will be set according.
centre - Central meridian and latitude of origin, in degrees. If non-null, then "central_meridian" and "latitude_of_origin" will be set according.
translation - False easting and northing, in metres. If non-null, then "false_easting" and "false_northing" will be set according.

Projection

public Projection(java.lang.String name,
                  java.lang.String classification,
                  ParameterList parameters)
Creates a projection. The set of parameters (parameters) may be queried with MathTransformFactory.getMathTransformProvider(classification).getParameterList().

Parameters:
name - Name to give new object.
classification - Classification string for projection (e.g. "Transverse_Mercator").
parameters - Parameters to use for projection, in metres or degrees.

Projection

Projection(java.util.Map properties,
           java.lang.String classification,
           ParameterList parameters)
Creates a projection.

Parameters:
properties - The set of properties (see Info).
classification - Classification string for projection (e.g. "Transverse_Mercator").
parameters - Parameters to use for projection, in metres or degrees.
Method Detail

getParameterList

static ParameterList getParameterList(java.lang.String classification)
Returns a parameter list for the specified classification. If there is no special parameter descriptor for the specified classification, then a default descriptor is used.


init

static ParameterList init(ParameterList parameters,
                          Ellipsoid ellipsoid,
                          java.awt.geom.Point2D centre,
                          java.awt.geom.Point2D translation,
                          double scaleFactor)
Initialize a list of parameter from the specified ellipsoid and points.

Parameters:
parameters - The parameters to initialize.
ellipsoid - Ellipsoid parameter. If non-null, then "semi_major" and "semi_minor" parameters will be set according.
centre - Central meridian and latitude of origin, in degrees. If non-null, then "central_meridian" and "latitude_of_origin" will be set according.
translation - False easting and northing, in metres. If non-null, then "false_easting" and "false_northing" will be set according.
Returns:
parameters for convenience.

clone

private static ParameterList clone(ParameterList list)
Returns a clone of a parameter list.


getClassName

public java.lang.String getClassName()
Gets the projection classification name (e.g. "Transverse_Mercator").

See Also:
CS_Projection.getClassName()

getParameters

public ParameterList getParameters()
Returns all parameters.

See Also:
CS_Projection.getNumParameters(), CS_Projection.getParameter(int)

getValue

public double getValue(java.lang.String name)
                throws MissingParameterException
Convenience method for fetching a parameter value. Search is case-insensitive and ignore leading and trailing blanks.

Parameters:
name - Parameter to look for.
Returns:
The parameter value.
Throws:
MissingParameterException - if parameter name is not found.

getValue

public double getValue(java.lang.String name,
                       double defaultValue)
Convenience method for fetching a parameter value. Search is case-insensitive and ignore leading and trailing blanks.

Parameters:
name - Parameter to look for.
defaultValue - Default value to return if parameter name is not found.
Returns:
The parameter value, or defaultValue if the parameter name is not found.

getValue

private static double getValue(ParameterList parameters,
                               java.lang.String name,
                               double defaultValue,
                               boolean required)
                        throws MissingParameterException
Convenience method for fetching a parameter value. Search is case-insensitive and ignore leading and trailing blanks.

Parameters:
parameters - User-suplied parameters.
name - Parameter to look for.
defaultValue - Default value to return if parameter name is not found.
required - true if the parameter is required (in which case defaultValue is ignored), or false otherwise.
Returns:
The parameter value, or defaultValue if the parameter is not found and required is false.
Throws:
MissingParameterException - if required is true and parameter name is not found.

hashCode

public int hashCode()
Returns a hash value for this projection.

Overrides:
hashCode in class Info

equals

public boolean equals(java.lang.Object object)
Compares the specified object with this projection for equality.

Overrides:
equals in class Info

addString

java.lang.String addString(java.lang.StringBuffer buffer)
Fill the part inside "[...]". Used for formatting Well Know Text (WKT).

Overrides:
addString in class Info
Parameters:
buffer - The buffer to add string to.
Returns:
The WKT code name (e.g. "GEOGCS").

toOpenGIS

final java.lang.Object toOpenGIS(java.lang.Object adapters)
Returns an OpenGIS interface for this projection. The returned object is suitable for RMI use. Note: The returned type is a generic Object in order to avoid too early class loading of OpenGIS interface.

Overrides:
toOpenGIS in class Info