org.apache.sis.test.Assert.assertAxisDirectionsEqual()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中org.apache.sis.test.Assert.assertAxisDirectionsEqual()方法的一些代码示例,展示了Assert.assertAxisDirectionsEqual()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.assertAxisDirectionsEqual()方法的具体详情如下:
包路径:org.apache.sis.test.Assert
类名称:Assert
方法名:assertAxisDirectionsEqual

Assert.assertAxisDirectionsEqual介绍

暂无

代码示例

代码示例来源:origin: apache/sis

/**
 * Tests {@link DefaultPolarCS#forConvention(AxesConvention)}
 * with a change from clockwise to counterclockwise axis orientation.
 */
@Test
public void testChangeClockwiseOrientation() {
  final DefaultPolarCS cs = HardCodedCS.POLAR;
  final DefaultPolarCS normalized = cs.forConvention(AxesConvention.DISPLAY_ORIENTED);
  assertNotSame("Should create a new CoordinateSystem.", cs, normalized);
  assertAxisDirectionsEqual("Normalized", normalized,
      AxisDirections.AWAY_FROM,
      AxisDirections.COUNTER_CLOCKWISE);
}

代码示例来源:origin: apache/sis

/**
 * Tests {@link DefaultCylindricalCS#forConvention(AxesConvention)}
 * with a change from clockwise to counterclockwise axis orientation.
 */
@Test
public void testChangeClockwiseOrientation() {
  final DefaultCylindricalCS cs = HardCodedCS.CYLINDRICAL;
  final DefaultCylindricalCS normalized = cs.forConvention(AxesConvention.DISPLAY_ORIENTED);
  assertNotSame("Should create a new CoordinateSystem.", cs, normalized);
  assertAxisDirectionsEqual("Normalized", normalized,
      AxisDirections.AWAY_FROM,
      AxisDirections.COUNTER_CLOCKWISE,
      AxisDirection.UP);
}

代码示例来源:origin: apache/sis

/**
   * Tests {@link DefaultPolarCS#forConvention(AxesConvention)} with a change of axis order.
   * This test uses a (r) axis oriented toward South instead than "awayFrom".
   */
  @Test
  public void testChangeAxisOrder() {
    final DefaultCoordinateSystemAxis radius = HardCodedAxes.create("Radius", "r",
        AxisDirection.SOUTH, Units.METRE, 0, Double.POSITIVE_INFINITY, RangeMeaning.EXACT);

    final DefaultPolarCS cs = new DefaultPolarCS(
        Collections.singletonMap(DefaultPolarCS.NAME_KEY, "Polar"),
        HardCodedAxes.BEARING,
        radius);

    DefaultPolarCS normalized = cs.forConvention(AxesConvention.RIGHT_HANDED);
    assertNotSame("Should create a new CoordinateSystem.", cs, normalized);
    assertAxisDirectionsEqual("Right-handed", normalized,
        AxisDirections.CLOCKWISE,                       // Interchanged (r,θ) order for making right handed.
        AxisDirection.SOUTH);

    normalized = cs.forConvention(AxesConvention.NORMALIZED);
    assertNotSame("Should create a new CoordinateSystem.", cs, normalized);
    assertAxisDirectionsEqual("Normalized", normalized,
        AxisDirection.SOUTH,                            // Not modified to North because radius can not be negative.
        AxisDirections.COUNTER_CLOCKWISE);
  }
}

代码示例来源:origin: apache/sis

/**
   * Tests {@link DefaultCylindricalCS#forConvention(AxesConvention)} with a change of axis order.
   * This test uses a (r) axis oriented toward South instead than "awayFrom".
   */
  @Test
  public void testChangeAxisOrder() {
    final DefaultCoordinateSystemAxis radius = HardCodedAxes.create("Radius", "r",
        AxisDirection.SOUTH, Units.METRE, 0, Double.POSITIVE_INFINITY, RangeMeaning.EXACT);

    final DefaultCylindricalCS cs = new DefaultCylindricalCS(
        Collections.singletonMap(DefaultCylindricalCS.NAME_KEY, "Cylindrical"),
        HardCodedAxes.BEARING,
        HardCodedAxes.Z,
        radius);

    DefaultCylindricalCS normalized = cs.forConvention(AxesConvention.RIGHT_HANDED);
    assertNotSame("Should create a new CoordinateSystem.", cs, normalized);
    assertAxisDirectionsEqual("Right-handed", normalized,
        AxisDirections.CLOCKWISE,                       // Interchanged (r,θ) order for making right handed.
        AxisDirection.SOUTH,
        AxisDirection.UP);

    normalized = cs.forConvention(AxesConvention.NORMALIZED);
    assertNotSame("Should create a new CoordinateSystem.", cs, normalized);
    assertAxisDirectionsEqual("Normalized", normalized,
        AxisDirection.SOUTH,                            // Not modified to North because radius can not be negative.
        AxisDirections.COUNTER_CLOCKWISE,
        AxisDirection.UP);
  }
}

代码示例来源:origin: apache/sis

/**
 * Tests the creation of the {@code "+init=epsg:4326"} geographic CRS.
 * Note that the axis order is not the same than standard EPSG:4326.
 *
 * @throws FactoryException if an error occurred while creating the CRS objects.
 */
@Test
public void test4326() throws FactoryException {
  final Proj4Factory factory = Proj4Factory.INSTANCE;
  final GeographicCRS crs = factory.createGeographicCRS("+init=epsg:4326");
  final PJ pj = (PJ) TestUtilities.getSingleton(crs.getIdentifiers());
  assertEquals(PJ.Type.GEOGRAPHIC, pj.getType());
  final String definition = pj.getCode();
  assertTrue(definition, definition.contains("+proj=longlat"));
  assertTrue(definition, definition.contains("+datum=WGS84"));
  assertAxisDirectionsEqual(definition, crs.getCoordinateSystem(), AxisDirection.EAST, AxisDirection.NORTH);
}

代码示例来源:origin: apache/sis

/**
 * Tests the creation of the {@code "+init=epsg:3395"} projected CRS.
 *
 * @throws FactoryException if an error occurred while creating the CRS objects.
 */
@Test
public void test3395() throws FactoryException {
  final Proj4Factory factory = Proj4Factory.INSTANCE;
  final ProjectedCRS crs = factory.createProjectedCRS("+init=epsg:3395");
  final PJ pj = (PJ) TestUtilities.getSingleton(crs.getIdentifiers());
  assertEquals(PJ.Type.PROJECTED, pj.getType());
  final String definition = pj.getCode();
  assertTrue(definition, definition.contains("+proj=merc"));
  assertTrue(definition, definition.contains("+datum=WGS84"));
  assertAxisDirectionsEqual(definition, crs.getCoordinateSystem(), AxisDirection.EAST, AxisDirection.NORTH);
}

代码示例来源:origin: apache/sis

/**
 * Validates the parsed CRS.
 */
private static void validate(final GeographicCRS crs) {
  assertEquals("NTF (Paris)", crs.getName().getCode());
  assertEquals("Nouvelle Triangulation Francaise (Paris)", crs.getDatum().getName().getCode());
  assertAxisDirectionsEqual("EllipsoidalCS", crs.getCoordinateSystem(), AxisDirection.NORTH, AxisDirection.EAST);
}

代码示例来源:origin: apache/sis

/**
 * Tests a spherical CRS conforms to EPSG:8.9:6404 definition.
 * Expected axes are:
 *
 * <ol>
 *   <li>Spherical latitude (Ω)</li>
 *   <li>Spherical longitude (θ)</li>
 *   <li>Geocentric radius (R)</li>
 * </ol>
 */
@Test
public void testGeodetic() {
  final DefaultSphericalCS cs = HardCodedCS.SPHERICAL;
  assertEquals("EPSG abbreviation for geocentric radius should be lower-case", "r", cs.getAxis(2).getAbbreviation());
  final DefaultSphericalCS normalized = cs.forConvention(AxesConvention.DISPLAY_ORIENTED);
  assertNotSame("Should create a new CoordinateSystem.", cs, normalized);
  assertAxisDirectionsEqual("Normalized", normalized,
      AxisDirection.EAST,
      AxisDirection.NORTH,
      AxisDirection.UP);
  assertEquals(new DefaultSphericalCS(
      Collections.singletonMap(AbstractCS.NAME_KEY, "Spherical CS: East (°), North (°), Up (m)."),
      HardCodedAxes.SPHERICAL_LONGITUDE,
      HardCodedAxes.SPHERICAL_LATITUDE,
      HardCodedAxes.GEOCENTRIC_RADIUS), normalized);
}

代码示例来源:origin: apache/sis

/**
   * Tests a spherical CRS conforms to the example given in ISO 19162.
   * Expected axes are:
   *
   * <ol>
   *   <li>Distance (r)</li>
   *   <li>Longitude</li>
   *   <li>Elevation</li>
   * </ol>
   *
   * This order is not exactly the usual engineering axis order.
   * But this is the order expected by the {@code SphericalToCartesian} transform.
   */
  @Test
  public void testEngineering() {
    final DefaultSphericalCS cs = HardCodedCS.SPHERICAL_ENGINEERING;
    assertEquals("Abbreviation for distance should be lower-case", "r", cs.getAxis(0).getAbbreviation());

    final DefaultSphericalCS normalized = cs.forConvention(AxesConvention.NORMALIZED);
    assertNotSame("Should create a new CoordinateSystem.", cs, normalized);
    assertAxisDirectionsEqual("Normalized", normalized,
        AxisDirections.COUNTER_CLOCKWISE,
        AxisDirection.UP,
        AxisDirections.AWAY_FROM);
  }
}

代码示例来源:origin: apache/sis

assertEqualsIgnoreMetadata(temporal, components[0]);
assertInstanceOf("Shall be a three-dimensional geographic CRS.", GeographicCRS.class, components[1]);
assertAxisDirectionsEqual("Shall be a three-dimensional geographic CRS.",
    ((CoordinateReferenceSystem) components[1]).getCoordinateSystem(),
    AxisDirection.UP, AxisDirection.NORTH, AxisDirection.EAST);

代码示例来源:origin: apache/sis

assertEqualsIgnoreMetadata(temporal, components[0]);
assertInstanceOf("Shall be a three-dimensional projected CRS.", ProjectedCRS.class, components[1]);
assertAxisDirectionsEqual("Shall be a three-dimensional projected CRS.",
    ((CoordinateReferenceSystem) components[1]).getCoordinateSystem(),
    AxisDirection.UP, AxisDirection.EAST, AxisDirection.NORTH);

相关文章