use of com.revolsys.geometry.model.Punctual in project com.revolsys.open by revolsys.
the class MultiPointImplTest method testEquals.
/**
* @todo Enable when #isSimple implemented
*/
// public void testIsSimple1() throws Exception {
// MultiPoint m = (MultiPoint)
// reader.read("MULTIPOINT(1.111 2.222, 3.333 4.444, 5.555 6.666)");
// assertTrue(m.isSimple());
// }
public void testEquals() throws Exception {
final Punctual m1 = (Punctual) this.geometryFactory.geometry("MULTIPOINT((5 6), (7 8))");
final Punctual m2 = (Punctual) this.geometryFactory.geometry("MULTIPOINT((5 6), (7 8))");
assertTrue(m1.equals(m2));
}
use of com.revolsys.geometry.model.Punctual in project com.revolsys.open by revolsys.
the class GeoJsonRecordWriter method geometry.
private void geometry(final Geometry geometry) {
this.out.startObject();
if (geometry instanceof Point) {
final Point point = (Point) geometry;
point(point);
} else if (geometry instanceof LineString) {
final LineString line = (LineString) geometry;
line(line);
} else if (geometry instanceof Polygon) {
final Polygon polygon = (Polygon) geometry;
polygon(polygon);
} else if (geometry instanceof Punctual) {
final Punctual punctual = (Punctual) geometry;
multiPoint(punctual);
} else if (geometry instanceof Lineal) {
final Lineal lineal = (Lineal) geometry;
multiLineString(lineal);
} else if (geometry instanceof Polygonal) {
final Polygonal polygonal = (Polygonal) geometry;
multiPolygon(polygonal);
} else if (geometry.isGeometryCollection()) {
geometryCollection(geometry);
}
this.out.endObject();
}
use of com.revolsys.geometry.model.Punctual in project com.revolsys.open by revolsys.
the class MultiPointEditorTest method testNotModified.
@Test
public void testNotModified() {
final PunctualEditor editor = PUNCTUAL.newGeometryEditor();
editor.setZ(new int[0], 13);
final Punctual newMultiPoint = editor.newGeometry();
Assert.assertSame(PUNCTUAL, newMultiPoint);
}
use of com.revolsys.geometry.model.Punctual in project com.revolsys.open by revolsys.
the class MultiPointEditorTest method testSetX.
@Test
public void testSetX() {
final PunctualEditor editor = PUNCTUAL.newGeometryEditor(3);
editor.setX(0, 10);
final Punctual newMultiPoint = editor.newGeometry();
Assert.assertNotSame(PUNCTUAL, newMultiPoint);
Assert.assertEquals(10.0, newMultiPoint.getX(0), 0.0);
}
use of com.revolsys.geometry.model.Punctual in project com.revolsys.open by revolsys.
the class MultiPointEditorTest method testSetCoordinates.
@Test
public void testSetCoordinates() {
for (int i = 0; i < 4; i++) {
final PunctualEditor editor = PUNCTUAL.newGeometryEditor(4);
final int newValue = i * 10;
editor.setCoordinate(0, i, newValue);
final Punctual newMultiPoint = editor.newGeometry();
Assert.assertNotSame(PUNCTUAL, newMultiPoint);
Assert.assertEquals(newValue, newMultiPoint.getCoordinate(0, i), 0.0);
}
}
Aggregations