Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.Geometry.norm()


    @Test
    public void testPolygonize() throws Exception {
        Geometry lines = wktRdr.read("MULTILINESTRING ((100 100, 200 100), (200 100, 300 100), (100 100, 100 200, 200 200), (200 100, 200 200), (200 200, 300 200, 300 100))");
        Geometry output = GeometryFunctions.polygonize(lines);
        Geometry expectedOutput = wktRdr.read("GEOMETRYCOLLECTION (POLYGON ((200 100, 100 100, 100 200, 200 200, 200 100)), POLYGON ((200 100, 200 200, 300 200, 300 100, 200 100)))");
        assertTrue(output.norm().equalsExact(expectedOutput.norm()));
    }
   
    @Test
    public void testSplitPolygon() throws Exception {
        Geometry poly = wktRdr.read("POLYGON ((100 100, 200 200, 200 100, 100 100))");
View Full Code Here


    public void testSplitPolygon() throws Exception {
        Geometry poly = wktRdr.read("POLYGON ((100 100, 200 200, 200 100, 100 100))");
        LineString line = (LineString) wktRdr.read("LINESTRING (150 200, 150 50)");
        Geometry output = GeometryFunctions.splitPolygon(poly, line);
        Geometry expectedOutput = wktRdr.read("GEOMETRYCOLLECTION (POLYGON ((150 100, 100 100, 150 150, 150 100)), POLYGON ((150 150, 200 200, 200 100, 150 100, 150 150)))");
        assertTrue(output.norm().equalsExact(expectedOutput.norm()));
    }
}
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.