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

How to use
BursaWolfParameters
in
org.apache.sis.referencing.datum

Best Java code snippets using org.apache.sis.referencing.datum.BursaWolfParameters (Showing top 20 results out of 315)

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

/**
 * {@inheritDoc}
 *
 * @return {@code true} if the parameters describe no operation.
 */
@Override
public boolean isIdentity() {
  return super.isIdentity() && dtX == 0 && dtY == 0 && dtZ == 0;
}
origin: org.apache.sis.core/sis-referencing

/**
 * Returns {@code true} if a transformation built from this set of parameters would perform no operation.
 * This is true when the value of all parameters is zero.
 *
 * @return {@code true} if the parameters describe no operation.
 */
public boolean isIdentity() {
  return tX == 0 && tY == 0 && tZ == 0 && isTranslation();
}
origin: org.apache.sis.core/sis-referencing

/**
 * Creates the {@code TOWGS84} element during parsing of a WKT version 1.
 *
 * @param  values  the 7 Bursa-Wolf parameter values.
 * @return the {@link BursaWolfParameters}.
 *
 * @since 0.6
 */
@Override
public Object createToWGS84(final double[] values) {
  final BursaWolfParameters info = new BursaWolfParameters(CommonCRS.WGS84.datum(), null);
  info.setValues(values);
  return info;
}
origin: org.apache.sis.core/sis-referencing

/**
 * Inverts in-place the transformation by inverting the sign of all numerical parameters.
 * The {@linkplain #getPositionVectorTransformation(Date) position vector transformation} matrix
 * created from inverted Bursa-Wolf parameters will be <strong>approximatively</strong> equals
 * to the {@linkplain org.apache.sis.referencing.operation.matrix.MatrixSIS#inverse() inverse}
 * of the matrix created from the original parameters. The equality holds approximatively only
 * because the parameter values are very small (parts per millions and arc-seconds).
 */
public void invert() {
  final double[] values = getValues();
  for (int i=0; i<values.length; i++) {
    values[i] = -values[i];
  }
  setValues(values);
}
origin: apache/sis

/**
 * Returns the parameters for the <cite>WGS 72 to WGS 84 (2)</cite> transformation (EPSG:1238).
 * Area of validity is the World.
 */
static BursaWolfParameters createWGS72_to_WGS84() {
  final BursaWolfParameters bursaWolf = new BursaWolfParameters(GeodeticDatumMock.WGS84, Extents.WORLD);
  bursaWolf.tZ = 4.5;
  bursaWolf.rZ = 0.554;
  bursaWolf.dS = 0.219;
  bursaWolf.verify(PrimeMeridianMock.GREENWICH);
  assertFalse("isIdentity",    bursaWolf.isIdentity());
  assertFalse("isTranslation", bursaWolf.isTranslation());
  return bursaWolf;
}
origin: apache/sis

/**
 * Tests the {@link BursaWolfParameters#setPositionVectorTransformation(Matrix, double)} method.
 * This is an internal consistency test.
 */
@Test
@DependsOnMethod("testGetPositionVectorTransformation")
public void testSetPositionVectorTransformation() {
  final BursaWolfParameters bursaWolf = createED87_to_WGS84();
  final Matrix matrix = bursaWolf.getPositionVectorTransformation(null);
  final BursaWolfParameters actual = new BursaWolfParameters(
      bursaWolf.getTargetDatum(), bursaWolf.getDomainOfValidity());
  actual.setPositionVectorTransformation(matrix, 1E-10);
  assertEquals(bursaWolf, actual);
}
origin: org.apache.sis.core/sis-referencing

final BursaWolfParameters parameters = new BursaWolfParameters(null, null);
try {
  parameters.setPositionVectorTransformation(((LinearTransform) step).getMatrix(), BURSAWOLF_TOLERANCE);
} catch (IllegalArgumentException e) {
  continue;
final boolean isTranslation = parameters.isTranslation();
final Parameters values = createParameters(isTranslation ? GeocentricTranslation.PARAMETERS
            : PositionVector7Param.PARAMETERS, parameters, isTranslation);
origin: org.apache.sis.core/sis-referencing

final double[] values = getValues();
for (final double value : values) {
  formatter.append(value);
if (isToWGS84()) {
  if (values.length > 7) {
    formatter.setInvalidWKT(BursaWolfParameters.class, null);
String name = IdentifiedObjects.getUnicodeIdentifier(getTargetDatum());
if (name == null) {
  name = "Unknown";
origin: org.apache.sis.storage/sis-gdal

if (datum instanceof DefaultGeodeticDatum) {
  for (final BursaWolfParameters bwp : ((DefaultGeodeticDatum) datum).getBursaWolfParameters()) {
    if (Utilities.equalsIgnoreMetadata(CommonCRS.WGS84.datum(), bwp.getTargetDatum())) {
      definition.append(" +towgs84=").append(bwp.tX).append(',').append(bwp.tY).append(',').append(bwp.tZ);
      if (!bwp.isTranslation()) {
        definition.append(',').append(bwp.rX).append(',').append(bwp.rY).append(',').append(bwp.rZ).append(',').append(bwp.dS);
origin: org.apache.sis.core/sis-referencing

/**
 * Returns the best parameters matching the given criteria, or {@code null} if none.
 */
private BursaWolfParameters select(final GeodeticDatum targetDatum, final ExtentSelector<BursaWolfParameters> selector) {
  if (bursaWolf == null) {
    return null;
  }
  for (final BursaWolfParameters candidate : bursaWolf) {
    if (deepEquals(targetDatum, candidate.getTargetDatum(), ComparisonMode.IGNORE_METADATA)) {
      selector.evaluate(candidate.getDomainOfValidity(), candidate);
    }
  }
  return selector.best();
}
origin: apache/sis

/**
 * Tests {@link BursaWolfParameters#setValues(double[])}.
 */
@Test
@DependsOnMethod("testGetValues")
public void testSetValues() {
  final BursaWolfParameters actual =  createWGS72_to_WGS84();
  final BursaWolfParameters expected = createED87_to_WGS84();
  final double[] values = expected.getValues();
  assertFalse("equals(Object) before to set the values.", actual.equals(expected));
  actual.setValues(values);
  assertArrayEquals("getValues() after setting the values.", values, actual.getValues(), STRICT);
  // Can not test assertEquals(expected, actual) because of different geographic extent.
}
origin: Geomatys/geotoolkit

/**
 * Tests the conversion from {@code CompoundCRS[EPSG:3035 + Sigma-level]} to {@code EPSG:4326}.
 * The interesting part in this test is that the height is not a standard height, and the
 * referencing module is not supposed to known how to build a 3D Geographic CRS (needed as
 * an intermediate step for the datum shift) with that height.
 *
 * @throws FactoryException Should never happen.
 *
 * @see <a href="http://jira.geotoolkit.org/browse/GEOTK-71">GEOTK-71</a>
 */
@Test
@Ignore("JSR-275 does not accept unit named 'level'.")
public void testProjected3D_to_2D() throws FactoryException {
  CoordinateReferenceSystem targetCRS = CommonCRS.WGS84.geographic();
  CoordinateReferenceSystem sourceCRS = CRS.forCode("EPSG:3035");
  GeodeticDatum targetDatum = ((GeographicCRS) targetCRS).getDatum();
  GeodeticDatum sourceDatum =  ((ProjectedCRS) sourceCRS).getDatum();
  final BursaWolfParameters[] params = ((DefaultGeodeticDatum) sourceDatum).getBursaWolfParameters();
  assertEquals("This test requires that an explicit BursaWolf parameter exists.", 1, params.length);
  assertEquals("targetDatum", targetDatum, params[0].getTargetDatum());
  assertTrue("This test requires that the BursaWolf parameter is set to identity.", params[0].isIdentity());
  CoordinateReferenceSystem vertCRS = CRS.fromWKT(
      "VERT_CS[\"Sigma Level\",VERT_DATUM[\"Sigma Level\",2000],UNIT[\"level\",1.0],AXIS[\"Sigma Level\",DOWN]]");
  sourceCRS = new DefaultCompoundCRS(singletonMap(NAME_KEY, "ETRS89 + Sigma level"), sourceCRS, vertCRS);
  final MathTransform tr = CRS.findOperation(sourceCRS, targetCRS, null).getMathTransform();
  assertSame(tr, CRS.findOperation(sourceCRS, targetCRS, null).getMathTransform());
  assertSame(tr, CRS.findOperation(sourceCRS, targetCRS, null).getMathTransform());
  assertEquals(3, tr.getSourceDimensions());
  assertEquals(2, tr.getTargetDimensions());
}
origin: org.apache.sis.core/sis-referencing

  throws FactoryException
final BursaWolfParameters parameters = new BursaWolfParameters(null, null);
final Parameters pv = Parameters.castOrWrap(values);
boolean reverseRotation = false;
  parameters.reverseRotation();
return MathTransforms.linear(parameters.getPositionVectorTransformation(null));
origin: org.apache.sis.core/sis-referencing

final DoubleDouble period = period(time);
if (period == null && isTranslation()) {
  final Matrix4 matrix = new Matrix4();
  matrix.m03 = tX;
final DoubleDouble S = param(6, period);
S.divide(PPM, 0);
S.add(1, 0);                                                // S = 1 + dS / PPM;
final DoubleDouble  X = param(3, period); X.multiply(RS);
final DoubleDouble  Y = param(4, period); Y.multiply(RS);
final DoubleDouble  Z = param(5, period); Z.multiply(RS);
final DoubleDouble mX = new DoubleDouble(X); mX.negate();
final DoubleDouble mY = new DoubleDouble(Y); mY.negate();
final Integer       O = 0;                                  // Fetch Integer instance only once.
return Matrices.create(4, 4, new Number[] {
     S,  mZ,   Y,  param(0, period),
     Z,   S,  mX,  param(1, period),
    mY,   X,   S,  param(2, period),
     O,   O,   O,  1});
origin: apache/sis

/**
 * Invokes {@link BursaWolfParameters#getPositionVectorTransformation(Date)}
 * and compares with our own matrix calculated using double arithmetic.
 */
private static MatrixSIS getPositionVectorTransformation(final BursaWolfParameters p) {
  final double   S = 1 + p.dS / BursaWolfParameters.PPM;
  final double  RS = TO_RADIANS * S;
  final Matrix4 expected = new Matrix4(
        S,  -p.rZ*RS,  +p.rY*RS,  p.tX,
    +p.rZ*RS,         S,  -p.rX*RS,  p.tY,
    -p.rY*RS,  +p.rX*RS,         S,  p.tZ,
        0,         0,         0,  1);
  final MatrixSIS matrix = MatrixSIS.castOrCopy(p.getPositionVectorTransformation(null));
  assertMatrixEquals("getPositionVectorTransformation", expected, matrix, p.isTranslation() ? 0 : 1E-14);
  return matrix;
}
origin: org.apache.sis.core/sis-referencing

/**
 * Returns a hash value for this object.
 *
 * @return the hash code value. This value does not need to be the same in past or future versions of this class.
 */
@Override
public int hashCode() {
  return Arrays.hashCode(getValues()) ^ (int) serialVersionUID;
}
origin: org.apache.sis.core/sis-referencing

  continue;
final BursaWolfParameters bwp = new BursaWolfParameters(datum, info.getDomainOfValidity(owner));
try (ResultSet result = executeQuery("BursaWolfParameters",
  "SELECT PARAMETER_CODE," +
  bwp.reverseRotation();
origin: apache/sis

/**
 * {@inheritDoc}
 *
 * @return {@code true} if the given object is equal to this {@code TimeDependentBWP}.
 */
@Override
public boolean equals(final Object object) {
  return super.equals(object) && timeReference == ((TimeDependentBWP) object).timeReference;
}
origin: org.apache.sis.core/sis-referencing

/**
 * Invokes {@link BursaWolfParameters#getPositionVectorTransformation(Date)} for a date calculated from
 * the temporal elements on the given extent.  This method chooses an instant located midway between the
 * start and end time.
 */
private static Matrix createTransformation(final BursaWolfParameters bursaWolf, final Extent areaOfInterest) {
  /*
   * Implementation note: we know that we do not need to compute an instant if the parameters is
   * not a subclass of BursaWolfParameters. This optimisation covers the vast majority of cases.
   */
  return bursaWolf.getPositionVectorTransformation(bursaWolf.getClass() != BursaWolfParameters.class ?
      Extents.getDate(areaOfInterest, 0.5) : null);       // 0.5 is for choosing midway instant.
}
origin: org.apache.sis.core/sis-referencing

/**
 * Sets the parameters to the given values. The given array can have any length. The first array elements will be
 * assigned to the {@link #tX tX}, {@link #tY tY}, {@link #tZ tZ}, {@link #rX rX}, {@link #rY rY}, {@link #rZ rZ},
 * {@link #dS dS}, {@link #dtX}, {@link #dtY}, {@link #dtZ}, {@link #drX}, {@link #drY}, {@link #drZ} and
 * {@link #ddS} fields in that order.
 *
 * @param  elements  the new parameter values, as an array of any length.
 *
 * @since 0.6
 */
@Override
@SuppressWarnings("fallthrough")
public void setValues(final double... elements) {
  if (elements.length >= 8) {
    switch (elements.length) {
      default:  ddS = elements[13];  // Fallthrough everywhere.
      case 13:  drZ = elements[12];
      case 12:  drY = elements[11];
      case 11:  drX = elements[10];
      case 10:  dtZ = elements[ 9];
      case  9:  dtY = elements[ 8];
      case  8:  dtX = elements[ 7];
    }
  }
  super.setValues(elements);
}
org.apache.sis.referencing.datumBursaWolfParameters

Javadoc

Parameters for a geographic transformation between two datum having the same prime meridian. Bursa-Wolf parameters are also known as Helmert transformation parameters. For an explanation of their purpose, see the Bursa-Wolf parameters section of DefaultGeodeticDatum class javadoc.

The Bursa-Wolf parameters shall be applied to geocentric coordinates, where the X axis points towards the Prime Meridian (usually Greenwich), the Y axis points East, and the Z axis points North.

Note: The upper case letters are intentional. By convention, (X, Y, Z) stand for geocentric coordinates while (x, y, z) stand for projected coordinates.
The "Bursa-Wolf" formula is expressed with 7 parameters, listed in the table below. The code, name and abbreviation columns list EPSG identifiers, while the legacy column lists the identifiers used in the legacy OGC 01-009 specification (still used in some Well Known Texts).
Parameters defined by EPSG
Code Name Abbr. Legacy
8605 X-axis translation #tX dx
8606 Y-axis translation #tY dy
8607 Z-axis translation #tZ dz
8608 X-axis rotation #rX ex
8609 Y-axis rotation #rY ey
8610 Z-axis rotation #rZ ez
8611 Scale difference #dS ppm
Geocentric coordinates transformation from (Xs, Ys, Zs) to (Xt, Yt, Zt)
(ignoring unit conversions)

formulas.html#Bursa-Wolf

The numerical fields in this BursaWolfParameters class use the EPSG abbreviations with 4 additional constraints compared to the EPSG definitions:
  • Unit of scale difference ( #dS) is fixed to parts per million.
  • Unit of translation terms ( #tX, #tY, #tZ) is fixed to metres.
  • Unit of rotation terms ( #rX, #rY, #rZ) is fixed to arc-seconds.
  • Sign of rotation terms is fixed to the Position Vector convention (EPSG operation method 9606). This is the opposite sign than the Coordinate Frame Rotation (EPSG operation method 9607). The Position Vector convention is used by IAG and recommended by ISO 19111.
Source and target geodetic datum
The source datum in above coordinates transformation is the DefaultGeodeticDatum instance that contain this BursaWolfParameters. It can be any datum, including datum that are valid only locally. The #getTargetDatum() is specified at construction time and is often, but not necessarily, the World Geodetic System 1984 (WGS 84) datum.

If the source and target datum does not have the same DefaultGeodeticDatum#getPrimeMeridian(), then it is user's responsibility to apply longitude rotation before to use the Bursa-Wolf parameters.

When Bursa-Wolf parameters are used
BursaWolfParameters are used in three contexts:
  1. Created as a step while creating a org.apache.sis.referencing.operation.AbstractCoordinateOperation from the EPSG database.
  2. Associated to a DefaultGeodeticDatum with the WGS 84 #getTargetDatum() for providing the parameter values to display in the TOWGS84[…] element of Well Known Text (WKT) version 1. Note that WKT version 2 does not have TOWGS84[…] element anymore.
  3. Specified at DefaultGeodeticDatum construction time for arbitrary target datum. Apache SIS will ignore those Bursa-Wolf parameters, except as a fallback if no parameters can been found in the EPSG database for a given pair of source and target CRS.
Note: In EPSG terminology, Apache SIS gives precedence to the late-binding approach (case 1 above) over the early-binding approach (case 3 above).

Most used methods

  • getTargetDatum
    Returns the target datum for this set of parameters, or null if unknown. This is usually the WGS 84
  • isIdentity
    Returns true if a transformation built from this set of parameters would perform no operation. This
  • isTranslation
    Returns true if a transformation built from this set of parameters would perform only a translation.
  • <init>
    Creates a new instance for the given target datum and domain of validity. All numerical parameters a
  • equals
    Compares the specified object with this object for equality.
  • getDomainOfValidity
    Returns the region or timeframe in which a coordinate transformation based on those Bursa-Wolf param
  • getPositionVectorTransformation
    Returns the position vector transformation (geocentric domain) as an affine transform. For transform
  • getValues
    Returns the parameter values. The length of the returned array depends on the values: * If this inst
  • setPositionVectorTransformation
    Sets all Bursa-Wolf parameters from the given Position Vector transformation matrix. The matrix sha
  • setValues
    Sets the parameters to the given values. The given array can have any length. The first array elemen
  • verify
    Verifies parameters validity after initialization of DefaultGeodeticDatum. This method requires that
  • clone
    Returns a copy of this object.
  • verify,
  • clone,
  • getNumber,
  • hashCode,
  • invert,
  • isToWGS84,
  • param,
  • period,
  • reverseRotation,
  • toString

Popular in Java

  • Start an intent from android
  • addToBackStack (FragmentTransaction)
  • onCreateOptionsMenu (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top 12 Jupyter Notebook extensions
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