congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
DefaultConversion.specialize
Code IndexAdd Tabnine to your IDE (free)

How to use
specialize
method
in
org.apache.sis.referencing.operation.DefaultConversion

Best Java code snippets using org.apache.sis.referencing.operation.DefaultConversion.specialize (Showing top 6 results out of 315)

origin: org.apache.sis.core/sis-referencing

/**
 * Creates the conversion instance to associate with this {@code AbstractDerivedCRS}.
 *
 * <p><b>WARNING:</b> this method is invoked at construction time and will invoke indirectly
 * (through {@link DefaultConversion}) the {@link #getCoordinateSystem()} method on {@code this}.
 * Consequently this method shall be invoked only after the construction of this {@code AbstractDerivedCRS}
 * instance is advanced enough for allowing the {@code getCoordinateSystem()} method to execute.
 * Subclasses may consider to make the {@code getCoordinateSystem()} method final for better guarantees.</p>
 */
private C createConversionFromBase(final Map<String,?> properties, final SingleCRS baseCRS, final Conversion conversion) {
  MathTransformFactory factory = null;
  if (properties != null) {
    factory = (MathTransformFactory) properties.get(ReferencingServices.MT_FACTORY);
  }
  if (factory == null) {
    factory = DefaultFactories.forBuildin(MathTransformFactory.class);
  }
  try {
    return DefaultConversion.castOrCopy(conversion).specialize(getConversionType(), baseCRS, this, factory);
  } catch (FactoryException e) {
    throw new IllegalArgumentException(Errors.getResources(properties).getString(
        Errors.Keys.IllegalArgumentValue_2, "conversion", conversion.getName()), e);
  }
}
origin: apache/sis

/**
 * Creates the conversion instance to associate with this {@code AbstractDerivedCRS}.
 *
 * <p><b>WARNING:</b> this method is invoked at construction time and will invoke indirectly
 * (through {@link DefaultConversion}) the {@link #getCoordinateSystem()} method on {@code this}.
 * Consequently this method shall be invoked only after the construction of this {@code AbstractDerivedCRS}
 * instance is advanced enough for allowing the {@code getCoordinateSystem()} method to execute.
 * Subclasses may consider to make the {@code getCoordinateSystem()} method final for better guarantees.</p>
 */
private C createConversionFromBase(final Map<String,?> properties, final SingleCRS baseCRS, final Conversion conversion) {
  MathTransformFactory factory = null;
  if (properties != null) {
    factory = (MathTransformFactory) properties.get(ReferencingServices.MT_FACTORY);
  }
  if (factory == null) {
    factory = DefaultFactories.forBuildin(MathTransformFactory.class);
  }
  try {
    return DefaultConversion.castOrCopy(conversion).specialize(getConversionType(), baseCRS, this, factory);
  } catch (FactoryException e) {
    throw new IllegalArgumentException(Errors.getResources(properties).getString(
        Errors.Keys.IllegalArgumentValue_2, "conversion", conversion.getName()), e);
  }
}
origin: apache/sis

/**
 * Ensures that {@link DefaultConversion#specialize DefaultConversion.specialize(…)} verifies the datum.
 *
 * @throws FactoryException if an error occurred while creating the conversion.
 */
@Test
public void testDatumCheck() throws FactoryException {
  final MathTransformFactory factory = DefaultFactories.forBuildin(MathTransformFactory.class);
  final DefaultConversion op = createLongitudeRotation(true);
  try {
    op.specialize(Conversion.class, HardCodedCRS.WGS84, HardCodedCRS.NTF_NORMALIZED_AXES, factory);
    fail("Should not have accepted to change the geodetic datum.");
  } catch (IllegalArgumentException e) {
    final String message = e.getMessage();
    assertTrue(message, message.contains("sourceCRS"));
    assertTrue(message, message.contains("Nouvelle Triangulation Française"));
  }
  try {
    op.specialize(Conversion.class, HardCodedCRS.NTF_NORMALIZED_AXES, HardCodedCRS.WGS84, factory);
    fail("Should not have accepted to change the geodetic datum.");
  } catch (IllegalArgumentException e) {
    final String message = e.getMessage();
    assertTrue(message, message.contains("targetCRS"));
    assertTrue(message, message.contains("Nouvelle Triangulation Française"));
  }
}
origin: apache/sis

assertSame(op, op.specialize(Conversion.class, op.getSourceCRS(), op.getTargetCRS(), factory));
op = op.specialize(DefaultConversion.class, op.getSourceCRS(),
    changeCS(op.getTargetCRS(), HardCodedCS.GEODETIC_φλ), factory);
assertMatrixEquals("Longitude rotation of a two-dimensional CRS", Matrices.create(3, 4, new double[] {
origin: apache/sis

    0, 0, 0, 1), MathTransforms.getMatrix(op.getMathTransform()), STRICT);
op = op.specialize(
    DefaultConversion.class,    // In normal use, this would be 'Conversion.class'.
origin: apache/sis

final DefaultConversion completed = definingConversion.specialize(
    DefaultConversion.class,    // In normal use, this would be 'Conversion.class'.
    changeCS(reference.getSourceCRS(), HardCodedCS.GEODETIC_φλ),
org.apache.sis.referencing.operationDefaultConversionspecialize

Javadoc

Returns a specialization of this conversion with a more specific type, source and target CRS. This specialize(…) method is typically invoked on #DefaultConversion(Map,OperationMethod,MathTransform,ParameterValueGroup) instances, when more information become available about the conversion to create.

The given baseType argument can be one of the following values:

  • org.opengis.referencing.operation.Conversion.class
  • org.opengis.referencing.operation.Projection.class
  • org.opengis.referencing.operation.CylindricalProjection.class
  • org.opengis.referencing.operation.ConicProjection.class
  • org.opengis.referencing.operation.PlanarProjection.class
This specialize(…) method returns a conversion which implement at least the given baseTypeinterface, but may also implement a more specific GeoAPI interface if specialize(…) has been able to infer the type from this operation #getMethod().

Popular methods of DefaultConversion

  • <init>
    Constructs a new conversion with the same values than the specified one, together with the specified
  • getMethod
  • getSourceCRS
  • getTargetCRS
  • castOrCopy
    Returns a SIS coordinate operation implementation with the values of the given arbitrary implementat
  • checkDimensions
  • ensureCompatibleDatum
    Ensures that the actual CRS uses a datum which is equals, ignoring metadata, to the datum of the exp
  • equals
  • getDomainOfValidity
  • getIdentifiers
  • getInterpolationCRS
  • getMathTransform
  • getInterpolationCRS,
  • getMathTransform,
  • getName,
  • getOperationVersion,
  • getParameterDescriptors,
  • getParameterValues,
  • getScope,
  • swapAndScaleAxes

Popular in Java

  • Making http requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • getResourceAsStream (ClassLoader)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Table (org.hibernate.mapping)
    A relational table
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now