use of com.revolsys.geometry.model.GeometryFactory in project com.revolsys.open by revolsys.
the class LineStringImplTest method testEquals9.
public void testEquals9() throws Exception {
final GeometryFactory geometryFactory = GeometryFactory.fixed2d(0, 1.0, 1.0);
final Lineal l1 = (Lineal) geometryFactory.geometry("MULTILINESTRING((1732328800 519578384, 1732026179 519976285, 1731627364 519674014, 1731929984 519276112, 1732328800 519578384))");
final Lineal l2 = (Lineal) geometryFactory.geometry("MULTILINESTRING((1731627364 519674014, 1731929984 519276112, 1732328800 519578384, 1732026179 519976285, 1731627364 519674014))");
assertTrue(l1.equals(l2));
}
use of com.revolsys.geometry.model.GeometryFactory in project com.revolsys.open by revolsys.
the class LineStringImplTest method testEquals8.
public void testEquals8() throws Exception {
final GeometryFactory geometryFactory = GeometryFactory.fixed2d(0, 1000.0, 1000.0);
final Lineal l1 = (Lineal) geometryFactory.geometry("MULTILINESTRING((1732328800 519578384, 1732026179 519976285, 1731627364 519674014, 1731929984 519276112, 1732328800 519578384))");
final Lineal l2 = (Lineal) geometryFactory.geometry("MULTILINESTRING((1731627364 519674014, 1731929984 519276112, 1732328800 519578384, 1732026179 519976285, 1731627364 519674014))");
assertTrue(l1.equals(l2));
}
use of com.revolsys.geometry.model.GeometryFactory in project com.revolsys.open by revolsys.
the class RobustLineIntersectorTest method testA.
public void testA() {
final Point p1 = new PointDoubleXY(-123456789, -40);
final Point p2 = new PointDoubleXY(381039468754763d, 123456789);
final GeometryFactory geometryFactory = GeometryFactory.DEFAULT_3D;
final LineString l = geometryFactory.lineString(new Point[] { p1, p2 });
final Point p = geometryFactory.point(0.0, 0.0);
assertEquals(false, l.intersects(p));
assertEquals(false, geometryFactory.lineString(p1, p2).isOnLine(p));
assertEquals(-1, CGAlgorithmsDD.orientationIndex(p1, p2, p));
}
use of com.revolsys.geometry.model.GeometryFactory in project com.revolsys.open by revolsys.
the class JTSFunctions method newS.
private static Geometry newS(final Geometry g) {
final GeometryFactory gf = FunctionsUtil.getFactoryOrDefault(g);
final double centreX = WIDTH - S_RADIUS;
final Point[] top = new Point[] { new PointDoubleXY(WIDTH, HEIGHT), new PointDoubleXY(centreX, HEIGHT) };
final Point[] bottom = new Point[] { new PointDoubleXY(centreX, 0), new PointDoubleXY(WIDTH - 2 * S_RADIUS, 0) };
final GeometricShapeFactory gsf = new GeometricShapeFactory(gf);
gsf.setCentre(new PointDoubleXY(centreX, HEIGHT - S_RADIUS));
gsf.setSize(2 * S_RADIUS);
gsf.setNumPoints(10);
final LineString arcTop = gsf.newArc(0.5 * Math.PI, Math.PI);
final GeometricShapeFactory gsf2 = new GeometricShapeFactory(gf);
gsf2.setCentre(new PointDoubleXY(centreX, S_RADIUS));
gsf2.setSize(2 * S_RADIUS);
gsf2.setNumPoints(10);
final LineString arcBottom = gsf2.newArc(1.5 * Math.PI, Math.PI).reverse();
final PointList coordList = new PointList();
coordList.add(top, false);
coordList.add(CoordinatesListUtil.getPointArray(arcTop), false, 1, arcTop.getVertexCount() - 1);
coordList.add(new PointDoubleXY(centreX, HEIGHT / 2));
coordList.add(CoordinatesListUtil.getPointArray(arcBottom), false, 1, arcBottom.getVertexCount() - 1);
coordList.add(bottom, false);
return gf.lineString(coordList.toPointArray());
}
use of com.revolsys.geometry.model.GeometryFactory 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