use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class GeometryFactoryTest method checkCreateGeometryExact.
private void checkCreateGeometryExact(final String wkt) throws ParseException {
final Geometry g = this.geometryFactory.geometry(wkt);
final Geometry g2 = this.geometryFactory.geometry(g);
if (!g.equals(2, g2)) {
failNotEquals("Geometry not equal exact", g, g2);
}
}
use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class LineStringImplTest method testEquals10.
public void testEquals10() throws Exception {
final GeometryFactory geometryFactotyr = GeometryFactory.fixed2d(0, 1.0, 1.0);
Geometry l1 = geometryFactotyr.geometry("POLYGON((1732328800 519578384, 1732026179 519976285, 1731627364 519674014, 1731929984 519276112, 1732328800 519578384))");
Geometry l2 = geometryFactotyr.geometry("POLYGON((1731627364 519674014, 1731929984 519276112, 1732328800 519578384, 1732026179 519976285, 1731627364 519674014))");
l1 = l1.normalize();
l2 = l2.normalize();
assertTrue(l1.equals(2, l2));
}
use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class PerturbedGridPolygonBuilder method buildGrid.
private Geometry buildGrid() {
final LineString[] lines = new LineString[this.numLines * 2];
int index = 0;
for (int i = 0; i < this.numLines; i++) {
final Point p0 = new PointDoubleXY(getRandOrdinate(), 0);
final Point p1 = new PointDoubleXY(getRandOrdinate(), this.gridWidth);
final LineString line = this.geomFactory.lineString(new Point[] { p0, p1 });
lines[index++] = line;
}
for (int i = 0; i < this.numLines; i++) {
final Point p0 = new PointDoubleXY(0, getRandOrdinate());
final Point p1 = new PointDoubleXY(this.gridWidth, getRandOrdinate());
final LineString line = this.geomFactory.lineString(new Point[] { p0, p1 });
lines[index++] = line;
}
final Lineal ml = this.geomFactory.lineal(lines);
final Geometry grid = ml.buffer(this.lineWidth);
// System.out.println(grid);
return grid;
}
use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class PointLocatorTest method runPtLocator.
private void runPtLocator(final Location expected, final Point pt, final String wkt) throws Exception {
final Geometry geom = this.geometryFactory.geometry(wkt);
final PointLocator pointLocator = new PointLocator();
final double x = pt.getX();
final double y = pt.getY();
final Location loc = pointLocator.locate(geom, x, y);
assertEquals(expected, loc);
}
use of com.revolsys.geometry.model.Geometry in project com.revolsys.open by revolsys.
the class SimpleRectangleIntersector method newTestPoints.
private Point[] newTestPoints(final int nPts) {
final Point pt = this.geomFact.point(this.baseX, this.baseY);
final Geometry circle = pt.buffer(2 * this.rectSize, nPts / 4);
return CoordinatesListUtil.getPointArray(circle);
}
Aggregations