Examples of equalsExact()


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

   
    @Test
    public void testTouchAndCross() throws Exception {
        LineString ls = (LineString) wkt.read("LINESTRING(-5 0, 0 1, -5 2, 5 2, 5 3, -5 3, 0 4)");
        Geometry clipped = clipper.clip(ls, false);
        assertTrue(clipped.equalsExact(wkt.read("LINESTRING(0 2, 5 2, 5 3, 0 3)")));
        showResult("Touch and cross", ls, clipped);
    }
   
    @Test
    public void testTouchAndParallel() throws Exception {
View Full Code Here

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

   
    @Test
    public void testTouchAndParallel() throws Exception {
        LineString ls = (LineString) wkt.read("LINESTRING(-5 0, 0 1, -5 2, 0 2, 0 3, -5 3, 0 4)");
        Geometry clipped = clipper.clip(ls, false);
        assertTrue(clipped.equalsExact(wkt.read("LINESTRING(0 2, 0 3)")));
        showResult("Touch and parallel", ls, clipped);
    }
   
    @Test
    public void testInsideOut() throws Exception {
View Full Code Here

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

   
    @Test
    public void testPolygonCrossingTwoSides() throws Exception {
        Geometry g = wkt.read("POLYGON((-2 2, 2 2, 2 12, -2 12, -2 2))");
        Geometry clipped = clipper.clip(g, false);
        assertTrue(clipped.equalsExact(wkt.read("POLYGON((0 2, 2 2, 2 10, 0 10, 0 2))")));
        showResult("Crossing two sides", g, clipped);
    }
   
    @Test
    public void testPolygonCrossingThreeSides() throws Exception {
View Full Code Here

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

   
    @Test
    public void testPolygonCrossingThreeSides() throws Exception {
        Geometry g = wkt.read("POLYGON((-2 2, 12 2, 12 12, -2 12, -2 2))");
        Geometry clipped = clipper.clip(g, false);
        assertTrue(clipped.equalsExact(wkt.read("POLYGON((0 2, 10 2, 10 10, 0 10, 0 2))")));
        showResult("Crossing three sides", g, clipped);
    }
   
    @Test
    public void testDonutCrossingInvalid() throws Exception {
View Full Code Here

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

    @Test
    public void testDonutCrossingInvalid() throws Exception {
        Geometry g = wkt.read("POLYGON((6 2, 14 2, 14 8, 6 8, 6 2), (8 4, 12 4, 12 6, 8 6, 8 4))");
        Geometry clipped = clipper.clip(g, false);
        // System.out.println(clipped);
        assertTrue(clipped.equalsExact(wkt.read("POLYGON ((10 2, 10 8, 6 8, 6 2, 10 2), (10 4, 10 6, 8 6, 8 4, 10 4))")));
        showResult("Donut crossing, invalid geom", g, clipped);
    }
   
    @Test
    public void testDonutHoleOutside() throws Exception {
View Full Code Here

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

    @Test
    public void testDonutHoleOutside() throws Exception {
        Geometry g = wkt.read("POLYGON((6 2, 14 2, 14 8, 6 8, 6 2), (11 4, 12 4, 12 6, 11 6, 11 4))");
        Geometry clipped = clipper.clip(g, false);
        // System.out.println(clipped);
        assertTrue(clipped.equalsExact(wkt.read("POLYGON ((10 2, 10 8, 6 8, 6 2, 10 2))")));
        showResult("Donut crossing, invalid geom", g, clipped);
    }
   
    @Test
    public void testDonutCrossingValid() throws Exception {
View Full Code Here

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

   
    @Test
    public void testDonutCrossingValid() throws Exception {
        Geometry g = wkt.read("POLYGON((6 2, 14 2, 14 8, 6 8, 6 2), (8 4, 12 4, 12 6, 8 6, 8 4))");
        Geometry clipped = clipper.clip(g, true);
        assertTrue(clipped.equalsExact(wkt.read("POLYGON ((10 2, 6 2, 6 8, 10 8, 10 6, 8 6, 8 4, 10 4, 10 2))")));
        showResult("Donut crossing, valid geom", g, clipped);
    }
   
    @Test
    public void testGeotXYWZ() throws Exception {
View Full Code Here

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

            SimpleFeature feature = iter.next();
            Geometry geom = (Geometry) feature.getDefaultGeometry();
            Geometry minimumDiameter = new MinimumDiameter(geom).getDiameter();
            Object value = exp.evaluate(feature);
            assertTrue(value instanceof LineString);
            assertTrue(minimumDiameter.equalsExact((Geometry) value, 0.1));
        }
        iter.close();

        // Check for null safeness
        assertNull(exp.evaluate(null));
View Full Code Here

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

            SimpleFeature feature = iter.next();
            Geometry geom = (Geometry) feature.getDefaultGeometry();
            Geometry octagonalEnvelope = new OctagonalEnvelope(geom).toGeometry(geom.getFactory());
            Object value = exp.evaluate(feature);
            assertTrue(value instanceof Polygon);
            assertTrue(octagonalEnvelope.equalsExact((Geometry) value, 0.1));
        }
        iter.close();

        // Check for null safeness
        assertNull(exp.evaluate(null));
View Full Code Here

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

  {
    Iterator it = lines.iterator();
    while (it.hasNext())
    {
      Geometry lineg = (Geometry) it.next();
      if (lineg.equalsExact(g))
        return true;
      else if (equalsExactBackwards(lineg,g))
        return true;
       
    }
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.