Search in sources :

Example 16 with ArcByCenterPoint

use of eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint in project hale by halestudio.

the class GridInterpolationTest method test90Deegrees.

@Test
public void test90Deegrees() throws IOException {
    ArcByCenterPoint arc = new ArcByCenterPointImpl(new Coordinate(0, 0), Math.sqrt(2.0), Angle.fromDegrees(45), Angle.fromDegrees(135), false);
    gridInterpolationTest(arc, 0.1, false);
}
Also used : ArcByCenterPoint(eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint) Coordinate(com.vividsolutions.jts.geom.Coordinate) ArcByCenterPointImpl(eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl) AbstractArcTest(eu.esdihumboldt.util.geometry.interpolation.AbstractArcTest) Test(org.junit.Test)

Example 17 with ArcByCenterPoint

use of eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint in project hale by halestudio.

the class GridInterpolationTest method testOffsetBig.

@Test
public void testOffsetBig() throws IOException {
    ArcByCenterPoint arc = new ArcByCenterPointImpl(new Coordinate(2, 2), 15.0, Angle.fromDegrees(45), Angle.fromDegrees(135), true);
    gridInterpolationTest(arc, 0.1, false);
}
Also used : ArcByCenterPoint(eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint) Coordinate(com.vividsolutions.jts.geom.Coordinate) ArcByCenterPointImpl(eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl) AbstractArcTest(eu.esdihumboldt.util.geometry.interpolation.AbstractArcTest) Test(org.junit.Test)

Example 18 with ArcByCenterPoint

use of eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint in project hale by halestudio.

the class GridInterpolationTest method testHalfCircleAllGrid.

@Test
public void testHalfCircleAllGrid() throws IOException {
    ArcByCenterPoint arc = new ArcByCenterPointImpl(new Coordinate(0.5, 0.5), 0.95, Angle.fromDegrees(0), Angle.fromDegrees(180), true);
    gridInterpolationTest(arc, 0.1, true);
}
Also used : ArcByCenterPoint(eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint) Coordinate(com.vividsolutions.jts.geom.Coordinate) ArcByCenterPointImpl(eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl) AbstractArcTest(eu.esdihumboldt.util.geometry.interpolation.AbstractArcTest) Test(org.junit.Test)

Example 19 with ArcByCenterPoint

use of eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint in project hale by halestudio.

the class GridInterpolationTest method testOffsetCircle.

@Test
public void testOffsetCircle() throws IOException {
    ArcByCenterPoint arc = new ArcByCenterPointImpl(new Coordinate(2, 2), 5.0, Angle.fromDegrees(0), Angle.fromDegrees(0), true);
    gridInterpolationTest(arc, 0.1, false);
}
Also used : ArcByCenterPoint(eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint) Coordinate(com.vividsolutions.jts.geom.Coordinate) ArcByCenterPointImpl(eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl) AbstractArcTest(eu.esdihumboldt.util.geometry.interpolation.AbstractArcTest) Test(org.junit.Test)

Example 20 with ArcByCenterPoint

use of eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint in project hale by halestudio.

the class ArcByCenterPointImplTest method testCW2.

@Test
public void testCW2() throws IOException {
    ArcByCenterPoint arc = new ArcByCenterPointImpl(new Coordinate(0, 0), Math.sqrt(2.0), Angle.fromDegrees(45), Angle.fromDegrees(135), true);
    drawArcWithMarkers(arc);
    assertEquals(-270.0, arc.getAngleBetween().getDegrees(), 1e-10);
    assertFalse(arc.isCircle());
    assertFalse(InterpolationUtil.isStraightLine(arc));
    ArcByPoints converted = arc.toArcByPoints();
    assertEqualsCoord(new Coordinate(1, 1), converted.getStartPoint());
    assertEqualsCoord(new Coordinate(0, -Math.sqrt(2.0)), converted.getMiddlePoint());
    assertEqualsCoord(new Coordinate(-1, 1), converted.getEndPoint());
}
Also used : ArcByPoints(eu.esdihumboldt.util.geometry.interpolation.model.ArcByPoints) ArcByCenterPoint(eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint) Coordinate(com.vividsolutions.jts.geom.Coordinate) AbstractArcTest(eu.esdihumboldt.util.geometry.interpolation.AbstractArcTest) Test(org.junit.Test)

Aggregations

ArcByCenterPoint (eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint)34 Coordinate (com.vividsolutions.jts.geom.Coordinate)28 AbstractArcTest (eu.esdihumboldt.util.geometry.interpolation.AbstractArcTest)25 Test (org.junit.Test)25 ArcByCenterPointImpl (eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl)18 ArcByPoints (eu.esdihumboldt.util.geometry.interpolation.model.ArcByPoints)15 Arc (eu.esdihumboldt.util.geometry.interpolation.model.Arc)6 Angle (eu.esdihumboldt.util.geometry.interpolation.model.Angle)4 ArcByPointsImpl (eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByPointsImpl)3 LineString (com.vividsolutions.jts.geom.LineString)1 DefaultGeometryProperty (eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty)1 GeometryNotSupportedException (eu.esdihumboldt.hale.io.gml.geometry.GeometryNotSupportedException)1 InterpolationAlgorithm (eu.esdihumboldt.util.geometry.interpolation.InterpolationAlgorithm)1 Arc2D (java.awt.geom.Arc2D)1