use of com.revolsys.geometry.model.LineString in project com.revolsys.open by revolsys.
the class NormalizeTest method testNormalizeLineString1.
// public void testNormalizeGeometryCollection() throws Exception {
// GeometryCollection actualValue =
// (GeometryCollection)geometryFactory.geometry("GEOMETRYCOLLECTION
// (LINESTRING (200 300,200 280,220 280,220 320,180 320),POINT (140
// 220),POLYGON ((100 80,100 160,20 160,20 80,100 80),(40 140,40 100,80 100,80
// 140,40 140)),POINT (100 240))");
// actualValue = actualValue.normalize();
// final GeometryCollection expectedValue =
// (GeometryCollection)geometryFactory.geometry("GEOMETRYCOLLECTION (POINT
// (100 240),POINT (140 220),LINESTRING (180 320,220 320,220 280,200 280,200
// 300),POLYGON ((20 80,20 160,100 160,100 80,20 80),(40 100,80 100,80 140,40
// 140,40 100)))");
// assertEqualsExact(expectedValue,actualValue);
// }
public void testNormalizeLineString1() throws Exception {
LineString l = (LineString) this.geometryFactory.geometry("LINESTRING(20 20,160 40,160 100,100 120,60 60)");
l = l.normalize();
final LineString expectedValue = (LineString) this.geometryFactory.geometry("LINESTRING(20 20,160 40,160 100,100 120,60 60)");
assertEqualsExact(expectedValue, l);
}
use of com.revolsys.geometry.model.LineString in project com.revolsys.open by revolsys.
the class NormalizeTest method testNormalizeLineString4.
public void testNormalizeLineString4() throws Exception {
LineString l = (LineString) this.geometryFactory.geometry("LINESTRING(200 240,140 160,80 160,160 80,80 80)");
l = l.normalize();
final LineString expectedValue = (LineString) this.geometryFactory.geometry("LINESTRING(80 80,160 80,80 160,140 160,200 240)");
assertEqualsExact(expectedValue, l);
}
use of com.revolsys.geometry.model.LineString in project com.revolsys.open by revolsys.
the class RectanglePredicateTest method testAngleOnBoundary.
@Test
public void testAngleOnBoundary() throws Exception {
final Polygon polygon = this.geometryFactory.polygon(2, 10.0, 10, 30, 10, 30, 30, 10, 30, 10, 10);
final LineString line = this.geometryFactory.lineString(2, 10.0, 30, 10, 10, 30, 10);
runRectanglePred(polygon, line);
}
use of com.revolsys.geometry.model.LineString in project com.revolsys.open by revolsys.
the class PreparedPolygonIntersectsStressTest method test.
public void test(final Geometry g) {
int count = 0;
while (count < MAX_ITER) {
count++;
final LineString line = newTestLine(g.getBoundingBox(), 10, 20);
// System.out.println("Test # " + count);
// System.out.println(line);
testResultsEqual(g, line);
}
}
use of com.revolsys.geometry.model.LineString in project com.revolsys.open by revolsys.
the class TriangleFunctions method angleBisectors.
public static Geometry angleBisectors(final Geometry g) {
final Point[] pts = trianglePts(g);
final Point cc = Triangles.inCentre(pts[0], pts[1], pts[2]);
final GeometryFactory geomFact = FunctionsUtil.getFactoryOrDefault(g);
final LineString[] line = new LineString[3];
line[0] = geomFact.lineString(pts[0], cc);
line[1] = geomFact.lineString(pts[1], cc);
line[2] = geomFact.lineString(pts[2], cc);
return geomFact.lineal(line);
}
Aggregations