Search in sources :

Example 31 with Punctual

use of com.revolsys.geometry.model.Punctual in project com.revolsys.open by revolsys.

the class MiscellaneousTest method testLineStringGetBoundary1.

/**
 * @todo Enable when #isSimple implemented
 */
// public void testLineStringIsSimple1() throws Exception {
// Geometry g = reader.read("LINESTRING(10 10, 20 10, 15 20)");
// assertTrue(g.isSimple());
// }
public void testLineStringGetBoundary1() throws Exception {
    final LineString g = (LineString) this.geometryFactory.geometry("LINESTRING(10 10, 20 10, 15 20)");
    assertTrue(g.getBoundary() instanceof Punctual);
    final Punctual boundary = (Punctual) g.getBoundary();
    assertTrue(boundary.getPoint(0).equals(g.getFromPoint()));
    assertTrue(boundary.getPoint(1).equals(g.getToPoint()));
}
Also used : Punctual(com.revolsys.geometry.model.Punctual) LineString(com.revolsys.geometry.model.LineString)

Aggregations

Punctual (com.revolsys.geometry.model.Punctual)31 Point (com.revolsys.geometry.model.Point)17 LineString (com.revolsys.geometry.model.LineString)11 Lineal (com.revolsys.geometry.model.Lineal)11 Polygon (com.revolsys.geometry.model.Polygon)11 Polygonal (com.revolsys.geometry.model.Polygonal)9 Geometry (com.revolsys.geometry.model.Geometry)8 Test (org.junit.Test)7 BoundingBox (com.revolsys.geometry.model.BoundingBox)6 LinearRing (com.revolsys.geometry.model.LinearRing)6 PunctualEditor (com.revolsys.geometry.model.editor.PunctualEditor)6 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)4 ArrayList (java.util.ArrayList)2 DataType (com.revolsys.datatype.DataType)1 Edge (com.revolsys.geometry.graph.Edge)1 LineStringDouble (com.revolsys.geometry.model.impl.LineStringDouble)1 PointDoubleXY (com.revolsys.geometry.model.impl.PointDoubleXY)1 LineSegment (com.revolsys.geometry.model.segment.LineSegment)1 LineSegmentDoubleGF (com.revolsys.geometry.model.segment.LineSegmentDoubleGF)1 BaseCloseable (com.revolsys.io.BaseCloseable)1