Search in sources :

Example 31 with LineStringEditor

use of com.revolsys.geometry.model.editor.LineStringEditor in project com.revolsys.open by revolsys.

the class LinearRingEditorTest method testSetY.

@Test
public void testSetY() {
    final LineStringEditor lineEditor = LINE_STRING.newGeometryEditor(3);
    lineEditor.setY(0, 10);
    final LineString newLineString = lineEditor.newGeometry();
    Assert.assertNotSame(LINE_STRING, newLineString);
    Assert.assertEquals(10.0, newLineString.getY(0), 0.0);
}
Also used : LineString(com.revolsys.geometry.model.LineString) LineStringEditor(com.revolsys.geometry.model.editor.LineStringEditor) Test(org.junit.Test)

Example 32 with LineStringEditor

use of com.revolsys.geometry.model.editor.LineStringEditor in project com.revolsys.open by revolsys.

the class LineStringEditorTest method testInsertVertices.

@Test
public void testInsertVertices() {
    final LineStringEditor lineEditor = LINE_STRING.newGeometryEditor(3);
    lineEditor.setZ(0, 10);
    final LineString newLineString = lineEditor.newGeometry();
    Assert.assertNotSame(LINE_STRING, newLineString);
    Assert.assertEquals(10.0, newLineString.getZ(0), 0.0);
}
Also used : LineString(com.revolsys.geometry.model.LineString) LineStringEditor(com.revolsys.geometry.model.editor.LineStringEditor) Test(org.junit.Test)

Example 33 with LineStringEditor

use of com.revolsys.geometry.model.editor.LineStringEditor in project com.revolsys.open by revolsys.

the class LineStringEditorTest method testInvalidIndex.

@Test
public void testInvalidIndex() {
    final LineStringEditor lineEditor = LINE_STRING.newGeometryEditor();
    try {
        lineEditor.setZ(new int[0], 13);
        Assert.fail("Invalid index should cause exception");
    } catch (final Exception e) {
    }
}
Also used : LineStringEditor(com.revolsys.geometry.model.editor.LineStringEditor) Test(org.junit.Test)

Example 34 with LineStringEditor

use of com.revolsys.geometry.model.editor.LineStringEditor in project com.revolsys.open by revolsys.

the class LineStringEditorTest method testSetM.

@Test
public void testSetM() {
    final LineStringEditor lineEditor = LINE_STRING.newGeometryEditor(4);
    lineEditor.setM(0, 10);
    final LineString newLineString = lineEditor.newGeometry();
    Assert.assertNotSame(LINE_STRING, newLineString);
    Assert.assertEquals(10.0, newLineString.getM(0), 0.0);
}
Also used : LineString(com.revolsys.geometry.model.LineString) LineStringEditor(com.revolsys.geometry.model.editor.LineStringEditor) Test(org.junit.Test)

Example 35 with LineStringEditor

use of com.revolsys.geometry.model.editor.LineStringEditor in project com.revolsys.open by revolsys.

the class LineStringEditorTest method testSetY.

@Test
public void testSetY() {
    final LineStringEditor lineEditor = LINE_STRING.newGeometryEditor(3);
    lineEditor.setY(0, 10);
    final LineString newLineString = lineEditor.newGeometry();
    Assert.assertNotSame(LINE_STRING, newLineString);
    Assert.assertEquals(10.0, newLineString.getY(0), 0.0);
}
Also used : LineString(com.revolsys.geometry.model.LineString) LineStringEditor(com.revolsys.geometry.model.editor.LineStringEditor) Test(org.junit.Test)

Aggregations

LineStringEditor (com.revolsys.geometry.model.editor.LineStringEditor)35 LineString (com.revolsys.geometry.model.LineString)13 Test (org.junit.Test)13 Point (com.revolsys.geometry.model.Point)11 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)5 ArrayList (java.util.ArrayList)3 TopologyException (com.revolsys.geometry.model.TopologyException)1 AbstractPoint (com.revolsys.geometry.model.impl.AbstractPoint)1 PreparedLineString (com.revolsys.geometry.model.prep.PreparedLineString)1 ArcLineString (com.revolsys.record.io.format.saif.geometry.ArcLineString)1 List (java.util.List)1 TreeMap (java.util.TreeMap)1