org.geotoolkit.referencing.operation.provider.LongitudeRotation Maven / Gradle / Ivy
/*
* Geotoolkit.org - An Open Source Java GIS Toolkit
* http://www.geotoolkit.org
*
* (C) 2002-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 java.awt.geom.AffineTransform;
import javax.measure.unit.NonSI;
import net.jcip.annotations.Immutable;
import org.opengis.parameter.ParameterValueGroup;
import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.ParameterDescriptorGroup;
import org.opengis.parameter.ParameterNotFoundException;
import org.opengis.referencing.operation.Conversion;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.ReferenceIdentifier;
import org.geotoolkit.metadata.iso.citation.Citations;
import org.geotoolkit.referencing.NamedIdentifier;
import org.geotoolkit.referencing.operation.MathTransforms;
import org.geotoolkit.referencing.operation.MathTransformProvider;
import static org.geotoolkit.parameter.Parameters.*;
import static org.geotoolkit.referencing.operation.provider.UniversalParameters.createDescriptor;
import static org.geotoolkit.referencing.operation.provider.UniversalParameters.createDescriptorGroup;
/**
* The provider for "Longitude rotation" (EPSG:9601).
*
*
* The following table summarizes the parameters recognized by this provider.
* For a more detailed parameter list, see the {@link #PARAMETERS} constant.
* Operation name: {@code Longitude rotation}
*
* Parameter name Default value
* {@code Longitude offset}
*
*
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @version 3.20
*
* @see org.geotoolkit.referencing.operation.transform.ProjectiveTransform
* @see Geotk coordinate operations matrix
*
* @since 2.0
* @module
*/
@Immutable
public class LongitudeRotation extends MathTransformProvider {
/**
* Serial number for inter-operability with different versions.
*/
private static final long serialVersionUID = -2104496465933824935L;
/**
* The operation parameter descriptor for the "longitude offset" parameter value.
*
* @deprecated Invoke {@linkplain #PARAMETERS}.{@linkplain ParameterDescriptorGroup#descriptor(String)
* descriptor(String)}
instead.
*/
@Deprecated
public static final ParameterDescriptor OFFSET = createDescriptor(
new NamedIdentifier[] {
new NamedIdentifier(Citations.EPSG, "Longitude offset")
},
Double.NaN, -180, +180, NonSI.DEGREE_ANGLE, true);
/**
* The group of all parameters expected by this coordinate operation.
* The following table lists the operation names and the parameters recognized by Geotk:
*
*
*
*
*
* Name: EPSG
:Longitude rotation
* Identifier: EPSG
:9601
*
*
*
*
* Name: EPSG
:Longitude offset
*
*
*
* Type: {@code Double}
* Obligation: mandatory
* Value range: [-180 … 180]°
*
*
*
*/
public static final ParameterDescriptorGroup PARAMETERS = createDescriptorGroup(
new ReferenceIdentifier[] {
new NamedIdentifier(Citations.EPSG, "Longitude rotation"),
new IdentifierCode (Citations.EPSG, 9601)
}, null, new ParameterDescriptor>[] {
OFFSET
}, 0);
/**
* Constructs a provider with default parameters.
*/
public LongitudeRotation() {
super(2, 2, PARAMETERS);
}
/**
* Returns the operation type.
*/
@Override
public Class getOperationType() {
return Conversion.class;
}
/**
* Creates a transform from the specified group of parameter values.
*
* @param values The group of parameter values.
* @return The created math transform.
* @throws ParameterNotFoundException if a required parameter was not found.
*/
@Override
protected MathTransform createMathTransform(final ParameterValueGroup values)
throws ParameterNotFoundException
{
final double offset = doubleValue(OFFSET, values);
return MathTransforms.linear(AffineTransform.getTranslateInstance(offset, 0));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy