congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
DefaultConversion.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.sis.referencing.operation.DefaultConversion
constructor

Best Java code snippets using org.apache.sis.referencing.operation.DefaultConversion.<init> (Showing top 20 results out of 315)

origin: apache/sis

  conversion = new DefaultConversion(properties, method, null, parameters);
} catch (IllegalArgumentException exception) {
  throw new InvalidGeodeticParameterException(exception.getLocalizedMessage(), exception);
origin: org.apache.sis.core/sis-referencing

  conversion = new DefaultConversion(properties, method, null, parameters);
} catch (IllegalArgumentException exception) {
  throw new InvalidGeodeticParameterException(exception.getLocalizedMessage(), exception);
origin: org.apache.sis.core/sis-referencing

/**
 * For {@link DefaultDerivedCRS#DefaultDerivedCRS(Map, SingleCRS, CoordinateReferenceSystem, OperationMethod,
 * MathTransform, CoordinateSystem)} constructor only (<strong>not legal for {@code ProjectedCRS}</strong>).
 */
@SuppressWarnings("unchecked")
AbstractDerivedCRS(final Map<String,?>             properties,
          final SingleCRS                 baseCRS,
          final CoordinateReferenceSystem interpolationCRS,
          final OperationMethod           method,
          final MathTransform             baseToDerived,
          final CoordinateSystem          derivedCS)
    throws MismatchedDimensionException
{
  super(properties, derivedCS);
  ArgumentChecks.ensureNonNull("baseCRS", baseCRS);
  ArgumentChecks.ensureNonNull("method", method);
  ArgumentChecks.ensureNonNull("baseToDerived", baseToDerived);
  conversionFromBase = (C) new DefaultConversion(   // Cast to (C) is valid only for DefaultDerivedCRS.
      ConversionKeys.unprefix(properties), baseCRS, this, interpolationCRS, method, baseToDerived);
}
origin: apache/sis

  conversion = new DefaultProjection(definition, sourceCRS, targetCRS, factory, actual);
} else {
  conversion = new DefaultConversion(definition, sourceCRS, targetCRS, factory, actual);
origin: apache/sis

/**
 * For {@link DefaultDerivedCRS#DefaultDerivedCRS(Map, SingleCRS, CoordinateReferenceSystem, OperationMethod,
 * MathTransform, CoordinateSystem)} constructor only (<strong>not legal for {@code ProjectedCRS}</strong>).
 */
@SuppressWarnings("unchecked")
AbstractDerivedCRS(final Map<String,?>             properties,
          final SingleCRS                 baseCRS,
          final CoordinateReferenceSystem interpolationCRS,
          final OperationMethod           method,
          final MathTransform             baseToDerived,
          final CoordinateSystem          derivedCS)
    throws MismatchedDimensionException
{
  super(properties, derivedCS);
  ArgumentChecks.ensureNonNull("baseCRS", baseCRS);
  ArgumentChecks.ensureNonNull("method", method);
  ArgumentChecks.ensureNonNull("baseToDerived", baseToDerived);
  conversionFromBase = (C) new DefaultConversion(   // Cast to (C) is valid only for DefaultDerivedCRS.
      ConversionKeys.unprefix(properties), baseCRS, this, interpolationCRS, method, baseToDerived);
}
origin: org.apache.sis.core/sis-referencing

  conversion = new DefaultProjection(definition, sourceCRS, targetCRS, factory, actual);
} else {
  conversion = new DefaultConversion(definition, sourceCRS, targetCRS, factory, actual);
origin: org.apache.sis.core/sis-referencing

/**
 * Returns a SIS implementation for the given conversion.
 *
 * @see DefaultConversion#castOrCopy(Conversion)
 */
static DefaultConversion forConversion(final Conversion object) {
  if (object instanceof CylindricalProjection) {
    return (object instanceof DefaultCylindricalProjection) ? ((DefaultCylindricalProjection) object)
        : new DefaultCylindricalProjection((CylindricalProjection) object);
  }
  if (object instanceof ConicProjection) {
    return (object instanceof DefaultConicProjection) ? ((DefaultConicProjection) object)
        : new DefaultConicProjection((ConicProjection) object);
  }
  if (object instanceof PlanarProjection) {
    return (object instanceof DefaultPlanarProjection) ? ((DefaultPlanarProjection) object)
        : new DefaultPlanarProjection((PlanarProjection) object);
  }
  if (object instanceof Projection) {
    return (object instanceof DefaultProjection) ? ((DefaultProjection) object)
        : new DefaultProjection((Projection) object);
  }
  if (object == null || object instanceof DefaultConversion) {
    return (DefaultConversion) object;
  }
  return new DefaultConversion(object);
}
origin: apache/sis

/**
 * Returns a SIS implementation for the given conversion.
 *
 * @see DefaultConversion#castOrCopy(Conversion)
 */
static DefaultConversion forConversion(final Conversion object) {
  if (object instanceof CylindricalProjection) {
    return (object instanceof DefaultCylindricalProjection) ? ((DefaultCylindricalProjection) object)
        : new DefaultCylindricalProjection((CylindricalProjection) object);
  }
  if (object instanceof ConicProjection) {
    return (object instanceof DefaultConicProjection) ? ((DefaultConicProjection) object)
        : new DefaultConicProjection((ConicProjection) object);
  }
  if (object instanceof PlanarProjection) {
    return (object instanceof DefaultPlanarProjection) ? ((DefaultPlanarProjection) object)
        : new DefaultPlanarProjection((PlanarProjection) object);
  }
  if (object instanceof Projection) {
    return (object instanceof DefaultProjection) ? ((DefaultProjection) object)
        : new DefaultProjection((Projection) object);
  }
  if (object == null || object instanceof DefaultConversion) {
    return (DefaultConversion) object;
  }
  return new DefaultConversion(object);
}
origin: org.apache.sis.core/sis-referencing

/**
 * Creates a Universal Transverse Mercator (UTM) or a Universal Polar Stereographic (UPS) projected CRS
 * using the Apache SIS factory implementation. This method restricts the factory to SIS implementation
 * instead than arbitrary factory in order to meet the contract saying that {@link CommonCRS} methods
 * should never fail.
 *
 * @param code       the EPSG code, or 0 if none.
 * @param baseCRS    the geographic CRS on which the projected CRS is based.
 * @param isUTM      {@code true} for UTM or {@code false} for UPS. Note: redundant with the given latitude.
 * @param latitude   a latitude in the zone of the desired projection, to be snapped to 0°, 90°S or 90°N.
 * @param longitude  a longitude in the zone of the desired projection, to be snapped to UTM central meridian.
 * @param derivedCS  the projected coordinate system.
 */
static ProjectedCRS createUniversal(final int code, final GeographicCRS baseCRS, final boolean isUTM,
    final double latitude, final double longitude, final CartesianCS derivedCS)
{
  final OperationMethod method;
  try {
    method = DefaultFactories.forBuildin(MathTransformFactory.class, DefaultMathTransformFactory.class)
            .getOperationMethod(isUTM ? TransverseMercator.NAME : PolarStereographicA.NAME);
  } catch (NoSuchIdentifierException e) {
    throw new IllegalStateException(e);                     // Should not happen with SIS implementation.
  }
  final ParameterValueGroup parameters = method.getParameters().createValue();
  String name = isUTM ? TransverseMercator.Zoner.UTM.setParameters(parameters, latitude, longitude)
            : PolarStereographicA.setParameters(parameters, latitude >= 0);
  final DefaultConversion conversion = new DefaultConversion(properties(0, name, null, false), method, null, parameters);
  name = baseCRS.getName().getCode() + " / " + name;
  return new DefaultProjectedCRS(properties(code, name, null, false), baseCRS, conversion, derivedCS);
}
origin: org.apache.sis.core/sis-referencing

  op = new DefaultConversion(properties, sourceCRS, targetCRS, interpolationCRS, method, transform);
} else {  // See above comment about this last-resort fallback.
  op = new AbstractSingleOperation(properties, sourceCRS, targetCRS, interpolationCRS, method, transform);
origin: apache/sis

/**
 * Creates a Universal Transverse Mercator (UTM) or a Universal Polar Stereographic (UPS) projected CRS
 * using the Apache SIS factory implementation. This method restricts the factory to SIS implementation
 * instead than arbitrary factory in order to met the contract saying that {@link CommonCRS} methods
 * should never fail.
 *
 * @param code       the EPSG code, or 0 if none.
 * @param baseCRS    the geographic CRS on which the projected CRS is based.
 * @param isUTM      {@code true} for UTM or {@code false} for UPS. Note: redundant with the given latitude.
 * @param latitude   a latitude in the zone of the desired projection, to be snapped to 0°, 90°S or 90°N.
 * @param longitude  a longitude in the zone of the desired projection, to be snapped to UTM central meridian.
 * @param derivedCS  the projected coordinate system.
 */
static ProjectedCRS createUniversal(final int code, final GeographicCRS baseCRS, final boolean isUTM,
    final double latitude, final double longitude, final CartesianCS derivedCS)
{
  final OperationMethod method;
  try {
    method = DefaultFactories.forBuildin(MathTransformFactory.class, DefaultMathTransformFactory.class)
            .getOperationMethod(isUTM ? TransverseMercator.NAME : PolarStereographicA.NAME);
  } catch (NoSuchIdentifierException e) {
    throw new IllegalStateException(e);                     // Should not happen with SIS implementation.
  }
  final ParameterValueGroup parameters = method.getParameters().createValue();
  String name = isUTM ? TransverseMercator.Zoner.UTM.setParameters(parameters, latitude, longitude)
            : PolarStereographicA.setParameters(parameters, latitude >= 0);
  final DefaultConversion conversion = new DefaultConversion(properties(0, name, null, false), method, null, parameters);
  name = baseCRS.getName().getCode() + " / " + name;
  return new DefaultProjectedCRS(properties(code, name, null, false), baseCRS, conversion, derivedCS);
}
origin: apache/sis

/**
 * Creates a “Tokyo to JGD2000” transformation.
 *
 * @see DefaultTransformationTest#createGeocentricTranslation()
 */
private static DefaultConcatenatedOperation createGeocentricTranslation() throws FactoryException, NoninvertibleTransformException {
  final MathTransformFactory mtFactory = DefaultFactories.forBuildin(MathTransformFactory.class);
  final DefaultTransformation op = DefaultTransformationTest.createGeocentricTranslation();
  final DefaultConversion before = new DefaultConversion(
      Collections.singletonMap(DefaultConversion.NAME_KEY, "Geographic to geocentric"),
      HardCodedCRS.TOKYO,             // SourceCRS
      op.getSourceCRS(),              // TargetCRS
      null,                           // InterpolationCRS
      DefaultOperationMethodTest.create("Geographic/geocentric conversions", "9602", "EPSG guidance note #7-2", 3),
      EllipsoidToCentricTransform.createGeodeticConversion(mtFactory, HardCodedDatum.TOKYO.getEllipsoid(), true));
  final DefaultConversion after = new DefaultConversion(
      Collections.singletonMap(DefaultConversion.NAME_KEY, "Geocentric to geographic"),
      op.getTargetCRS(),              // SourceCRS
      HardCodedCRS.JGD2000,           // TargetCRS
      null,                           // InterpolationCRS
      DefaultOperationMethodTest.create("Geographic/geocentric conversions", "9602", "EPSG guidance note #7-2", 3),
      EllipsoidToCentricTransform.createGeodeticConversion(mtFactory, HardCodedDatum.JGD2000.getEllipsoid(), true).inverse());
  return new DefaultConcatenatedOperation(
      Collections.singletonMap(DefaultConversion.NAME_KEY, "Tokyo to JGD2000"),
      new AbstractSingleOperation[] {before, op, after}, mtFactory);
}
origin: apache/sis

/**
 * Returns the inverse of the given conversion. This method is not strictly correct
 * since we reuse the properties (name, aliases, etc.) from the given conversion.
 * However those properties are not significant for the purpose of this test.
 */
private static Conversion inverse(final Conversion conversion) throws NoninvertibleTransformException {
  return new DefaultConversion(IdentifiedObjects.getProperties(conversion), conversion.getTargetCRS(),
      conversion.getSourceCRS(), null, conversion.getMethod(), conversion.getMathTransform().inverse());
}
origin: org.apache.sis.storage/sis-gdal

final Conversion fromBase = new DefaultConversion(name, method, tr, parameters);
return crsFactory.createProjectedCRS(name, (GeographicCRS) baseCRS, fromBase, withHeight ?
    csFactory.createCartesianCS(csName, axes[0], axes[1], axes[2]) :
origin: apache/sis

final Conversion fromBase = new DefaultConversion(name, method, tr, parameters);
return crsFactory.createProjectedCRS(name, (GeographicCRS) baseCRS, fromBase, withHeight ?
    csFactory.createCartesianCS(csName, axes[0], axes[1], axes[2]) :
origin: Geomatys/geotoolkit

   mtFactory.createAffineTransform(append));
mt = mtFactory.createPassThroughTransform(0, mt, 1);
projection = new DefaultConversion(IdentifiedObjects.getProperties(projection),
                  projection.getMethod(), mt, null);
return crsFactory.createProjectedCRS(crsName, base3D, projection, targetCS);
origin: org.apache.sis.core/sis-referencing

final GeographicCRS base = (GeographicCRS) getHorizontalComponent(proj.getBaseCRS());
Conversion fromBase = proj.getConversionFromBase();
fromBase = new DefaultConversion(IdentifiedObjects.getProperties(fromBase),
    fromBase.getMethod(), null, fromBase.getParameterValues());
return new DefaultProjectedCRS(properties, base, fromBase, (CartesianCS) cs);
origin: apache/sis

final GeographicCRS base = (GeographicCRS) getHorizontalComponent(proj.getBaseCRS());
Conversion fromBase = proj.getConversionFromBase();
fromBase = new DefaultConversion(IdentifiedObjects.getProperties(fromBase),
    fromBase.getMethod(), null, fromBase.getParameterValues());
return new DefaultProjectedCRS(properties, base, fromBase, (CartesianCS) cs);
origin: apache/sis

public void testDefiningConversion() throws FactoryException {
  final DefaultConversion reference = createLongitudeRotation(true);
  final DefaultConversion definingConversion = new DefaultConversion(
      IdentifiedObjects.getProperties(reference),
      reference.getMethod(),
origin: apache/sis

    new DefaultConversion(dummyName, method, mt, null),
    HardCodedCS.PROJECTED);
final Conversion projection = crs.getConversionFromBase();
org.apache.sis.referencing.operationDefaultConversion<init>

Javadoc

Constructs a new object in which every attributes are set to a null value. This is not a valid object. This constructor is strictly reserved to JAXB, which will assign values to the fields using reflexion.

Popular methods of DefaultConversion

  • getMethod
  • getSourceCRS
  • getTargetCRS
  • specialize
    Returns a specialization of this conversion with a more specific type, source and target CRS. This s
  • 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

  • Updating database using SQL prepared statement
  • setScale (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • onCreateOptionsMenu (Activity)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JTable (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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