/** * 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(); }
/** * 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(); }
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()) {
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()) {
String name = IdentifiedObjects.getUnicodeIdentifier(getTargetDatum()); if (name == null) { name = "Unknown";
String name = IdentifiedObjects.getSimpleNameOrIdentifier(getTargetDatum()); if (name == null) { name = "Unknown";
/** * 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); }
/** * 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()); }