use of com.revolsys.geometry.model.Polygonal in project com.revolsys.open by revolsys.
the class NormalizeTest method testNormalizeMultiPolygon.
public void testNormalizeMultiPolygon() throws Exception {
Polygonal actualValue = (Polygonal) this.geometryFactory.geometry("MULTIPOLYGON(((40 360,40 280,140 280,140 360,40 360),(60 340,60 300,120 300,120 340,60 340)),((140 200,260 200,260 100,140 100,140 200),(160 180,240 180,240 120,160 120,160 180)))");
actualValue = actualValue.normalize();
final Polygonal expectedValue = (Polygonal) this.geometryFactory.geometry("MULTIPOLYGON(((40 280,40 360,140 360,140 280,40 280),(60 300,120 300,120 340,60 340,60 300)),((140 100,140 200,260 200,260 100,140 100),(160 120,240 120,240 180,160 180,160 120)))");
assertEqualsExact(expectedValue, actualValue);
}
use of com.revolsys.geometry.model.Polygonal in project com.revolsys.open by revolsys.
the class GeometryTestUtil method multiPolygon.
public static Polygonal multiPolygon(final GeometryFactory geometryFactory, final int geometryCount, final int ringCount, final double delta) {
final List<Geometry> geometries = new ArrayList<>();
for (int i = 0; i < geometryCount; i++) {
final Geometry geometry = polygon(geometryFactory, ringCount, delta * (i + 1));
geometries.add(geometry);
}
final Polygonal multiGeometry = geometryFactory.polygonal(geometries);
return multiGeometry;
}
use of com.revolsys.geometry.model.Polygonal in project com.revolsys.open by revolsys.
the class MultiPolygonEditorTest method testSetZ.
@Test
public void testSetZ() {
final PolygonalEditor editor = POLYGONAL.newGeometryEditor(3);
editor.setZ(1, 1, 1, 10);
final Polygonal newGeometry = editor.newGeometry();
Assert.assertNotSame(POLYGONAL, newGeometry);
Assert.assertEquals(10.0, newGeometry.getZ(1, 1, 1), 0.0);
}
use of com.revolsys.geometry.model.Polygonal in project com.revolsys.open by revolsys.
the class MultiPolygonEditorTest method testSetX.
@Test
public void testSetX() {
final PolygonalEditor editor = POLYGONAL.newGeometryEditor(3);
editor.setX(1, 1, 1, 10);
final Polygonal newGeometry = editor.newGeometry();
Assert.assertNotSame(POLYGONAL, newGeometry);
Assert.assertEquals(10.0, newGeometry.getX(1, 1, 1), 0.0);
}
use of com.revolsys.geometry.model.Polygonal in project com.revolsys.open by revolsys.
the class MultiPolygonEditorTest method testNotModified.
@Test
public void testNotModified() {
final PolygonalEditor editor = POLYGONAL.newGeometryEditor();
editor.setZ(new int[0], 13);
final Polygonal newGeometry = editor.newGeometry();
Assert.assertSame(POLYGONAL, newGeometry);
}
Aggregations