use of com.revolsys.geometry.model.impl.PointDoubleXY in project com.revolsys.open by revolsys.
the class CreateRandomShapeFunctions method haltonPointsWithBases.
public static Geometry haltonPointsWithBases(final Geometry g, final int nPts, final int basei, final int basej) {
final BoundingBox env = FunctionsUtil.getEnvelopeOrDefault(g);
final Point[] pts = new Point[nPts];
final double baseX = env.getMinX();
final double baseY = env.getMinY();
int i = 0;
while (i < nPts) {
final double x = baseX + env.getWidth() * haltonOrdinate(i + 1, basei);
final double y = baseY + env.getHeight() * haltonOrdinate(i + 1, basej);
final Point p = new PointDoubleXY(x, y);
if (!env.covers(p)) {
continue;
}
pts[i++] = p;
}
return FunctionsUtil.getFactoryOrDefault(g).punctual(pts);
}
use of com.revolsys.geometry.model.impl.PointDoubleXY in project com.revolsys.open by revolsys.
the class AffineTransformationFunctions method transformByBaseline.
public static Geometry transformByBaseline(final Geometry g, final Geometry destBaseline) {
final BoundingBox env = g.getBoundingBox();
final Point src0 = new PointDoubleXY(env.getMinX(), env.getMinY());
final Point src1 = new PointDoubleXY(env.getMaxX(), env.getMinY());
final Point[] destPts = CoordinatesListUtil.getPointArray(destBaseline);
final Point dest0 = destPts[0];
final Point dest1 = destPts[1];
final AffineTransformation trans = AffineTransformationFactory.newFromBaseLines(src0, src1, dest0, dest1);
return trans.transform(g);
}
use of com.revolsys.geometry.model.impl.PointDoubleXY in project com.revolsys.open by revolsys.
the class TestPerfDistanceGeomPair method newSineStars.
Geometry[] newSineStars(final int nPts) {
final SineStarFactory gsf = new SineStarFactory();
gsf.setCentre(new PointDoubleXY(0, 0));
gsf.setSize(100);
gsf.setNumPoints(nPts);
final Geometry g = gsf.newSineStar().getBoundary();
gsf.setCentre(new PointDoubleXY(0, this.separationDist));
final Geometry g2 = gsf.newSineStar().getBoundary();
return new Geometry[] { g, g2 };
}
use of com.revolsys.geometry.model.impl.PointDoubleXY in project com.revolsys.open by revolsys.
the class TestPerfDistanceLinesPoints method newPoints.
Geometry[] newPoints(final BoundingBox extent, final int nPtsSide) {
final Geometry[] pts = new Geometry[nPtsSide * nPtsSide];
int index = 0;
final double xinc = extent.getWidth() / nPtsSide;
final double yinc = extent.getHeight() / nPtsSide;
for (int i = 0; i < nPtsSide; i++) {
for (int j = 0; j < nPtsSide; j++) {
pts[index++] = geomFact.point(new PointDoubleXY(extent.getMinX() + i * xinc, extent.getMinY() + j * yinc));
}
}
return pts;
}
use of com.revolsys.geometry.model.impl.PointDoubleXY in project com.revolsys.open by revolsys.
the class TestPerfDistanceLinesPoints method newDiagonalLine.
Geometry newDiagonalLine(final double extent, final int nSegs) {
final Point[] pts = new Point[nSegs + 1];
pts[0] = new PointDoubleXY(0, 0);
final double inc = extent / nSegs;
for (int i = 1; i <= nSegs; i++) {
final double ord = i * inc;
pts[i] = new PointDoubleXY(ord, ord);
}
return geomFact.lineString(pts);
}
Aggregations