Search in sources :

Example 16 with ArcByCenterPointImpl

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

the class SplitInterpolationTest 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);
    splitInterpolationTest(arc, 0.1);
}
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 ArcByCenterPointImpl

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

the class ArcGridSegment method getFirstPart.

@Override
public ArcSegment getFirstPart() {
    ArcByCenterPoint byCenter = arc.toArcByCenterPoint();
    Angle middleAngle = Angle.fromRadians(byCenter.getStartAngle().getRadians() + 0.5 * byCenter.getAngleBetween().getRadians());
    Arc part = new ArcByCenterPointImpl(byCenter.getCenterPoint(), byCenter.getRadius(), byCenter.getStartAngle(), middleAngle, byCenter.isClockwise());
    // match the parent segment's
    return new FixedStartEndGridSegment(part, true, gridSize, getStartPoint(), getMiddlePoint());
}
Also used : ArcByCenterPoint(eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint) Arc(eu.esdihumboldt.util.geometry.interpolation.model.Arc) Angle(eu.esdihumboldt.util.geometry.interpolation.model.Angle) ArcByCenterPointImpl(eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl)

Example 18 with ArcByCenterPointImpl

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

the class ArcGridSegment method getSecondPart.

@Override
public ArcSegment getSecondPart() {
    ArcByCenterPoint byCenter = arc.toArcByCenterPoint();
    Angle middleAngle = Angle.fromRadians(byCenter.getStartAngle().getRadians() + 0.5 * byCenter.getAngleBetween().getRadians());
    Arc part = new ArcByCenterPointImpl(byCenter.getCenterPoint(), byCenter.getRadius(), middleAngle, byCenter.getEndAngle(), byCenter.isClockwise());
    // match the parent segment's
    return new FixedStartEndGridSegment(part, true, gridSize, getMiddlePoint(), getEndPoint());
}
Also used : ArcByCenterPoint(eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint) Arc(eu.esdihumboldt.util.geometry.interpolation.model.Arc) Angle(eu.esdihumboldt.util.geometry.interpolation.model.Angle) ArcByCenterPointImpl(eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl)

Example 19 with ArcByCenterPointImpl

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

the class ArcSplitSegment method getSecondPart.

@Override
public ArcSegment getSecondPart() {
    ArcByCenterPoint byCenter = arc.toArcByCenterPoint();
    Angle middleAngle = Angle.fromRadians(byCenter.getStartAngle().getRadians() + 0.5 * byCenter.getAngleBetween().getRadians());
    Arc part = new ArcByCenterPointImpl(byCenter.getCenterPoint(), byCenter.getRadius(), middleAngle, byCenter.getEndAngle(), byCenter.isClockwise());
    return new FixedStartEndSplitSegment(part, maxPositionalError, getMiddlePoint(), getEndPoint());
}
Also used : ArcByCenterPoint(eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint) Arc(eu.esdihumboldt.util.geometry.interpolation.model.Arc) Angle(eu.esdihumboldt.util.geometry.interpolation.model.Angle) ArcByCenterPointImpl(eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl)

Example 20 with ArcByCenterPointImpl

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

the class ArcSplitSegment method getFirstPart.

@Override
public ArcSegment getFirstPart() {
    ArcByCenterPoint byCenter = arc.toArcByCenterPoint();
    Angle middleAngle = Angle.fromRadians(byCenter.getStartAngle().getRadians() + 0.5 * byCenter.getAngleBetween().getRadians());
    Arc part = new ArcByCenterPointImpl(byCenter.getCenterPoint(), byCenter.getRadius(), byCenter.getStartAngle(), middleAngle, byCenter.isClockwise());
    return new FixedStartEndSplitSegment(part, maxPositionalError, getStartPoint(), getMiddlePoint());
}
Also used : ArcByCenterPoint(eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint) Arc(eu.esdihumboldt.util.geometry.interpolation.model.Arc) Angle(eu.esdihumboldt.util.geometry.interpolation.model.Angle) ArcByCenterPointImpl(eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl)

Aggregations

ArcByCenterPointImpl (eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl)20 ArcByCenterPoint (eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint)18 Coordinate (com.vividsolutions.jts.geom.Coordinate)16 AbstractArcTest (eu.esdihumboldt.util.geometry.interpolation.AbstractArcTest)12 Test (org.junit.Test)12 Arc (eu.esdihumboldt.util.geometry.interpolation.model.Arc)8 Angle (eu.esdihumboldt.util.geometry.interpolation.model.Angle)4 LineString (com.vividsolutions.jts.geom.LineString)3 DefaultGeometryProperty (eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty)3 GeometryNotSupportedException (eu.esdihumboldt.hale.io.gml.geometry.GeometryNotSupportedException)3 InterpolationAlgorithm (eu.esdihumboldt.util.geometry.interpolation.InterpolationAlgorithm)3 ArcByPointsImpl (eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByPointsImpl)3 Point (com.vividsolutions.jts.geom.Point)2 Instance (eu.esdihumboldt.hale.common.instance.model.Instance)2 CRSDefinition (eu.esdihumboldt.hale.common.schema.geometry.CRSDefinition)2 ParseException (java.text.ParseException)2 ArrayList (java.util.ArrayList)2