Examples of convexHull()


Examples of com.vividsolutions.jts.geom.GeometryCollection.convexHull()

        for (GCodeCommand c : commands) {
            if(c.type == GCodeCommand.Type.MOVE)
                pList.add(JTSUtils.createPoint2D(c.x, c.y));
        }
        GeometryCollection g = new GeometryCollection(pList.toArray(new Point[pList.size()]), JTSUtils.getFactory());
        return g.convexHull();
    }
   
    /**
     *
     * @return a deep copy of this snippet
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryCollection.convexHull()

                    // (see wikipedia: http://en.wikipedia.org/wiki/Latitude#The_length_of_a_degree_of_latitude)
                    try {
                        ConcaveHull hull = new ConcaveHull(gc, concaveHullAlpha);
                        outputHull = hull.getConcaveHull();
                    } catch (Exception e) {
                        outputHull = gc.convexHull();
                        LOG.debug("Could not generate ConcaveHull for WalkShed, using ConvexHull instead.");
                    }
                    LOG.debug("write shed geom");
                    geometryJSON.write(outputHull, sw);
                    LOG.debug("done");
View Full Code Here

Examples of com.vividsolutions.jts.geom.LineString.convexHull()

    SimpleFeature f;
    LineString l;
    Polygon p;

    l = line(gf, new int[] { 20, 20, 100, 20, 100, 100 });
    p = (Polygon) l.convexHull();
    f = SimpleFeatureBuilder.build(type, new Object[] { "ft1", point(gf, 20, 20), l, p },
        "test.1");
    data.addFeature(f);

    l = line(gf, new int[] { 130, 130, 110, 110, 110, 130, 30, 130 });
View Full Code Here

Examples of com.vividsolutions.jts.geom.LineString.convexHull()

    f = SimpleFeatureBuilder.build(type, new Object[] { "ft1", point(gf, 20, 20), l, p },
        "test.1");
    data.addFeature(f);

    l = line(gf, new int[] { 130, 130, 110, 110, 110, 130, 30, 130 });
    p = (Polygon) l.convexHull();
    f = SimpleFeatureBuilder.build(type, new Object[] { "ft2", point(gf, 130, 130), l, p },
        "test.2");
    data.addFeature(f);

    l = line(gf, new int[] { 150, 150, 190, 140, 190, 190 });
View Full Code Here

Examples of com.vividsolutions.jts.geom.LineString.convexHull()

    f = SimpleFeatureBuilder.build(type, new Object[] { "ft2", point(gf, 130, 130), l, p },
        "test.2");
    data.addFeature(f);

    l = line(gf, new int[] { 150, 150, 190, 140, 190, 190 });
    p = (Polygon) l.convexHull();
    f = SimpleFeatureBuilder.build(type, new Object[] { "ft3", point(gf, 150, 150), l, p },
        "test.3");
    data.addFeature(f);

    String typeName = type.getTypeName();
View Full Code Here

Examples of com.vividsolutions.jts.geom.MultiPoint.convexHull()

    private static GeometryFactory gf = new GeometryFactory();
    public Geometry getConvexHull() {
        if (newVertexAdded) {
            MultiPoint mp = gf.createMultiPoint(vertexCoords.toArray(new Coordinate[0]));
            newVertexAdded = false;
            mp.convexHull();
        }
        return convexHullAsGeom;
    }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.