/*
* Geotoolkit.org - An Open Source Java GIS Toolkit
* http://www.geotoolkit.org
*
* (C) 1999-2012, Open Source Geospatial Foundation (OSGeo)
* (C) 2009-2012, Geomatys
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package org.geotoolkit.referencing.operation.provider;
import org.opengis.metadata.citation.Citation;
import org.opengis.parameter.ParameterValueGroup;
import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.ParameterDescriptorGroup;
import org.opengis.metadata.Identifier;
import org.opengis.referencing.operation.MathTransform2D;
import org.opengis.referencing.operation.MathTransformFactory;
import org.opengis.referencing.operation.PlanarProjection;
import org.geotoolkit.resources.Vocabulary;
import org.apache.sis.referencing.NamedIdentifier;
import org.geotoolkit.metadata.Citations;
/**
* The provider for "<cite>Stereographic</cite>" projections using USGS equations.
* This is <strong>not</strong> the provider for EPSG:9809.
* For the later, use the Apache SIS {@code ObliqueStereographic} instead.
*
* <!-- PARAMETERS Stereographic -->
* <p>The following table summarizes the parameters recognized by this provider.
* For a more detailed parameter list, see the {@link #PARAMETERS} constant.</p>
* <blockquote><p><b>Operation name:</b> {@code Stereographic}</p>
* <table class="geotk">
* <tr><th>Parameter name</th><th>Default value</th></tr>
* <tr><td>{@code semi_major}</td><td></td></tr>
* <tr><td>{@code semi_minor}</td><td></td></tr>
* <tr><td>{@code central_meridian}</td><td>0°</td></tr>
* <tr><td>{@code latitude_of_origin}</td><td>0°</td></tr>
* <tr><td>{@code scale_factor}</td><td>1</td></tr>
* <tr><td>{@code false_easting}</td><td>0 metres</td></tr>
* <tr><td>{@code false_northing}</td><td>0 metres</td></tr>
* </table></blockquote>
* <!-- END OF PARAMETERS -->
*
* @author Rueben Schulz (UBC)
* @author Martin Desruisseaux (Geomatys)
*/
public class Stereographic extends MapProjection {
/**
* For compatibility with different versions during deserialization.
*/
private static final long serialVersionUID = 1243300263948365065L;
/**
* The operation parameter descriptor for the {@linkplain
* org.geotoolkit.referencing.operation.projection.UnitaryProjection.Parameters#centralMeridian
* central meridian} parameter value.
*
* This parameter is <a href="package-summary.html#Obligation">mandatory</a>.
* Valid values range is [-180 … 180]° and default value is 0°.
*/
public static final ParameterDescriptor<Double> CENTRAL_MERIDIAN;
/**
* The operation parameter descriptor for the {@linkplain
* org.geotoolkit.referencing.operation.projection.UnitaryProjection.Parameters#latitudeOfOrigin
* latitude of origin} parameter value.
*
* This parameter is <a href="package-summary.html#Obligation">mandatory</a>.
* Valid values range is [-90 … 90]° and default value is 0°.
*/
public static final ParameterDescriptor<Double> LATITUDE_OF_ORIGIN;
/**
* The operation parameter descriptor for the {@linkplain
* org.geotoolkit.referencing.operation.projection.UnitaryProjection.Parameters#scaleFactor
* scale factor} parameter value.
*
* This parameter is <a href="package-summary.html#Obligation">optional</a> as in
* <cite>remotesensing.org</cite>. Valid values range is (0 … ∞) and
* default value is 1.
*/
public static final ParameterDescriptor<Double> SCALE_FACTOR;
/**
* The operation parameter descriptor for the {@linkplain
* org.geotoolkit.referencing.operation.projection.UnitaryProjection.Parameters#falseEasting
* false easting} parameter value.
*
* This parameter is <a href="package-summary.html#Obligation">mandatory</a>.
* Valid values range is unrestricted and default value is 0 metre.
*/
public static final ParameterDescriptor<Double> FALSE_EASTING;
/**
* The operation parameter descriptor for the {@linkplain
* org.geotoolkit.referencing.operation.projection.UnitaryProjection.Parameters#falseNorthing
* false northing} parameter value.
*
* This parameter is <a href="package-summary.html#Obligation">mandatory</a>.
* Valid values range is unrestricted and default value is 0 metre.
*/
public static final ParameterDescriptor<Double> FALSE_NORTHING;
/**
* Parameters creation, which must be done before to initialize the {@link #PARAMETERS} field.
*/
static {
CENTRAL_MERIDIAN = UniversalParameters.CENTRAL_MERIDIAN.select(null,
"Longitude of natural origin", // EPSG
"central_meridian", // OGC
"Central_Meridian", // ESRI
"longitude_of_projection_origin", // NetCDF
"ProjCenterLong"); // GeoTIFF
LATITUDE_OF_ORIGIN = UniversalParameters.LATITUDE_OF_ORIGIN.select(null,
"Latitude of natural origin", // EPSG
"latitude_of_origin", // OGC
"Latitude_Of_Origin", // ESRI
"ProjCenterLat"); // GeoTIFF
SCALE_FACTOR = UniversalParameters.SCALE_FACTOR.select(false, null, null, null,
"Scale factor at natural origin", // EPSG
"scale_factor_at_projection_origin", // NetCDF
"ScaleAtNatOrigin"); // GeoTIFF
FALSE_EASTING = Orthographic.FALSE_EASTING;
FALSE_NORTHING = Orthographic.FALSE_NORTHING;
}
/**
* The group of all parameters expected by this coordinate operation.
* The following table lists the operation names and the parameters recognized by Geotk.
* Note that at the opposite of most other map projections, the <cite>Scale factor</cite>
* parameter in this group is <a href="package-summary.html#Obligation">optional</a>,
* as documented in the <cite>remotesensing.org</cite> web site.
* <p>
* <!-- GENERATED PARAMETERS - inserted by ProjectionParametersJavadoc -->
* <table class="geotk" border="1">
* <tr><th colspan="2">
* <table class="compact">
* <tr><td><b>Name:</b></td><td class="onright"><code>OGC</code>:</td><td class="onleft"><code>Stereographic</code></td></tr>
* <tr><td><b>Alias:</b></td><td class="onright"><code>ESRI</code>:</td><td class="onleft"><code>Stereographic</code></td></tr>
* <tr><td></td><td class="onright"><code>NetCDF</code>:</td><td class="onleft"><code>Stereographic</code></td></tr>
* <tr><td></td><td class="onright"><code>GeoTIFF</code>:</td><td class="onleft"><code>CT_Stereographic</code></td></tr>
* <tr><td></td><td class="onright"><code>PROJ4</code>:</td><td class="onleft"><code>stere</code></td></tr>
* <tr><td></td><td class="onright"><code>Geotk</code>:</td><td class="onleft"><code>Stereographic projection</code></td></tr>
* <tr><td><b>Identifier:</b></td><td class="onright"><code>GeoTIFF</code>:</td><td class="onleft"><code>14</code></td></tr>
* </table>
* </th></tr>
* <tr><td>
* <table class="compact">
* <tr><td><b>Name:</b></td><td class="onright"><code>OGC</code>:</td><td class="onleft"><code>semi_major</code></td></tr>
* <tr><td><b>Alias:</b></td><td class="onright"><code>ESRI</code>:</td><td class="onleft"><code>Semi_Major</code></td></tr>
* <tr><td></td><td class="onright"><code>NetCDF</code>:</td><td class="onleft"><code>semi_major_axis</code></td></tr>
* <tr><td></td><td class="onright"><code>GeoTIFF</code>:</td><td class="onleft"><code>SemiMajor</code></td></tr>
* <tr><td></td><td class="onright"><code>PROJ4</code>:</td><td class="onleft"><code>a</code></td></tr>
* </table>
* </td><td>
* <table class="compact">
* <tr><td><b>Type:</b></td><td>{@code Double}</td></tr>
* <tr><td><b>Obligation:</b></td><td>mandatory</td></tr>
* <tr><td><b>Value range:</b></td><td>[0…∞) metres</td></tr>
* </table>
* </td></tr>
* <tr><td>
* <table class="compact">
* <tr><td><b>Name:</b></td><td class="onright"><code>OGC</code>:</td><td class="onleft"><code>semi_minor</code></td></tr>
* <tr><td><b>Alias:</b></td><td class="onright"><code>ESRI</code>:</td><td class="onleft"><code>Semi_Minor</code></td></tr>
* <tr><td></td><td class="onright"><code>NetCDF</code>:</td><td class="onleft"><code>semi_minor_axis</code></td></tr>
* <tr><td></td><td class="onright"><code>GeoTIFF</code>:</td><td class="onleft"><code>SemiMinor</code></td></tr>
* <tr><td></td><td class="onright"><code>PROJ4</code>:</td><td class="onleft"><code>b</code></td></tr>
* </table>
* </td><td>
* <table class="compact">
* <tr><td><b>Type:</b></td><td>{@code Double}</td></tr>
* <tr><td><b>Obligation:</b></td><td>mandatory</td></tr>
* <tr><td><b>Value range:</b></td><td>[0…∞) metres</td></tr>
* </table>
* </td></tr>
* <tr><td>
* <table class="compact">
* <tr><td><b>Type:</b></td><td>{@code Boolean}</td></tr>
* <tr><td><b>Obligation:</b></td><td>optional</td></tr>
* <tr><td><b>Default value:</b></td><td>false</td></tr>
* </table>
* </td></tr>
* <tr><td>
* <table class="compact">
* <tr><td><b>Name:</b></td><td class="onright"><code>OGC</code>:</td><td class="onleft"><code>central_meridian</code></td></tr>
* <tr><td><b>Alias:</b></td><td class="onright"><code>ESRI</code>:</td><td class="onleft"><code>Central_Meridian</code></td></tr>
* <tr><td></td><td class="onright"><code>NetCDF</code>:</td><td class="onleft"><code>longitude_of_projection_origin</code></td></tr>
* <tr><td></td><td class="onright"><code>GeoTIFF</code>:</td><td class="onleft"><code>ProjCenterLong</code></td></tr>
* <tr><td></td><td class="onright"><code>PROJ4</code>:</td><td class="onleft"><code>lon_0</code></td></tr>
* </table>
* </td><td>
* <table class="compact">
* <tr><td><b>Type:</b></td><td>{@code Double}</td></tr>
* <tr><td><b>Obligation:</b></td><td>mandatory</td></tr>
* <tr><td><b>Value range:</b></td><td>[-180 … 180]°</td></tr>
* <tr><td><b>Default value:</b></td><td>0°</td></tr>
* </table>
* </td></tr>
* <tr><td>
* <table class="compact">
* <tr><td><b>Name:</b></td><td class="onright"><code>OGC</code>:</td><td class="onleft"><code>latitude_of_origin</code></td></tr>
* <tr><td><b>Alias:</b></td><td class="onright"><code>ESRI</code>:</td><td class="onleft"><code>Latitude_Of_Origin</code></td></tr>
* <tr><td></td><td class="onright"><code>NetCDF</code>:</td><td class="onleft"><code>latitude_of_projection_origin</code></td></tr>
* <tr><td></td><td class="onright"><code>GeoTIFF</code>:</td><td class="onleft"><code>ProjCenterLat</code></td></tr>
* <tr><td></td><td class="onright"><code>PROJ4</code>:</td><td class="onleft"><code>lat_0</code></td></tr>
* </table>
* </td><td>
* <table class="compact">
* <tr><td><b>Type:</b></td><td>{@code Double}</td></tr>
* <tr><td><b>Obligation:</b></td><td>mandatory</td></tr>
* <tr><td><b>Value range:</b></td><td>[-90 … 90]°</td></tr>
* <tr><td><b>Default value:</b></td><td>0°</td></tr>
* </table>
* </td></tr>
* <tr><td>
* <table class="compact">
* <tr><td><b>Name:</b></td><td class="onright"><code>OGC</code>:</td><td class="onleft"><code>scale_factor</code></td></tr>
* <tr><td><b>Alias:</b></td><td class="onright"><code>ESRI</code>:</td><td class="onleft"><code>Scale_Factor</code></td></tr>
* <tr><td></td><td class="onright"><code>NetCDF</code>:</td><td class="onleft"><code>scale_factor_at_projection_origin</code></td></tr>
* <tr><td></td><td class="onright"><code>GeoTIFF</code>:</td><td class="onleft"><code>ScaleAtNatOrigin</code></td></tr>
* <tr><td></td><td class="onright"><code>PROJ4</code>:</td><td class="onleft"><code>k</code></td></tr>
* </table>
* </td><td>
* <table class="compact">
* <tr><td><b>Type:</b></td><td>{@code Double}</td></tr>
* <tr><td><b>Obligation:</b></td><td>optional</td></tr>
* <tr><td><b>Value range:</b></td><td>[0…∞)</td></tr>
* <tr><td><b>Default value:</b></td><td>1</td></tr>
* </table>
* </td></tr>
* <tr><td>
* <table class="compact">
* <tr><td><b>Name:</b></td><td class="onright"><code>OGC</code>:</td><td class="onleft"><code>false_easting</code></td></tr>
* <tr><td><b>Alias:</b></td><td class="onright"><code>ESRI</code>:</td><td class="onleft"><code>False_Easting</code></td></tr>
* <tr><td></td><td class="onright"><code>NetCDF</code>:</td><td class="onleft"><code>false_easting</code></td></tr>
* <tr><td></td><td class="onright"><code>GeoTIFF</code>:</td><td class="onleft"><code>FalseEasting</code></td></tr>
* <tr><td></td><td class="onright"><code>PROJ4</code>:</td><td class="onleft"><code>x_0</code></td></tr>
* </table>
* </td><td>
* <table class="compact">
* <tr><td><b>Type:</b></td><td>{@code Double}</td></tr>
* <tr><td><b>Obligation:</b></td><td>mandatory</td></tr>
* <tr><td><b>Value range:</b></td><td>(-∞ … ∞) metres</td></tr>
* <tr><td><b>Default value:</b></td><td>0 metres</td></tr>
* </table>
* </td></tr>
* <tr><td>
* <table class="compact">
* <tr><td><b>Name:</b></td><td class="onright"><code>OGC</code>:</td><td class="onleft"><code>false_northing</code></td></tr>
* <tr><td><b>Alias:</b></td><td class="onright"><code>ESRI</code>:</td><td class="onleft"><code>False_Northing</code></td></tr>
* <tr><td></td><td class="onright"><code>NetCDF</code>:</td><td class="onleft"><code>false_northing</code></td></tr>
* <tr><td></td><td class="onright"><code>GeoTIFF</code>:</td><td class="onleft"><code>FalseNorthing</code></td></tr>
* <tr><td></td><td class="onright"><code>PROJ4</code>:</td><td class="onleft"><code>y_0</code></td></tr>
* </table>
* </td><td>
* <table class="compact">
* <tr><td><b>Type:</b></td><td>{@code Double}</td></tr>
* <tr><td><b>Obligation:</b></td><td>mandatory</td></tr>
* <tr><td><b>Value range:</b></td><td>(-∞ … ∞) metres</td></tr>
* <tr><td><b>Default value:</b></td><td>0 metres</td></tr>
* </table>
* </td></tr>
* </table>
*/
public static final ParameterDescriptorGroup PARAMETERS = UniversalParameters.createDescriptorGroup(
new Identifier[] {
new NamedIdentifier(Citations.OGC, "Stereographic"),
new NamedIdentifier(Citations.ESRI, "Stereographic"),
new NamedIdentifier(Citations.NETCDF, "Stereographic"),
new NamedIdentifier(Citations.GEOTIFF, "CT_Stereographic"),
new IdentifierCode (Citations.GEOTIFF, 14),
new NamedIdentifier(Citations.PROJ4, "stere"),
new IdentifierCode (Citations.MAP_INFO, 20),
new NamedIdentifier(Citations.GEOTOOLKIT, Vocabulary.formatInternational(
Vocabulary.Keys.StereographicProjection))
}, new Citation[] {
Citations.EPSG
},
new ParameterDescriptor<?>[] {
SEMI_MAJOR, SEMI_MINOR,
CENTRAL_MERIDIAN, LATITUDE_OF_ORIGIN, SCALE_FACTOR,
FALSE_EASTING, FALSE_NORTHING
}, MapProjectionDescriptor.ADD_EARTH_RADIUS);
/**
* Constructs a new provider.
*/
public Stereographic() {
super(PARAMETERS);
}
/**
* Constructs a provider from a set of parameters.
*
* @param parameters The set of parameters (never {@code null}).
*/
Stereographic(final ParameterDescriptorGroup parameters) {
super(parameters);
}
/**
* Returns the operation type for this map projection.
*/
@Override
public Class<PlanarProjection> getOperationType() {
return PlanarProjection.class;
}
/**
* {@inheritDoc}
*/
@Override
public MathTransform2D createMathTransform(MathTransformFactory factory, ParameterValueGroup values) {
return org.geotoolkit.referencing.operation.projection.Stereographic.create(this, values);
}
}