Search in sources :

Example 16 with LineStringEditor

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

the class LineStringEditorTest method testSetZ.

@Test
public void testSetZ() {
    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 17 with LineStringEditor

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

the class LinearRingEditorTest method testNotModified.

@Test
public void testNotModified() {
    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 18 with LineStringEditor

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

the class LinearRingEditorTest method testSetZ.

@Test
public void testSetZ() {
    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 19 with LineStringEditor

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

the class LinearRingEditorTest method testSetCoordinates.

@Test
public void testSetCoordinates() {
    for (int i = 0; i < 4; i++) {
        final LineStringEditor lineEditor = LINE_STRING.newGeometryEditor(4);
        final int newValue = i * 10;
        lineEditor.setCoordinate(0, i, newValue);
        final LineString newLineString = lineEditor.newGeometry();
        Assert.assertNotSame(LINE_STRING, newLineString);
        Assert.assertEquals(newValue, newLineString.getCoordinate(0, i), 0.0);
    }
}
Also used : LineString(com.revolsys.geometry.model.LineString) LineStringEditor(com.revolsys.geometry.model.editor.LineStringEditor) Test(org.junit.Test)

Example 20 with LineStringEditor

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

the class LinearRingEditorTest method testSetX.

@Test
public void testSetX() {
    final LineStringEditor lineEditor = LINE_STRING.newGeometryEditor(3);
    lineEditor.setX(0, 10);
    final LineString newLineString = lineEditor.newGeometry();
    Assert.assertNotSame(LINE_STRING, newLineString);
    Assert.assertEquals(10.0, newLineString.getX(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