Examples of equalsExact()


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

        FeatureIterator fi = fc.features();
        Feature f = fi.next();
       
        //test that the geometry was left in tact
        Geometry g = (Geometry) f.getDefaultGeometryProperty().getValue();
        assertTrue(g.equalsExact(WKT.read("LINESTRING(500125 500025,500175 500075)")));
       
        fi.close();
        assertEquals(CRS.decode("EPSG:32615"), f.getType().getCoordinateReferenceSystem());
    }
   
View Full Code Here

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

        FeatureIterator fi = fc.features();
        Feature f = fi.next();
       
        //test that geometry was reprojected
        Geometry g = (Geometry) f.getDefaultGeometryProperty().getValue();
        assertFalse(g.equalsExact(WKT.read("POINT(500050 500050)")));
        fi.close();
        assertEquals(CRS.decode("EPSG:4326"), f.getType().getCoordinateReferenceSystem());
    }
   
    @Test
View Full Code Here

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

       
        Geometry actual = new WKTReader().read(response.getOutputStreamContent());
        Geometry expected = new WKTReader().read("MULTIPOLYGON (((-2 6, 1 6, 1 5, 2 5, 2 2, -1 2, -1 3, -2 3, -2 6)), ((-1 0, 0 1, 1 0, 0 -1, -1 0)))");
       
        // equals does not work with geometry collections... go figure
        assertTrue(expected.equalsExact(actual));
    }
}
View Full Code Here

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

  }

  private static boolean contains(Collection geometries, Geometry g, boolean exact) {
    for (Iterator i = geometries.iterator(); i.hasNext();) {
      Geometry element = (Geometry) i.next();
      if (exact && element.equalsExact(g)) {
        return true;
      }
      if (!exact && element.equalsTopo(g)) {
        return true;
      }     
View Full Code Here

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

  }

  private boolean contains(Collection geometries, Geometry g) {
    for (Iterator i = geometries.iterator(); i.hasNext();) {
      Geometry element = (Geometry) i.next();
      if (element.equalsExact(g)) {
        return true;
      }
    }

    return false;
View Full Code Here

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

          + "(0 0, 40 0, 40 40, 0 40, 0 0),"
          + "(10 10, 30 10, 30 30, 10 30, 10 10))");
    Geometry b = reader.read("MULTILINESTRING("
          + "(0 0, 40 0, 40 40, 0 40, 0 0),"
          + "(10 10, 30 10, 30 30, 10 30, 10 10))");
    assertTrue(b.equalsExact(g.getBoundary()));
  }

  public void testMultiPolygonGetBoundary1() throws Exception {
    Geometry g = reader.read("MULTIPOLYGON("
          + "(  (0 0, 40 0, 40 40, 0 40, 0 0),"
View Full Code Here

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

          + "(  (200 200, 210 200, 210 210, 200 200) )  )");
    Geometry b = reader.read("MULTILINESTRING("
          + "(0 0, 40 0, 40 40, 0 40, 0 0),"
          + "(10 10, 30 10, 30 30, 10 30, 10 10),"
          + "(200 200, 210 200, 210 210, 200 200))");
    assertTrue(b.equalsExact(g.getBoundary()));
  }

  public void testMultiPolygonIsSimple2() throws Exception {
    Geometry g = reader.read("MULTIPOLYGON("
          + "((10 10, 10 20, 20 20, 20 15, 10 10)), "
View Full Code Here

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

  public void testMultiLineStringGetBoundary1() throws Exception {
    Geometry g = reader.read("MULTILINESTRING("
          + "(0 0,  100 0, 50 50),"
          + "(50 50, 50 -50))");
    Geometry m = reader.read("MULTIPOINT(0 0, 50 -50)");
    assertTrue(m.equalsExact(g.getBoundary()));
  }

  public void testMultiLineStringGetBoundary2() throws Exception {
    Geometry g = reader.read("MULTILINESTRING("
          + "(0 0,  100 0, 50 50),"
View Full Code Here

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

  public void testMultiLineStringGetBoundary2() throws Exception {
    Geometry g = reader.read("MULTILINESTRING("
          + "(0 0,  100 0, 50 50),"
          + "(50 50, 50 0))");
    Geometry m = reader.read("MULTIPOINT(0 0, 50 0)");
    assertTrue(m.equalsExact(g.getBoundary()));
  }

//  public void testGeometryCollectionGetBoundary1() throws Exception {
//    Geometry g = reader.read("GEOMETRYCOLLECTION("
//          + "POLYGON((0 0, 100 0, 100 100, 0 100, 0 0)),"
View Full Code Here

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

        assertTrue(coords2 != CompactLineString.STRAIGHT_LINE);
        assertEquals(coords.length, coords2.length);
        for (int i = 0; i < coords.length; i++)
            assertEquals(coords[i], coords2[i]);
        ls2 = CompactLineString.uncompactLineString(x1, y1, x0, y0, coords2, true);
        assertTrue(lsi.equalsExact(ls2, 0.00000015));
        LineString ls3 = CompactLineString.uncompactLineString(x1, y1, x0, y0, coords, true);
        assertTrue(lsi.equalsExact(ls3, 0.00000015));
        byte[] packedCoords2 = CompactLineString.compackLineString(x1, y1, x0, y0, ls, true);
        assertTrue(packedCoords2 != CompactLineString.STRAIGHT_LINE_PACKED);
        assertEquals(packedCoords.length, packedCoords2.length);
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.