Search in sources :

Example 36 with Lineal

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

the class BoundingBoxTest method testMultiLineString.

@Test
public void testMultiLineString() {
    for (final GeometryFactory geometryFactory : GEOMETRY_FACTORIES) {
        final Lineal empty = geometryFactory.lineal();
        final BoundingBox boundingBoxEmpty = empty.getBoundingBox();
        assertBoundingBox(empty, boundingBoxEmpty, geometryFactory, true, 2, NULL_BOUNDS);
        final Lineal geometry1 = geometryFactory.lineal(2, new double[][] { { 3.0, 4.0, 1.0, 2.0 }, { 7.0, 8.0, 5.0, 6.0 } });
        final BoundingBox boundingBox1 = geometry1.getBoundingBox();
        assertBoundingBox(geometry1, boundingBox1, geometryFactory, false, 2, 1.0, 2.0, 7.0, 8.0);
    }
}
Also used : GeometryFactory(com.revolsys.geometry.model.GeometryFactory) Lineal(com.revolsys.geometry.model.Lineal) BoundingBox(com.revolsys.geometry.model.BoundingBox) Test(org.junit.Test)

Example 37 with Lineal

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

the class MultiLineStringEditorTest method testSetM.

@Test
public void testSetM() {
    final LinealEditor editor = LINEAL.newGeometryEditor(4);
    editor.setM(1, 1, 10);
    final Lineal newGeometry = editor.newGeometry();
    Assert.assertNotSame(LINEAL, newGeometry);
    Assert.assertEquals(10.0, newGeometry.getM(1, 1), 0.0);
}
Also used : LinealEditor(com.revolsys.geometry.model.editor.LinealEditor) Lineal(com.revolsys.geometry.model.Lineal) Test(org.junit.Test)

Example 38 with Lineal

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

the class MultiLineStringEditorTest method testSetX.

@Test
public void testSetX() {
    final LinealEditor editor = LINEAL.newGeometryEditor(3);
    editor.setX(1, 1, 10);
    final Lineal newGeometry = editor.newGeometry();
    Assert.assertNotSame(LINEAL, newGeometry);
    Assert.assertEquals(10.0, newGeometry.getX(1, 1), 0.0);
}
Also used : LinealEditor(com.revolsys.geometry.model.editor.LinealEditor) Lineal(com.revolsys.geometry.model.Lineal) Test(org.junit.Test)

Aggregations

Lineal (com.revolsys.geometry.model.Lineal)38 LineString (com.revolsys.geometry.model.LineString)20 Point (com.revolsys.geometry.model.Point)19 Polygon (com.revolsys.geometry.model.Polygon)11 Punctual (com.revolsys.geometry.model.Punctual)11 Polygonal (com.revolsys.geometry.model.Polygonal)9 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)8 LinearRing (com.revolsys.geometry.model.LinearRing)7 Test (org.junit.Test)7 LinealEditor (com.revolsys.geometry.model.editor.LinealEditor)6 BoundingBox (com.revolsys.geometry.model.BoundingBox)5 Geometry (com.revolsys.geometry.model.Geometry)5 ArrayList (java.util.ArrayList)4 QuadEdgeDelaunayTinBuilder (com.revolsys.elevation.tin.quadedge.QuadEdgeDelaunayTinBuilder)2 Edge (com.revolsys.geometry.graph.Edge)2 AbstractLineString (com.revolsys.geometry.model.impl.AbstractLineString)2 LinkedList (java.util.LinkedList)2 List (java.util.List)2 NoSuchElementException (java.util.NoSuchElementException)2 DataType (com.revolsys.datatype.DataType)1