org.geotoolkit.referencing.operation.provider.NTv2 Maven / Gradle / Ivy
/*
* Geotoolkit.org - An Open Source Java GIS Toolkit
* http://www.geotoolkit.org
*
* (C) 2010-2012, Open Source Geospatial Foundation (OSGeo)
* (C) 2010-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.util.FactoryException;
import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.ParameterDescriptorGroup;
import org.opengis.parameter.ParameterValueGroup;
import org.opengis.referencing.ReferenceIdentifier;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.Transformation;
import org.geotoolkit.metadata.iso.citation.Citations;
import org.geotoolkit.parameter.Parameters;
import org.geotoolkit.parameter.DefaultParameterDescriptor;
import org.geotoolkit.referencing.NamedIdentifier;
import org.geotoolkit.referencing.operation.transform.NTv2Transform;
import org.geotoolkit.referencing.operation.MathTransformProvider;
/**
* The provider for "National Transformation" version 2 (ESPG:9615).
* The math transform implementations instantiated by this provider may be any of
* the following classes:
*
*
* - {@link org.geotoolkit.referencing.operation.transform.NTv2Transform}
*
*
*
* The following table summarizes the parameters recognized by this provider.
* For a more detailed parameter list, see the {@link #PARAMETERS} constant.
* Operation name: {@code NTv2}
*
* Parameter name Default value
* {@code Latitude and longitude difference file}
*
*
*
* {@section Grid data}
* This transform requires data that are not bundled by default with Geotk. Run the
* geotk-setup module
* for downloading and installing the grid data.
*
* @author Simon Reynard (Geomatys)
* @author Martin Desruisseaux (Geomatys)
* @version 3.20
*
* @see Geotk coordinate operations matrix
*
* @since 3.12
* @module
*/
public class NTv2 extends MathTransformProvider {
/**
* Serial number for inter-operability with different versions.
*/
private static final long serialVersionUID = -4707304160205218546L;
/**
* The operation parameter descriptor for the Latitude and longitude difference file
* parameter value. The file extension is typically {@code ".gsb"}. There is no default value.
*
* @deprecated Invoke {@linkplain #PARAMETERS}.{@linkplain ParameterDescriptorGroup#descriptor(String)
* descriptor(String)}
instead.
*/
@Deprecated
public static final ParameterDescriptor DIFFERENCE_FILE = new DefaultParameterDescriptor(
Citations.EPSG, "Latitude and longitude difference file", String.class, null, null, null, null, null, true);
/**
* 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 the file extension for the parameter is typically {@code ".gsb"}.
*
*
*
*
*
* Name: EPSG
:NTv2
* Identifier: EPSG
:9615
*
*
*
*
* Name: EPSG
:Latitude and longitude difference file
*
*
*
* Type: {@code String}
* Obligation: mandatory
*
*
*
*/
public static final ParameterDescriptorGroup PARAMETERS = UniversalParameters.createDescriptorGroup(
new ReferenceIdentifier[] {
new NamedIdentifier(Citations.EPSG, "NTv2"),
new IdentifierCode (Citations.EPSG, 9615)
}, null, new ParameterDescriptor>[] {
DIFFERENCE_FILE
}, 0);
/**
* Constructs a provider.
*/
public NTv2() {
super(2, 2, PARAMETERS);
}
/**
* Returns the operation type.
*/
@Override
public Class getOperationType() {
return Transformation.class;
}
/**
* Creates a math transform from the specified group of parameter values.
*
* @throws FactoryException If the grid files can not be loaded.
*/
@Override
protected MathTransform createMathTransform(final ParameterValueGroup values) throws FactoryException {
return new NTv2Transform(Parameters.stringValue(DIFFERENCE_FILE, values));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy