Search in sources :

Example 6 with GeometricShapeFactory

use of com.revolsys.geometry.util.GeometricShapeFactory in project com.revolsys.open by revolsys.

the class PolygonUnionPerfTest method newPolygon.

Geometry newPolygon(final Point base, final double size, final int nPts) {
    final GeometricShapeFactory gsf = new GeometricShapeFactory(this.factory);
    gsf.setCentre(base);
    gsf.setSize(size);
    gsf.setNumPoints(nPts);
    final Geometry poly = gsf.newCircle();
    // System.out.println(circle);
    return poly;
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) GeometricShapeFactory(com.revolsys.geometry.util.GeometricShapeFactory)

Example 7 with GeometricShapeFactory

use of com.revolsys.geometry.util.GeometricShapeFactory in project com.revolsys.open by revolsys.

the class SerializabilityTest method testSerializable.

public void testSerializable() throws Exception {
    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
    final ObjectOutputStream oos = new ObjectOutputStream(baos);
    final GeometricShapeFactory gsf = new GeometricShapeFactory(fact);
    final Geometry g = gsf.newCircle();
    oos.writeObject(g);
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) GeometricShapeFactory(com.revolsys.geometry.util.GeometricShapeFactory) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ObjectOutputStream(java.io.ObjectOutputStream)

Example 8 with GeometricShapeFactory

use of com.revolsys.geometry.util.GeometricShapeFactory in project com.revolsys.open by revolsys.

the class WKBTest method testBigPolygon.

public void testBigPolygon() throws IOException, ParseException {
    final GeometricShapeFactory shapeFactory = new GeometricShapeFactory(this.geomFactory);
    shapeFactory.setBase(new PointDoubleXY(0, 0));
    shapeFactory.setSize(1000);
    shapeFactory.setNumPoints(1000);
    final Geometry geom = shapeFactory.newRectangle();
    runWKBTest(geom, 2, false);
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) GeometricShapeFactory(com.revolsys.geometry.util.GeometricShapeFactory) PointDoubleXY(com.revolsys.geometry.model.impl.PointDoubleXY)

Example 9 with GeometricShapeFactory

use of com.revolsys.geometry.util.GeometricShapeFactory in project com.revolsys.open by revolsys.

the class TestPerfDistanceGeomPair method newCircles.

Geometry[] newCircles(final int nPts) {
    final GeometricShapeFactory gsf = new GeometricShapeFactory();
    gsf.setCentre(new PointDoubleXY(0, 0));
    gsf.setSize(100);
    gsf.setNumPoints(nPts);
    final Polygon gRect = gsf.newCircle();
    gsf.setCentre(new PointDoubleXY(0, this.separationDist));
    final Polygon gRect2 = gsf.newCircle();
    return new Geometry[] { gRect, gRect2 };
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) GeometricShapeFactory(com.revolsys.geometry.util.GeometricShapeFactory) PointDoubleXY(com.revolsys.geometry.model.impl.PointDoubleXY) Polygon(com.revolsys.geometry.model.Polygon)

Example 10 with GeometricShapeFactory

use of com.revolsys.geometry.util.GeometricShapeFactory in project com.revolsys.open by revolsys.

the class PreparedPolygonIntersectsStressTest method newTestLine.

LineString newTestLine(final Point base, final double size, final int nPts) {
    final GeometricShapeFactory gsf = new GeometricShapeFactory();
    gsf.setCentre(base);
    gsf.setSize(size);
    gsf.setNumPoints(nPts);
    final Geometry circle = gsf.newCircle();
    // System.out.println(circle);
    return (LineString) circle.getBoundary();
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) GeometricShapeFactory(com.revolsys.geometry.util.GeometricShapeFactory) LineString(com.revolsys.geometry.model.LineString)

Aggregations

GeometricShapeFactory (com.revolsys.geometry.util.GeometricShapeFactory)15 Geometry (com.revolsys.geometry.model.Geometry)13 PointDoubleXY (com.revolsys.geometry.model.impl.PointDoubleXY)4 LineString (com.revolsys.geometry.model.LineString)3 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)2 Point (com.revolsys.geometry.model.Point)2 PointList (com.revolsys.geometry.model.PointList)2 Polygon (com.revolsys.geometry.model.Polygon)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 ObjectOutputStream (java.io.ObjectOutputStream)1