use of com.revolsys.geometry.model.Lineal in project com.revolsys.open by revolsys.
the class MultiLineStringEditorTest method testSetY.
@Test
public void testSetY() {
final LinealEditor editor = LINEAL.newGeometryEditor(3);
editor.setY(1, 1, 10);
final Lineal newGeometry = editor.newGeometry();
Assert.assertNotSame(LINEAL, newGeometry);
Assert.assertEquals(10.0, newGeometry.getY(1, 1), 0.0);
}
use of com.revolsys.geometry.model.Lineal in project com.revolsys.open by revolsys.
the class MultiLineStringEditorTest method testNotModified.
@Test
public void testNotModified() {
final LinealEditor editor = LINEAL.newGeometryEditor();
editor.setZ(new int[0], 13);
final Lineal newGeometry = editor.newGeometry();
Assert.assertSame(LINEAL, newGeometry);
}
use of com.revolsys.geometry.model.Lineal in project com.revolsys.open by revolsys.
the class MultiLineStringEditorTest method testSetCoordinates.
@Test
public void testSetCoordinates() {
for (int i = 0; i < 4; i++) {
final LinealEditor editor = LINEAL.newGeometryEditor(4);
final double newValue = LINEAL.getCoordinate(1, 1, i);
editor.setCoordinate(1, 1, i, newValue);
final Lineal newGeometry = editor.newGeometry();
Assert.assertNotSame(LINEAL, newGeometry);
Assert.assertEquals(newValue, newGeometry.getCoordinate(1, 1, i), 0.0);
}
}
use of com.revolsys.geometry.model.Lineal in project com.revolsys.open by revolsys.
the class MultiLineStringEditorTest method testSetZ.
@Test
public void testSetZ() {
final LinealEditor editor = LINEAL.newGeometryEditor(3);
editor.setZ(1, 1, 10);
final Lineal newGeometry = editor.newGeometry();
Assert.assertNotSame(LINEAL, newGeometry);
Assert.assertEquals(10.0, newGeometry.getZ(1, 1), 0.0);
}
use of com.revolsys.geometry.model.Lineal in project com.revolsys.open by revolsys.
the class GeometryFactoryTest method testCreateGeometry.
private static void testCreateGeometry() {
final LineString pointPoints = new LineStringDouble(2, 0.0, 0);
final LineString point2Points = new LineStringDouble(2, 20.0, 20);
final LineString ringPoints = new LineStringDouble(2, 0.0, 0, 0, 100, 100, 100, 100, 0, 0, 0);
final LineString ring2Points = new LineStringDouble(2, 20.0, 20, 20, 80, 80, 80, 80, 20, 20, 20);
final LineString ring3Points = new LineStringDouble(2, 120.0, 120, 120, 180, 180, 180, 180, 120, 120, 120);
final Point point = GEOMETRY_FACTORY.point(2, 0.0, 0);
assertCopyGeometry(point, pointPoints);
final LineString line = GEOMETRY_FACTORY.lineString(ringPoints);
assertCopyGeometry(line, ringPoints);
final LinearRing linearRing = GEOMETRY_FACTORY.linearRing(ringPoints);
assertCopyGeometry(linearRing, ringPoints);
final Polygon polygon = GEOMETRY_FACTORY.polygon(ringPoints);
assertCopyGeometry(polygon, ringPoints);
final Polygon polygon2 = GEOMETRY_FACTORY.polygon(ringPoints, ring2Points);
assertCopyGeometry(polygon2, ringPoints, ring2Points);
final Punctual multiPoint = GEOMETRY_FACTORY.punctual(pointPoints);
assertCopyGeometry(multiPoint, pointPoints);
final Punctual multiPoint2 = GEOMETRY_FACTORY.punctual(pointPoints, point2Points);
assertCopyGeometry(multiPoint2, pointPoints, point2Points);
final Lineal multiLineString = GEOMETRY_FACTORY.lineal(ringPoints);
assertCopyGeometry(multiLineString, ringPoints);
final Lineal multiLineString2 = GEOMETRY_FACTORY.lineal(ringPoints, ring2Points);
assertCopyGeometry(multiLineString2, ringPoints, ring2Points);
final Polygonal multiPolygon = GEOMETRY_FACTORY.polygonal(ringPoints);
assertCopyGeometry(multiPolygon, ringPoints);
final Polygonal multiPolygon2 = GEOMETRY_FACTORY.polygonal(ringPoints, ring3Points);
assertCopyGeometry(multiPolygon2, ringPoints, ring3Points);
}
Aggregations